brepjs 13.4.0 → 14.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +15 -14
- package/dist/2d.js +6 -5
- package/dist/arrayAccess-CmulMesb.cjs +40 -0
- package/dist/arrayAccess-xxcB3YNq.js +23 -0
- package/dist/{blueprint-CB_85Lz_.js → blueprint-B3A5x7P9.js} +9 -9
- package/dist/{blueprint-CDnBM-tA.cjs → blueprint-D0XChcek.cjs} +13 -13
- package/dist/{blueprintFns-DVDommWB.js → blueprintFns-BwAMXY3t.js} +4 -125
- package/dist/{blueprintFns-D4YucGaQ.cjs → blueprintFns-COrEYX29.cjs} +3 -142
- package/dist/{boolean2D-lqfKJKUY.cjs → boolean2D-BPsyKImE.cjs} +19 -18
- package/dist/{boolean2D-Mzp-0g7o.js → boolean2D-D_Te-6N6.js} +12 -11
- package/dist/{booleanFns-Bw8sAMgI.cjs → booleanFns-B6M6Lm0V.cjs} +24 -22
- package/dist/{booleanFns-B46fgObh.js → booleanFns-CgsaJFBf.js} +8 -6
- package/dist/brepjs.cjs +301 -90
- package/dist/brepjs.js +189 -26
- package/dist/constants-B9u763C3.js +9 -0
- package/dist/constants-unWN8k4c.cjs +26 -0
- package/dist/core/errors.d.ts +5 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/kernelCall.d.ts.map +1 -1
- package/dist/core/kernelErrorTranslation.d.ts +2 -0
- package/dist/core/kernelErrorTranslation.d.ts.map +1 -1
- package/dist/core.cjs +8 -7
- package/dist/core.js +5 -4
- package/dist/{cornerFinder-aBLykolI.js → cornerFinder-AEFnAxt4.js} +3 -3
- package/dist/{cornerFinder-BszIcLqj.cjs → cornerFinder-DTt_SvtC.cjs} +4 -4
- package/dist/{curveFns-DY4dFcP-.js → curveFns-CcInoOEA.js} +2 -2
- package/dist/{curveFns-CZszKLQB.cjs → curveFns-DCEcwcpd.cjs} +2 -2
- package/dist/{drawFns-BHNDF8hb.cjs → drawFns-BOwBIzPa.cjs} +34 -17
- package/dist/{drawFns-l5CY2s-l.js → drawFns-n9qif7QN.js} +16 -14
- package/dist/{errors-BlC5ZWv4.cjs → errors-9zQcQK1H.cjs} +28 -0
- package/dist/{errors-BVOlxlIA.js → errors-C-cgQA3w.js} +23 -1
- package/dist/{extrudeFns-b0uLn4E4.js → extrudeFns-DrDr9-nU.js} +3 -3
- package/dist/{extrudeFns-GpCB_Uzs.cjs → extrudeFns-Rcut7h8S.cjs} +3 -3
- package/dist/{faceFns-Cat-4X74.js → faceFns-TSH54pPQ.js} +93 -3
- package/dist/{faceFns-BywUjlJ7.cjs → faceFns-cE2WxY6I.cjs} +110 -2
- package/dist/{helpers-1iCCEElA.cjs → helpers-DZje6XWE.cjs} +18 -17
- package/dist/{helpers-DgX1UucG.js → helpers-XrXlKm8D.js} +8 -7
- package/dist/{historyFns-BFwp8NLX.js → historyFns-2hCWrX_X.js} +10 -10
- package/dist/{historyFns-DqxDtXIZ.cjs → historyFns-BiQ9dmzp.cjs} +10 -10
- package/dist/{importFns-ChXEJAvu.cjs → importFns-DGE5nCSW.cjs} +4 -4
- package/dist/{importFns-Cb8fcldB.js → importFns-m0xyj0Zt.js} +4 -4
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/brepkitAdapter.d.ts +149 -242
- package/dist/kernel/brepkit/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkit/evolutionOps.d.ts +1 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/{measureFns-D3rAp1X1.js → measureFns-DHByqdmn.js} +9 -16
- package/dist/{measureFns-Bx-kl7_g.cjs → measureFns-D_QKZ5yg.cjs} +9 -16
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-D3KAZ_ma.cjs → meshFns-CVe3Kc77.cjs} +4 -4
- package/dist/{meshFns-BPi0bhm9.js → meshFns-DL4Djz3w.js} +3 -3
- package/dist/ns/booleans.d.ts +10 -0
- package/dist/ns/booleans.d.ts.map +1 -0
- package/dist/ns/construction.d.ts +10 -0
- package/dist/ns/construction.d.ts.map +1 -0
- package/dist/ns/ioNs.d.ts +18 -0
- package/dist/ns/ioNs.d.ts.map +1 -0
- package/dist/ns/measurement.d.ts +6 -0
- package/dist/ns/measurement.d.ts.map +1 -0
- package/dist/ns/modifiers.d.ts +6 -0
- package/dist/ns/modifiers.d.ts.map +1 -0
- package/dist/ns/patterns.d.ts +5 -0
- package/dist/ns/patterns.d.ts.map +1 -0
- package/dist/ns/primitives.d.ts +7 -0
- package/dist/ns/primitives.d.ts.map +1 -0
- package/dist/ns/query.d.ts +6 -0
- package/dist/ns/query.d.ts.map +1 -0
- package/dist/ns/transforms.d.ts +5 -0
- package/dist/ns/transforms.d.ts.map +1 -0
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-BqLav0Ir.cjs → planeOps-6Wu7dMDN.cjs} +4 -3
- package/dist/{planeOps-D88tfyJs.js → planeOps-gTOEarV2.js} +3 -2
- package/dist/{primitiveFns-BGh9A9jR.cjs → primitiveFns-CRPGjIFg.cjs} +69 -69
- package/dist/{primitiveFns-CnZkW6Bi.js → primitiveFns-CeKiYSSW.js} +7 -7
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{arrayAccess-B5LgmXBo.js → shapeFns-DCi9O27X.js} +8 -30
- package/dist/{arrayAccess-t2dlxGSK.cjs → shapeFns-aEeSHNqX.cjs} +24 -64
- package/dist/shapeRef.cjs +8 -0
- package/dist/shapeRef.d.ts +5 -0
- package/dist/shapeRef.d.ts.map +1 -0
- package/dist/shapeRef.js +2 -0
- package/dist/shapeRefFns-B1TODUMl.js +194 -0
- package/dist/shapeRefFns-CVdS6jWS.cjs +229 -0
- package/dist/{shapeTypes-Di6GlhPk.js → shapeTypes-BO1aiDhi.js} +2642 -2546
- package/dist/{shapeTypes-8eK48l-X.cjs → shapeTypes-BqWQlrYE.cjs} +2642 -2546
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-D9KYP9sL.cjs → solidBuilders-0iVdiZUw.cjs} +3 -3
- package/dist/{solidBuilders-ctO_wFrm.js → solidBuilders-jk7HfWs8.js} +3 -3
- package/dist/{surfaceBuilders-CZzipftq.cjs → surfaceBuilders-C_8rs79F.cjs} +3 -3
- package/dist/{surfaceBuilders-BaqeZa0x.js → surfaceBuilders-DE5e6bp8.js} +3 -3
- package/dist/topology/api.d.ts +3 -3
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +4 -3
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeRef/index.d.ts +7 -0
- package/dist/topology/shapeRef/index.d.ts.map +1 -0
- package/dist/topology/shapeRef/scoring.d.ts +16 -0
- package/dist/topology/shapeRef/scoring.d.ts.map +1 -0
- package/dist/topology/shapeRef/shapeRefFns.d.ts +47 -0
- package/dist/topology/shapeRef/shapeRefFns.d.ts.map +1 -0
- package/dist/topology/shapeRef/shapeRefTypes.d.ts +40 -0
- package/dist/topology/shapeRef/shapeRefTypes.d.ts.map +1 -0
- package/dist/topology.cjs +20 -20
- package/dist/topology.js +6 -6
- package/dist/{vecOps-DKGelwGL.cjs → vecOps-BXvBYIor.cjs} +0 -26
- package/dist/{vecOps-DFfUfsmc.js → vecOps-D9etjPgV.js} +1 -9
- package/dist/vectors.cjs +5 -4
- package/dist/vectors.js +3 -2
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -1
- package/package.json +14 -4
- /package/dist/{workerHandler-nLkvSOKX.cjs → workerHandler-C-7OUJsa.cjs} +0 -0
- /package/dist/{workerHandler-BrOTzYRI.js → workerHandler-o2xzAfFk.js} +0 -0
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { J as _usingCtx, L as DisposalScope, Y as getKernel, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
1
|
+
import { J as _usingCtx, L as DisposalScope, Y as getKernel, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, r as ioError, s as safeIndex, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
|
|
3
|
+
import { _ as downcast, c as normalAt, g as cast, l as outerWire, n as faceCenter } from "./faceFns-TSH54pPQ.js";
|
|
4
|
+
import { t as DEG2RAD } from "./constants-B9u763C3.js";
|
|
4
5
|
import { r as toVec3 } from "./types-BWBlwp6w.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { m as offsetWire2D } from "./curveFns-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { o as
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
6
|
+
import { c as vecLength, d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-D9etjPgV.js";
|
|
7
|
+
import { a as planeToWorld, o as resolvePlane } from "./planeOps-gTOEarV2.js";
|
|
8
|
+
import { M as getEdges } from "./shapeFns-DCi9O27X.js";
|
|
9
|
+
import { m as offsetWire2D } from "./curveFns-CcInoOEA.js";
|
|
10
|
+
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-xxcB3YNq.js";
|
|
11
|
+
import { c as makeBSplineApproximation, d as makeEllipse, p as makeHelix, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeCircle } from "./surfaceBuilders-DE5e6bp8.js";
|
|
12
|
+
import { _ as chamferCurves, b as intersectCurves, c as roundedRectangleBlueprint, f as Sketch, g as Blueprints, h as CompoundBlueprint, l as BaseSketcher2d, m as organiseBlueprints, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D, u as BlueprintSketcher, v as filletCurves, x as Flatbush, y as make2dOffset } from "./boolean2D-D_Te-6N6.js";
|
|
13
|
+
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-XrXlKm8D.js";
|
|
14
|
+
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-B3A5x7P9.js";
|
|
15
|
+
import { o as makeSolid, t as makeCompound } from "./solidBuilders-jk7HfWs8.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-AEFnAxt4.js";
|
|
17
|
+
import { c as twistExtrude, n as revolve, r as complexExtrude, t as extrude } from "./extrudeFns-DrDr9-nU.js";
|
|
16
18
|
import opentype from "opentype.js";
|
|
17
19
|
//#region src/2d/lib/stitching.ts
|
|
18
20
|
/**
|
|
@@ -247,6 +247,24 @@ var kernel_ERROR_PATTERNS = [
|
|
|
247
247
|
translation: "Shape validation failed. The resulting shape has invalid topology. Try healing the shape or checking input geometry."
|
|
248
248
|
}
|
|
249
249
|
];
|
|
250
|
+
var ERROR_CODE_SUGGESTIONS = {
|
|
251
|
+
FUSE_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
|
|
252
|
+
CUT_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
|
|
253
|
+
FUSE_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
254
|
+
CUT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
255
|
+
INTERSECT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
256
|
+
SWEEP_FAILED: "Ensure the spine curve has no sharp corners or self-intersections. Try simplifying the profile or using a smoother path.",
|
|
257
|
+
LOFT_FAILED: "Check that all profiles have the same number of edges and consistent orientation. Try reordering profiles.",
|
|
258
|
+
FILLET_NOT_3D: "The fillet radius may be too large for the selected edges. Try a smaller radius or check that adjacent faces have enough room.",
|
|
259
|
+
CHAMFER_NOT_3D: "The chamfer distance may be too large. Try a smaller distance or check edge geometry.",
|
|
260
|
+
SHELL_NOT_3D: "The shell thickness may be too large for the shape. Try reducing thickness or removing problematic faces.",
|
|
261
|
+
OFFSET_NOT_3D: "The offset distance may be too large for the shape geometry. Try a smaller distance.",
|
|
262
|
+
DRAFT_FAILED: "The draft angle may be too large or the selected faces incompatible. Try a smaller angle or different faces."
|
|
263
|
+
};
|
|
264
|
+
/** Look up an actionable suggestion for a given error code. */
|
|
265
|
+
function getSuggestionForCode(code) {
|
|
266
|
+
return ERROR_CODE_SUGGESTIONS[code];
|
|
267
|
+
}
|
|
250
268
|
/**
|
|
251
269
|
* Translate an kernel error message into a user-friendly explanation.
|
|
252
270
|
* If no pattern matches, returns the original message.
|
|
@@ -347,6 +365,7 @@ var BrepErrorCode = {
|
|
|
347
365
|
INTERSECTION_FAILED: "INTERSECTION_FAILED",
|
|
348
366
|
SELF_INTERSECTION_FAILED: "SELF_INTERSECTION_FAILED",
|
|
349
367
|
STRAIGHT_SKELETON_FAILED: "STRAIGHT_SKELETON_FAILED",
|
|
368
|
+
CENTER_OF_MASS_FAILED: "CENTER_OF_MASS_FAILED",
|
|
350
369
|
COMPOUND_NO_FACES: "COMPOUND_NO_FACES",
|
|
351
370
|
COMPOUND_FACE_NOT_FOUND: "COMPOUND_FACE_NOT_FOUND",
|
|
352
371
|
FINDER_NOT_UNIQUE: "FINDER_NOT_UNIQUE",
|
|
@@ -384,6 +403,9 @@ var BrepErrorCode = {
|
|
|
384
403
|
CURVE2D_QUERY_FAILED: "CURVE2D_QUERY_FAILED",
|
|
385
404
|
CURVE2D_INTERSECTION_FAILED: "CURVE2D_INTERSECTION_FAILED",
|
|
386
405
|
CURVE2D_BRIDGE_FAILED: "CURVE2D_BRIDGE_FAILED",
|
|
406
|
+
CLONE_FAILED: "CLONE_FAILED",
|
|
407
|
+
SIMPLIFY_FAILED: "SIMPLIFY_FAILED",
|
|
408
|
+
TO_BREP_FAILED: "TO_BREP_FAILED",
|
|
387
409
|
UNSUPPORTED_CAPABILITY: "UNSUPPORTED_CAPABILITY"
|
|
388
410
|
};
|
|
389
411
|
function makeError(kind, code, message, cause, metadata, suggestion) {
|
|
@@ -534,6 +556,12 @@ Object.defineProperty(exports, "fromNullable", {
|
|
|
534
556
|
return fromNullable;
|
|
535
557
|
}
|
|
536
558
|
});
|
|
559
|
+
Object.defineProperty(exports, "getSuggestionForCode", {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
get: function() {
|
|
562
|
+
return getSuggestionForCode;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
537
565
|
Object.defineProperty(exports, "ioError", {
|
|
538
566
|
enumerable: true,
|
|
539
567
|
get: function() {
|
|
@@ -247,6 +247,24 @@ var kernel_ERROR_PATTERNS = [
|
|
|
247
247
|
translation: "Shape validation failed. The resulting shape has invalid topology. Try healing the shape or checking input geometry."
|
|
248
248
|
}
|
|
249
249
|
];
|
|
250
|
+
var ERROR_CODE_SUGGESTIONS = {
|
|
251
|
+
FUSE_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
|
|
252
|
+
CUT_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
|
|
253
|
+
FUSE_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
254
|
+
CUT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
255
|
+
INTERSECT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
|
|
256
|
+
SWEEP_FAILED: "Ensure the spine curve has no sharp corners or self-intersections. Try simplifying the profile or using a smoother path.",
|
|
257
|
+
LOFT_FAILED: "Check that all profiles have the same number of edges and consistent orientation. Try reordering profiles.",
|
|
258
|
+
FILLET_NOT_3D: "The fillet radius may be too large for the selected edges. Try a smaller radius or check that adjacent faces have enough room.",
|
|
259
|
+
CHAMFER_NOT_3D: "The chamfer distance may be too large. Try a smaller distance or check edge geometry.",
|
|
260
|
+
SHELL_NOT_3D: "The shell thickness may be too large for the shape. Try reducing thickness or removing problematic faces.",
|
|
261
|
+
OFFSET_NOT_3D: "The offset distance may be too large for the shape geometry. Try a smaller distance.",
|
|
262
|
+
DRAFT_FAILED: "The draft angle may be too large or the selected faces incompatible. Try a smaller angle or different faces."
|
|
263
|
+
};
|
|
264
|
+
/** Look up an actionable suggestion for a given error code. */
|
|
265
|
+
function getSuggestionForCode(code) {
|
|
266
|
+
return ERROR_CODE_SUGGESTIONS[code];
|
|
267
|
+
}
|
|
250
268
|
/**
|
|
251
269
|
* Translate an kernel error message into a user-friendly explanation.
|
|
252
270
|
* If no pattern matches, returns the original message.
|
|
@@ -347,6 +365,7 @@ var BrepErrorCode = {
|
|
|
347
365
|
INTERSECTION_FAILED: "INTERSECTION_FAILED",
|
|
348
366
|
SELF_INTERSECTION_FAILED: "SELF_INTERSECTION_FAILED",
|
|
349
367
|
STRAIGHT_SKELETON_FAILED: "STRAIGHT_SKELETON_FAILED",
|
|
368
|
+
CENTER_OF_MASS_FAILED: "CENTER_OF_MASS_FAILED",
|
|
350
369
|
COMPOUND_NO_FACES: "COMPOUND_NO_FACES",
|
|
351
370
|
COMPOUND_FACE_NOT_FOUND: "COMPOUND_FACE_NOT_FOUND",
|
|
352
371
|
FINDER_NOT_UNIQUE: "FINDER_NOT_UNIQUE",
|
|
@@ -384,6 +403,9 @@ var BrepErrorCode = {
|
|
|
384
403
|
CURVE2D_QUERY_FAILED: "CURVE2D_QUERY_FAILED",
|
|
385
404
|
CURVE2D_INTERSECTION_FAILED: "CURVE2D_INTERSECTION_FAILED",
|
|
386
405
|
CURVE2D_BRIDGE_FAILED: "CURVE2D_BRIDGE_FAILED",
|
|
406
|
+
CLONE_FAILED: "CLONE_FAILED",
|
|
407
|
+
SIMPLIFY_FAILED: "SIMPLIFY_FAILED",
|
|
408
|
+
TO_BREP_FAILED: "TO_BREP_FAILED",
|
|
387
409
|
UNSUPPORTED_CAPABILITY: "UNSUPPORTED_CAPABILITY"
|
|
388
410
|
};
|
|
389
411
|
function makeError(kind, code, message, cause, metadata, suggestion) {
|
|
@@ -462,4 +484,4 @@ function safeIndex(arr, index, context) {
|
|
|
462
484
|
return arr[index];
|
|
463
485
|
}
|
|
464
486
|
//#endregion
|
|
465
|
-
export {
|
|
487
|
+
export { ok as A, unwrapOr as B, fromNullable as C, mapBoth as D, map as E, tapErr as F, zip as H, tryCatch as I, tryCatchAsync as L, orElse as M, pipeline as N, mapErr as O, tap as P, unwrap as R, flatten as S, isOk as T, unwrapOrElse as V, all as _, moduleInitError as a, err as b, sketcherStateError as c, validationError as d, getSuggestionForCode as f, OK as g, bug as h, kernelError as i, or as j, match as k, typeCastError as l, BrepBugError as m, computationError as n, queryError as o, translateKernelError as p, ioError as r, safeIndex as s, BrepErrorCode as t, unsupportedError as u, andThen as v, isErr as w, flatMap as x, collect as y, unwrapErr as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Y as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-
|
|
1
|
+
import { Y as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, R as unwrap, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
|
|
3
|
+
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-D9etjPgV.js";
|
|
4
4
|
//#region src/operations/extrudeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build an kernel scaling law from an extrusion profile configuration.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_vecOps = require("./vecOps-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BqWQlrYE.cjs");
|
|
2
|
+
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
+
const require_vecOps = require("./vecOps-BXvBYIor.cjs");
|
|
4
4
|
//#region src/operations/extrudeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build an kernel scaling law from an extrusion profile configuration.
|
|
@@ -1,6 +1,96 @@
|
|
|
1
|
-
import { Y as getKernel, t as castShape } from "./shapeTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { J as _usingCtx, L as DisposalScope, Y as getKernel, t as castShape } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, R as unwrap, b as err, f as getSuggestionForCode, l as typeCastError, p as translateKernelError } from "./errors-C-cgQA3w.js";
|
|
3
3
|
import { r as toVec3 } from "./types-BWBlwp6w.js";
|
|
4
|
+
//#region src/core/kernelCall.ts
|
|
5
|
+
function buildError(kind, code, message, cause, suggestion) {
|
|
6
|
+
const base = {
|
|
7
|
+
kind,
|
|
8
|
+
code,
|
|
9
|
+
message,
|
|
10
|
+
cause
|
|
11
|
+
};
|
|
12
|
+
if (suggestion) return {
|
|
13
|
+
...base,
|
|
14
|
+
suggestion
|
|
15
|
+
};
|
|
16
|
+
return base;
|
|
17
|
+
}
|
|
18
|
+
var errorFactories = {
|
|
19
|
+
KERNEL_OPERATION: (code, message, cause, suggestion) => buildError("KERNEL_OPERATION", code, message, cause, suggestion),
|
|
20
|
+
VALIDATION: (code, message, cause, suggestion) => buildError("VALIDATION", code, message, cause, suggestion),
|
|
21
|
+
TYPE_CAST: (code, message, cause, suggestion) => buildError("TYPE_CAST", code, message, cause, suggestion),
|
|
22
|
+
SKETCHER_STATE: (code, message, cause, suggestion) => buildError("SKETCHER_STATE", code, message, cause, suggestion),
|
|
23
|
+
MODULE_INIT: (code, message, cause, suggestion) => buildError("MODULE_INIT", code, message, cause, suggestion),
|
|
24
|
+
COMPUTATION: (code, message, cause, suggestion) => buildError("COMPUTATION", code, message, cause, suggestion),
|
|
25
|
+
IO: (code, message, cause, suggestion) => buildError("IO", code, message, cause, suggestion),
|
|
26
|
+
QUERY: (code, message, cause, suggestion) => buildError("QUERY", code, message, cause, suggestion),
|
|
27
|
+
UNSUPPORTED: (code, message, cause, suggestion) => buildError("UNSUPPORTED", code, message, cause, suggestion)
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Wrap a kernel call that returns an KernelShape, automatically casting
|
|
31
|
+
* the result into a branded AnyShape. On exception, returns an Err
|
|
32
|
+
* with the given error code and message.
|
|
33
|
+
*
|
|
34
|
+
* kernel error messages are automatically translated into user-friendly
|
|
35
|
+
* explanations when the error kind is KERNEL_OPERATION.
|
|
36
|
+
*/
|
|
37
|
+
function kernelCall(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
38
|
+
try {
|
|
39
|
+
return ok(castShape(fn()));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
const rawMessage = e instanceof Error ? e.message : String(e);
|
|
42
|
+
const translatedMessage = kind === "KERNEL_OPERATION" ? translateKernelError(rawMessage) : rawMessage;
|
|
43
|
+
const suggestion = getSuggestionForCode(code);
|
|
44
|
+
return err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e, suggestion));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Wrap a kernel call that returns an arbitrary value. On exception,
|
|
49
|
+
* returns an Err with the given error code and message.
|
|
50
|
+
*
|
|
51
|
+
* kernel error messages are automatically translated into user-friendly
|
|
52
|
+
* explanations when the error kind is KERNEL_OPERATION.
|
|
53
|
+
*/
|
|
54
|
+
function kernelCallRaw(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
55
|
+
try {
|
|
56
|
+
return ok(fn());
|
|
57
|
+
} catch (e) {
|
|
58
|
+
const rawMessage = e instanceof Error ? e.message : String(e);
|
|
59
|
+
const translatedMessage = kind === "KERNEL_OPERATION" ? translateKernelError(rawMessage) : rawMessage;
|
|
60
|
+
const suggestion = getSuggestionForCode(code);
|
|
61
|
+
return err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e, suggestion));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Wrap a kernel call that needs intermediate kernel allocations.
|
|
66
|
+
*
|
|
67
|
+
* A DisposalScope is created and passed to fn. The scope is disposed
|
|
68
|
+
* deterministically after fn returns or throws — ensuring no intermediate
|
|
69
|
+
* handles are leaked even on error paths.
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* return kernelCallScoped(
|
|
73
|
+
* (scope) => {
|
|
74
|
+
* const axis = scope.register(makeKernelAx1(origin, dir));
|
|
75
|
+
* return getKernel().revolveVec(...) // was: oc.BRepBuilderAPI_MakeRevol_1(shape.wrapped, axis).Shape();
|
|
76
|
+
* },
|
|
77
|
+
* BrepErrorCode.REVOLUTION_NOT_3D,
|
|
78
|
+
* 'Revolution failed'
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
function kernelCallScoped(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
83
|
+
try {
|
|
84
|
+
var _usingCtx$1 = _usingCtx();
|
|
85
|
+
const scope = _usingCtx$1.u(new DisposalScope());
|
|
86
|
+
return kernelCall(() => fn(scope), code, message, kind);
|
|
87
|
+
} catch (_) {
|
|
88
|
+
_usingCtx$1.e = _;
|
|
89
|
+
} finally {
|
|
90
|
+
_usingCtx$1.d();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
4
94
|
//#region src/topology/cast.ts
|
|
5
95
|
var TOPO_ENUM = {
|
|
6
96
|
compound: 0,
|
|
@@ -214,4 +304,4 @@ function innerWires(face) {
|
|
|
214
304
|
return Array.from(iterTopo(face.wrapped, "wire")).map((w) => castShape(unwrap(downcast(w)))).filter((w) => !getKernel().isSame(w.wrapped, outer.wrapped));
|
|
215
305
|
}
|
|
216
306
|
//#endregion
|
|
217
|
-
export { downcast as _, flipFaceOrientation as a, iterTopo as b, normalAt as c, projectPointOnFace as d, removeHolesFromFace as f, cast as g, asTopo as h, faceOrientation as i, outerWire as l, uvCoordinates as m, faceCenter as n, getSurfaceType as o, uvBounds as p, faceGeomType as r, innerWires as s, classifyPointOnFace as t, pointOnSurface as u, fromBREP as v, shapeType as x, isCompSolid as y };
|
|
307
|
+
export { kernelCallRaw as C, kernelCall as S, downcast as _, flipFaceOrientation as a, iterTopo as b, normalAt as c, projectPointOnFace as d, removeHolesFromFace as f, cast as g, asTopo as h, faceOrientation as i, outerWire as l, uvCoordinates as m, faceCenter as n, getSurfaceType as o, uvBounds as p, faceGeomType as r, innerWires as s, classifyPointOnFace as t, pointOnSurface as u, fromBREP as v, kernelCallScoped as w, shapeType as x, isCompSolid as y };
|
|
@@ -1,6 +1,96 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BqWQlrYE.cjs");
|
|
2
|
+
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
3
|
const require_types = require("./types-BjDcsS7l.cjs");
|
|
4
|
+
//#region src/core/kernelCall.ts
|
|
5
|
+
function buildError(kind, code, message, cause, suggestion) {
|
|
6
|
+
const base = {
|
|
7
|
+
kind,
|
|
8
|
+
code,
|
|
9
|
+
message,
|
|
10
|
+
cause
|
|
11
|
+
};
|
|
12
|
+
if (suggestion) return {
|
|
13
|
+
...base,
|
|
14
|
+
suggestion
|
|
15
|
+
};
|
|
16
|
+
return base;
|
|
17
|
+
}
|
|
18
|
+
var errorFactories = {
|
|
19
|
+
KERNEL_OPERATION: (code, message, cause, suggestion) => buildError("KERNEL_OPERATION", code, message, cause, suggestion),
|
|
20
|
+
VALIDATION: (code, message, cause, suggestion) => buildError("VALIDATION", code, message, cause, suggestion),
|
|
21
|
+
TYPE_CAST: (code, message, cause, suggestion) => buildError("TYPE_CAST", code, message, cause, suggestion),
|
|
22
|
+
SKETCHER_STATE: (code, message, cause, suggestion) => buildError("SKETCHER_STATE", code, message, cause, suggestion),
|
|
23
|
+
MODULE_INIT: (code, message, cause, suggestion) => buildError("MODULE_INIT", code, message, cause, suggestion),
|
|
24
|
+
COMPUTATION: (code, message, cause, suggestion) => buildError("COMPUTATION", code, message, cause, suggestion),
|
|
25
|
+
IO: (code, message, cause, suggestion) => buildError("IO", code, message, cause, suggestion),
|
|
26
|
+
QUERY: (code, message, cause, suggestion) => buildError("QUERY", code, message, cause, suggestion),
|
|
27
|
+
UNSUPPORTED: (code, message, cause, suggestion) => buildError("UNSUPPORTED", code, message, cause, suggestion)
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Wrap a kernel call that returns an KernelShape, automatically casting
|
|
31
|
+
* the result into a branded AnyShape. On exception, returns an Err
|
|
32
|
+
* with the given error code and message.
|
|
33
|
+
*
|
|
34
|
+
* kernel error messages are automatically translated into user-friendly
|
|
35
|
+
* explanations when the error kind is KERNEL_OPERATION.
|
|
36
|
+
*/
|
|
37
|
+
function kernelCall(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
38
|
+
try {
|
|
39
|
+
return require_errors.ok(require_shapeTypes.castShape(fn()));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
const rawMessage = e instanceof Error ? e.message : String(e);
|
|
42
|
+
const translatedMessage = kind === "KERNEL_OPERATION" ? require_errors.translateKernelError(rawMessage) : rawMessage;
|
|
43
|
+
const suggestion = require_errors.getSuggestionForCode(code);
|
|
44
|
+
return require_errors.err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e, suggestion));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Wrap a kernel call that returns an arbitrary value. On exception,
|
|
49
|
+
* returns an Err with the given error code and message.
|
|
50
|
+
*
|
|
51
|
+
* kernel error messages are automatically translated into user-friendly
|
|
52
|
+
* explanations when the error kind is KERNEL_OPERATION.
|
|
53
|
+
*/
|
|
54
|
+
function kernelCallRaw(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
55
|
+
try {
|
|
56
|
+
return require_errors.ok(fn());
|
|
57
|
+
} catch (e) {
|
|
58
|
+
const rawMessage = e instanceof Error ? e.message : String(e);
|
|
59
|
+
const translatedMessage = kind === "KERNEL_OPERATION" ? require_errors.translateKernelError(rawMessage) : rawMessage;
|
|
60
|
+
const suggestion = require_errors.getSuggestionForCode(code);
|
|
61
|
+
return require_errors.err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e, suggestion));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Wrap a kernel call that needs intermediate kernel allocations.
|
|
66
|
+
*
|
|
67
|
+
* A DisposalScope is created and passed to fn. The scope is disposed
|
|
68
|
+
* deterministically after fn returns or throws — ensuring no intermediate
|
|
69
|
+
* handles are leaked even on error paths.
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* return kernelCallScoped(
|
|
73
|
+
* (scope) => {
|
|
74
|
+
* const axis = scope.register(makeKernelAx1(origin, dir));
|
|
75
|
+
* return getKernel().revolveVec(...) // was: oc.BRepBuilderAPI_MakeRevol_1(shape.wrapped, axis).Shape();
|
|
76
|
+
* },
|
|
77
|
+
* BrepErrorCode.REVOLUTION_NOT_3D,
|
|
78
|
+
* 'Revolution failed'
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
function kernelCallScoped(fn, code, message, kind = "KERNEL_OPERATION") {
|
|
83
|
+
try {
|
|
84
|
+
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
85
|
+
const scope = _usingCtx$1.u(new require_shapeTypes.DisposalScope());
|
|
86
|
+
return kernelCall(() => fn(scope), code, message, kind);
|
|
87
|
+
} catch (_) {
|
|
88
|
+
_usingCtx$1.e = _;
|
|
89
|
+
} finally {
|
|
90
|
+
_usingCtx$1.d();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
4
94
|
//#region src/topology/cast.ts
|
|
5
95
|
var TOPO_ENUM = {
|
|
6
96
|
compound: 0,
|
|
@@ -292,6 +382,24 @@ Object.defineProperty(exports, "iterTopo", {
|
|
|
292
382
|
return iterTopo;
|
|
293
383
|
}
|
|
294
384
|
});
|
|
385
|
+
Object.defineProperty(exports, "kernelCall", {
|
|
386
|
+
enumerable: true,
|
|
387
|
+
get: function() {
|
|
388
|
+
return kernelCall;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
Object.defineProperty(exports, "kernelCallRaw", {
|
|
392
|
+
enumerable: true,
|
|
393
|
+
get: function() {
|
|
394
|
+
return kernelCallRaw;
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
Object.defineProperty(exports, "kernelCallScoped", {
|
|
398
|
+
enumerable: true,
|
|
399
|
+
get: function() {
|
|
400
|
+
return kernelCallScoped;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
295
403
|
Object.defineProperty(exports, "normalAt", {
|
|
296
404
|
enumerable: true,
|
|
297
405
|
get: function() {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BqWQlrYE.cjs");
|
|
2
|
+
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-cE2WxY6I.cjs");
|
|
4
|
+
const require_constants = require("./constants-unWN8k4c.cjs");
|
|
5
|
+
const require_vecOps = require("./vecOps-BXvBYIor.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-aEeSHNqX.cjs");
|
|
7
|
+
const require_curveFns = require("./curveFns-DCEcwcpd.cjs");
|
|
8
|
+
const require_measureFns = require("./measureFns-D_QKZ5yg.cjs");
|
|
8
9
|
//#region src/utils/vec2d.ts
|
|
9
10
|
/** Precision for curve intersection and parameter operations. */
|
|
10
11
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -138,10 +139,10 @@ function createTypedFinder(topoKind, filters, rebuild, extend) {
|
|
|
138
139
|
const shouldKeep = (element) => filters.every((f) => f(element));
|
|
139
140
|
function getCachedElements(shape) {
|
|
140
141
|
switch (topoKind) {
|
|
141
|
-
case "edge": return
|
|
142
|
-
case "face": return
|
|
143
|
-
case "wire": return
|
|
144
|
-
case "vertex": return
|
|
142
|
+
case "edge": return require_shapeFns.getEdges(shape);
|
|
143
|
+
case "face": return require_shapeFns.getFaces(shape);
|
|
144
|
+
case "wire": return require_shapeFns.getWires(shape);
|
|
145
|
+
case "vertex": return require_shapeFns.getVertices(shape);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
const extractElements = (shape) => {
|
|
@@ -157,14 +158,14 @@ function createTypedFinder(topoKind, filters, rebuild, extend) {
|
|
|
157
158
|
inList: (elements) => {
|
|
158
159
|
const hashSet = /* @__PURE__ */ new Map();
|
|
159
160
|
for (const e of elements) {
|
|
160
|
-
const h =
|
|
161
|
+
const h = require_shapeFns.getHashCode(e);
|
|
161
162
|
const bucket = hashSet.get(h);
|
|
162
163
|
if (bucket) bucket.push(e);
|
|
163
164
|
else hashSet.set(h, [e]);
|
|
164
165
|
}
|
|
165
166
|
return withFilter((el) => {
|
|
166
|
-
const bucket = hashSet.get(
|
|
167
|
-
return !!bucket && bucket.some((e) =>
|
|
167
|
+
const bucket = hashSet.get(require_shapeFns.getHashCode(el));
|
|
168
|
+
return !!bucket && bucket.some((e) => require_shapeFns.isSameShape(e, el));
|
|
168
169
|
});
|
|
169
170
|
},
|
|
170
171
|
not: (builderFn) => {
|
|
@@ -250,7 +251,7 @@ function edgeDirectionFilter(dir, angle) {
|
|
|
250
251
|
const { tangent: rawTangent } = kernel.curveTangent(edge.wrapped, midParam);
|
|
251
252
|
const tangent = require_vecOps.vecNormalize(rawTangent);
|
|
252
253
|
const ang = Math.acos(Math.min(1, Math.abs(require_vecOps.vecDot(tangent, d))));
|
|
253
|
-
return Math.abs(ang -
|
|
254
|
+
return Math.abs(ang - require_constants.DEG2RAD * angle) < 1e-6;
|
|
254
255
|
};
|
|
255
256
|
}
|
|
256
257
|
function buildEdgeFinder(filters) {
|
|
@@ -275,7 +276,7 @@ function faceDirectionFilter(dir, angle) {
|
|
|
275
276
|
return (face) => {
|
|
276
277
|
const n = require_faceFns.normalAt(face);
|
|
277
278
|
const ang = Math.acos(Math.min(1, Math.abs(require_vecOps.vecDot(require_vecOps.vecNormalize(n), d))));
|
|
278
|
-
return Math.abs(ang -
|
|
279
|
+
return Math.abs(ang - require_constants.DEG2RAD * angle) < 1e-6;
|
|
279
280
|
};
|
|
280
281
|
}
|
|
281
282
|
function buildFaceFinder(filters) {
|
|
@@ -302,7 +303,7 @@ function buildWireFinder(filters) {
|
|
|
302
303
|
return createTypedFinder("wire", filters, buildWireFinder, (_base, withFilter) => ({
|
|
303
304
|
isClosed: () => withFilter((wire) => require_curveFns.curveIsClosed(wire)),
|
|
304
305
|
isOpen: () => withFilter((wire) => !require_curveFns.curveIsClosed(wire)),
|
|
305
|
-
ofEdgeCount: (count) => withFilter((wire) =>
|
|
306
|
+
ofEdgeCount: (count) => withFilter((wire) => require_shapeFns.getEdges(wire).length === count)
|
|
306
307
|
}));
|
|
307
308
|
}
|
|
308
309
|
/** Create an immutable wire finder. */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Y as getKernel, p as isFace } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Y as getKernel, p as isFace } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, R as unwrap, T as isOk, b as err, h as bug, o as queryError } from "./errors-C-cgQA3w.js";
|
|
3
|
+
import { c as normalAt, o as getSurfaceType } from "./faceFns-TSH54pPQ.js";
|
|
4
|
+
import { t as DEG2RAD } from "./constants-B9u763C3.js";
|
|
5
|
+
import { a as vecDot, d as vecNormalize } from "./vecOps-D9etjPgV.js";
|
|
6
|
+
import { F as getVertices, I as getWires, M as getEdges, N as getFaces, a as isSameShape, n as getHashCode } from "./shapeFns-DCi9O27X.js";
|
|
7
|
+
import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-CcInoOEA.js";
|
|
8
|
+
import { n as measureArea } from "./measureFns-DHByqdmn.js";
|
|
8
9
|
//#region src/utils/vec2d.ts
|
|
9
10
|
/** Precision for curve intersection and parameter operations. */
|
|
10
11
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Y as getKernel, t as castShape, z as createKernelHandle } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as fuseAll } from "./booleanFns-
|
|
1
|
+
import { Y as getKernel, t as castShape, z as createKernelHandle } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-C-cgQA3w.js";
|
|
3
|
+
import { v as fromBREP } from "./faceFns-TSH54pPQ.js";
|
|
4
|
+
import { d as vecNormalize, s as vecIsZero } from "./vecOps-D9etjPgV.js";
|
|
5
|
+
import { s as toBREP } from "./shapeFns-DCi9O27X.js";
|
|
6
|
+
import { i as fuseAll } from "./booleanFns-CgsaJFBf.js";
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -429,10 +429,10 @@ function modifyStep(history, stepId, newParams, registry) {
|
|
|
429
429
|
/** Serialize a history to a JSON-safe object (shapes converted via toBREP). */
|
|
430
430
|
function serializeHistory(history) {
|
|
431
431
|
const shapes = {};
|
|
432
|
-
for (const [id, shape] of history.shapes)
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
432
|
+
for (const [id, shape] of history.shapes) {
|
|
433
|
+
const brepResult = toBREP(shape);
|
|
434
|
+
if (!brepResult.ok) return err(computationError("SERIALIZE_SHAPE_FAILED", `Failed to serialize shape "${id}": ${brepResult.error.message}`));
|
|
435
|
+
shapes[id] = brepResult.value;
|
|
436
436
|
}
|
|
437
437
|
return ok({
|
|
438
438
|
steps: history.steps,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const require_booleanFns = require("./booleanFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BqWQlrYE.cjs");
|
|
2
|
+
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-cE2WxY6I.cjs");
|
|
4
|
+
const require_vecOps = require("./vecOps-BXvBYIor.cjs");
|
|
5
|
+
const require_shapeFns = require("./shapeFns-aEeSHNqX.cjs");
|
|
6
|
+
const require_booleanFns = require("./booleanFns-B6M6Lm0V.cjs");
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -429,10 +429,10 @@ function modifyStep(history, stepId, newParams, registry) {
|
|
|
429
429
|
/** Serialize a history to a JSON-safe object (shapes converted via toBREP). */
|
|
430
430
|
function serializeHistory(history) {
|
|
431
431
|
const shapes = {};
|
|
432
|
-
for (const [id, shape] of history.shapes)
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
432
|
+
for (const [id, shape] of history.shapes) {
|
|
433
|
+
const brepResult = require_shapeFns.toBREP(shape);
|
|
434
|
+
if (!brepResult.ok) return require_errors.err(require_errors.computationError("SERIALIZE_SHAPE_FAILED", `Failed to serialize shape "${id}": ${brepResult.error.message}`));
|
|
435
|
+
shapes[id] = brepResult.value;
|
|
436
436
|
}
|
|
437
437
|
return require_errors.ok({
|
|
438
438
|
steps: history.steps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
4
|
-
const require_blueprint = require("./blueprint-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BqWQlrYE.cjs");
|
|
2
|
+
const require_errors = require("./errors-9zQcQK1H.cjs");
|
|
3
|
+
const require_arrayAccess = require("./arrayAccess-CmulMesb.cjs");
|
|
4
|
+
const require_blueprint = require("./blueprint-D0XChcek.cjs");
|
|
5
5
|
//#region src/io/objExportFns.ts
|
|
6
6
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
7
7
|
function vec3At(arr, i) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Y as getKernel, t as castShape } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { n as getAtOrThrow } from "./arrayAccess-
|
|
4
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
1
|
+
import { Y as getKernel, t as castShape } from "./shapeTypes-BO1aiDhi.js";
|
|
2
|
+
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-C-cgQA3w.js";
|
|
3
|
+
import { n as getAtOrThrow } from "./arrayAccess-xxcB3YNq.js";
|
|
4
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-B3A5x7P9.js";
|
|
5
5
|
//#region src/io/objExportFns.ts
|
|
6
6
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
7
7
|
function vec3At(arr, i) {
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,8 @@ export { checkBoolean } from './topology/booleanDiagnosticFns.js';
|
|
|
80
80
|
export type { CheckBooleanResult, BooleanIssue, BooleanOpType, BooleanDiagnostics, } from './kernel/types.js';
|
|
81
81
|
export { fuseWithEvolution, cutWithEvolution, intersectWithEvolution, filletWithEvolution, chamferWithEvolution, shellWithEvolution, type EvolutionResult, } from './topology/evolutionFns.js';
|
|
82
82
|
export type { ShapeEvolution } from './kernel/types.js';
|
|
83
|
+
export { captureHint, assignRoles, createRef, updateRoles, resolveRef, defaultScorer, } from './topology/shapeRef/index.js';
|
|
84
|
+
export type { GeometricHint, ShapeRef, RoleTable, ResolvedRef, BrokenRef, FaceScorer, } from './topology/shapeRef/index.js';
|
|
83
85
|
export { surfaceFromGrid, surfaceFromImage, type SurfaceFromGridOptions, type SurfaceFromImageOptions, } from './topology/surfaceFns.js';
|
|
84
86
|
export { hull, type HullOptions } from './topology/hullFns.js';
|
|
85
87
|
export { convexHull } from './operations/convexHullFns.js';
|
|
@@ -117,4 +119,13 @@ export { translate, rotate, mirror, scale, clone, applyMatrix, composeTransforms
|
|
|
117
119
|
export { extrude, revolve, loft, type RevolveOptions, type LoftOptions as CleanLoftOptions, type SweepOptions as CleanSweepOptions, } from './operations/api.js';
|
|
118
120
|
export { drill, pocket, boss, mirrorJoin, rectangularPattern, } from './operations/compoundOpsFns.js';
|
|
119
121
|
export { shape, BrepWrapperError, type Wrapped, type Wrapped3D, type WrappedCurve, type WrappedFace, } from './topology/wrapperFns.js';
|
|
122
|
+
export * as primitives from './ns/primitives.js';
|
|
123
|
+
export * as booleans from './ns/booleans.js';
|
|
124
|
+
export * as modifiers from './ns/modifiers.js';
|
|
125
|
+
export * as transforms from './ns/transforms.js';
|
|
126
|
+
export * as measurement from './ns/measurement.js';
|
|
127
|
+
export * as io from './ns/ioNs.js';
|
|
128
|
+
export * as query from './ns/query.js';
|
|
129
|
+
export * as construction from './ns/construction.js';
|
|
130
|
+
export * as patterns from './ns/patterns.js';
|
|
120
131
|
//# sourceMappingURL=index.d.ts.map
|