brepjs 18.100.2 → 18.101.0

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.
Files changed (87) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{blueprint-CoG7hqAO.js → blueprint-CF12Nceg.js} +7 -7
  4. package/dist/{blueprint-D60m51kI.cjs → blueprint-D5ArjKiA.cjs} +7 -7
  5. package/dist/{blueprintFns-CsR4vknQ.js → blueprintFns-BuPAK4OB.js} +2 -2
  6. package/dist/{blueprintFns-CDdNG1E0.cjs → blueprintFns-CcCfkbyd.cjs} +2 -2
  7. package/dist/{blueprintSketcher-BH026Vs6.js → blueprintSketcher-CEQ8s7TD.js} +3 -3
  8. package/dist/{blueprintSketcher-CNV3BF1m.cjs → blueprintSketcher-DCttG3KS.cjs} +3 -3
  9. package/dist/{boolean2D-BkoT0tyj.js → boolean2D-8rB2sUzj.js} +4 -4
  10. package/dist/{boolean2D-DAy71yz-.cjs → boolean2D-BCqDjg0y.cjs} +4 -4
  11. package/dist/brepjs.cjs +96 -41
  12. package/dist/brepjs.js +96 -41
  13. package/dist/{cameraFns-B62EdiYs.js → cameraFns-Bu6jgTKc.js} +2 -2
  14. package/dist/{cameraFns-B-T9D-ie.cjs → cameraFns-S7YbAxfg.cjs} +2 -2
  15. package/dist/core/kernelBoundary.d.ts +1 -2
  16. package/dist/core.cjs +1 -1
  17. package/dist/core.js +1 -1
  18. package/dist/{cornerFinder-C6GEoGxi.js → cornerFinder-COqoeY--.js} +1 -1
  19. package/dist/{cornerFinder-oRnX2o08.cjs → cornerFinder-Ci2NbbAW.cjs} +1 -1
  20. package/dist/csg/evaluate.d.ts +29 -6
  21. package/dist/{curveFns-CaEoZJFJ.js → curveFns-CG05Jygr.js} +1 -1
  22. package/dist/{curveFns-BIlzT4bO.cjs → curveFns-Dx7_wMut.cjs} +1 -1
  23. package/dist/{drawFns-BoJx2cw1.js → drawFns-CsXPFyDe.js} +12 -12
  24. package/dist/{drawFns-CBSGIxrq.cjs → drawFns-DYkjT_hx.cjs} +12 -12
  25. package/dist/{faceFns-BvtC44tv.cjs → faceFns-DKg2St8b.cjs} +6 -9
  26. package/dist/{faceFns-Cgpg9n36.js → faceFns-mo4ThIHz.js} +6 -9
  27. package/dist/{healingFns-BiChNtRz.js → healingFns-Bb3eEBNm.js} +5 -5
  28. package/dist/{healingFns-DY8866Fl.cjs → healingFns-CM5mVMow.cjs} +5 -5
  29. package/dist/{helpers-DDN_oU6P.cjs → helpers-8zxf2gkc.cjs} +6 -6
  30. package/dist/{helpers-CRB4YhSI.js → helpers-DT44wBAD.js} +6 -6
  31. package/dist/{importFns-v3C1RKi2.cjs → importFns-B6hw9Nhx.cjs} +9 -9
  32. package/dist/{importFns-CcUm7pcu.js → importFns-CEczwPdN.js} +9 -9
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +6 -7
  36. package/dist/kernel/brepkit/kernel2dOps.d.ts +3 -4
  37. package/dist/kernel/geometry2d.d.ts +2 -0
  38. package/dist/kernel/occt/kernel2dOps.d.ts +3 -4
  39. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  40. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  41. package/dist/{loftFns-CFyOO359.cjs → loftFns-DaRDYpfB.cjs} +11 -1
  42. package/dist/{loftFns-D5rQxNOI.js → loftFns-DyNuD9XL.js} +11 -1
  43. package/dist/{measureFns-BrrVzFq0.js → measureFns-Dkh_DmrE.js} +3 -3
  44. package/dist/{measureFns-D2Y2OOuw.cjs → measureFns-Q2dnokUU.cjs} +3 -3
  45. package/dist/measurement.cjs +1 -1
  46. package/dist/measurement.js +1 -1
  47. package/dist/{meshFns-Bkcg1u5D.js → meshFns-CAAarhVm.js} +3 -3
  48. package/dist/{meshFns-BKBGgLB4.cjs → meshFns-DeKdpmu7.cjs} +3 -3
  49. package/dist/{occtWasmAdapter-D7mOxU0Q.js → occtWasmAdapter-BDEPveZs.js} +82 -14
  50. package/dist/{occtWasmAdapter-Bv2OTOX9.cjs → occtWasmAdapter-DDZELjlB.cjs} +93 -13
  51. package/dist/operations/extrudeUtils.d.ts +1 -6
  52. package/dist/operations/sweepFns.d.ts +1 -7
  53. package/dist/operations.cjs +2 -2
  54. package/dist/operations.js +2 -2
  55. package/dist/{primitiveFns-DmF1hhYr.js → primitiveFns-62SO4ti5.js} +4 -4
  56. package/dist/{primitiveFns-DFwdXRvP.cjs → primitiveFns-BAWtMd9H.cjs} +4 -4
  57. package/dist/projection.cjs +1 -1
  58. package/dist/projection.js +1 -1
  59. package/dist/query.cjs +2 -2
  60. package/dist/query.js +2 -2
  61. package/dist/{shapeFns-D-4StVDd.js → shapeFns-DyBbhU30.js} +2 -2
  62. package/dist/{shapeFns-B3GP-0FJ.cjs → shapeFns-L4a8kH_A.cjs} +2 -2
  63. package/dist/shapeRef.cjs +1 -1
  64. package/dist/shapeRef.js +1 -1
  65. package/dist/{shapeRefFns-CtUw9bYy.js → shapeRefFns-Cn4WNb3q.js} +4 -4
  66. package/dist/{shapeRefFns-CdgSGKLD.cjs → shapeRefFns-Dij41NuC.cjs} +4 -4
  67. package/dist/{shapeTypes-DQfoZt_L.cjs → shapeTypes-Bwgm5N6R.cjs} +5 -133
  68. package/dist/{shapeTypes-z5bfGPVI.js → shapeTypes-C4lPfrc2.js} +3 -131
  69. package/dist/sketching.cjs +3 -3
  70. package/dist/sketching.js +3 -3
  71. package/dist/{solidBuilders-Dcl1gZwH.js → solidBuilders-Biwv2cW3.js} +5 -5
  72. package/dist/{solidBuilders-RRBbe3dp.cjs → solidBuilders-CgRmJEdn.cjs} +5 -5
  73. package/dist/{surfaceBuilders-DXMOQVyx.js → surfaceBuilders-Bww4jhBo.js} +10 -10
  74. package/dist/{surfaceBuilders-D_htXKwS.cjs → surfaceBuilders-FLnYYA70.cjs} +10 -10
  75. package/dist/text.cjs +2 -2
  76. package/dist/text.js +2 -2
  77. package/dist/{textBlueprints-A1zJwOLD.cjs → textBlueprints-08NcMO9T.cjs} +7 -7
  78. package/dist/{textBlueprints-Da_l2ncZ.js → textBlueprints-CEzTC9vX.js} +7 -7
  79. package/dist/{textMetrics-DwaQOil0.js → textMetrics-CBbDQ5QW.js} +1 -1
  80. package/dist/{textMetrics-qCUPlyrb.cjs → textMetrics-W-H6jUDj.cjs} +1 -1
  81. package/dist/{threadFns-D2kDxalD.js → threadFns-8rKpQXiR.js} +6 -6
  82. package/dist/{threadFns-BqoKTKCh.cjs → threadFns-DGYdomjN.cjs} +6 -6
  83. package/dist/topology.cjs +8 -8
  84. package/dist/topology.js +8 -8
  85. package/dist/{topologyQueryFns-De27Nxmf.js → topologyQueryFns-Do8E4EXj.js} +1 -1
  86. package/dist/{topologyQueryFns-BLkQkExs.cjs → topologyQueryFns-ygBBXxnP.cjs} +1 -1
  87. package/package.json +2 -2
package/dist/brepjs.js CHANGED
@@ -1,36 +1,36 @@
1
- import { $ as getKernelCapabilities, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getActiveKernelId, Y as _usingCtx, Z as getKernel, _ as isSolid, a as createEdge, at as registerKernel, b as closedWire, c as createSolid, ct as withQuality, d as isCompound, dt as supportsProjection, et as getKernelTier, f as isEdge, ft as BrepkitAdapter, g as isShell, h as isShape3D, ht as currentQuality, i as createCompound, it as prewarm, j as validSolid, k as planarFace, l as createVertex, lt as withTier, m as isShape1D, mt as resetPerformanceStats, n as castShape3D, nt as initFromManifold, o as createFace, ot as registerKernelTier, p as isFace, pt as getPerformanceStats, q as withScopeResult, rt as initFromOC, s as createShell, st as withKernel, t as castShape, tt as init, u as createWire, ut as supportsConstraintSketch, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-z5bfGPVI.js";
2
- import { E as EXACT_BREP_CAPABILITIES, T as DEFAULT_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-D7mOxU0Q.js";
1
+ import { $ as getKernelCapabilities, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getActiveKernelId, Y as _usingCtx, Z as getKernel, _ as isSolid, a as createEdge, at as registerKernel, b as closedWire, c as createSolid, ct as withQuality, d as isCompound, dt as supportsProjection, et as getKernelTier, f as isEdge, ft as BrepkitAdapter, g as isShell, h as isShape3D, ht as currentQuality, i as createCompound, it as prewarm, j as validSolid, k as planarFace, l as createVertex, lt as withTier, m as isShape1D, mt as resetPerformanceStats, n as castShape3D, nt as initFromManifold, o as createFace, ot as registerKernelTier, p as isFace, pt as getPerformanceStats, q as withScopeResult, rt as initFromOC, s as createShell, st as withKernel, t as castShape, tt as init, u as createWire, ut as supportsConstraintSketch, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-C4lPfrc2.js";
2
+ import { D as DEFAULT_CAPABILITIES, O as EXACT_BREP_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-BDEPveZs.js";
3
3
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
4
4
  import { A as ok, B as unwrapOr, C as fromNullable, D as mapBoth, E as map, F as tapErr, H as zip, I as tryCatch, L as tryCatchAsync, M as orElse, N as pipeline, O as mapErr, P as tap, R as unwrap, S as flatten, T as isOk, V as unwrapOrElse, _ as all, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, j as or, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, t as BrepErrorCode, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-DNWJsfVU.js";
5
- import { C as kernelCall, S as vertexPosition, T as kernelCallScoped, _ as iterFaces, a as getCachedSurfaceType, b as iterVertices, c as getFaces, d as getSolids, f as getVertices, g as iterEdges, h as iterCompSolids, m as invalidateShapeCache, n as getBounds, o as getCompSolids, p as getWires, s as getEdges, t as describe$1, u as getShells, v as iterShells, w as kernelCallRaw, x as iterWires, y as iterSolids } from "./topologyQueryFns-De27Nxmf.js";
5
+ import { C as kernelCall, S as vertexPosition, T as kernelCallScoped, _ as iterFaces, a as getCachedSurfaceType, b as iterVertices, c as getFaces, d as getSolids, f as getVertices, g as iterEdges, h as iterCompSolids, m as invalidateShapeCache, n as getBounds, o as getCompSolids, p as getWires, s as getEdges, t as describe$1, u as getShells, v as iterShells, w as kernelCallRaw, x as iterWires, y as iterSolids } from "./topologyQueryFns-Do8E4EXj.js";
6
6
  import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
7
7
  import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-D24Y27N0.js";
8
8
  import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-SKPRvPH-.js";
9
9
  import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-DSjjtrjg.js";
10
- import { S as shapeType, _ as cast, a as faceOrientation, b as isCompSolid, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, p as removeHolesFromFace, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, v as downcast, x as iterTopo, y as fromBREP } from "./faceFns-Cgpg9n36.js";
11
- import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$2, h as translate$2, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$3, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$2, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-D-4StVDd.js";
12
- import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-CaEoZJFJ.js";
13
- import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-Bkcg1u5D.js";
10
+ import { S as shapeType, _ as cast, a as faceOrientation, b as isCompSolid, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, p as removeHolesFromFace, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, v as downcast, x as iterTopo, y as fromBREP } from "./faceFns-mo4ThIHz.js";
11
+ import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$2, h as translate$2, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$3, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$2, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-DyBbhU30.js";
12
+ import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-CG05Jygr.js";
13
+ import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-CAAarhVm.js";
14
14
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
15
- import { _ as makeThreePointArc, d as makeCircle, h as makeLine, l as makeBSplineInterpolation, n as fill, r as makeFace, s as assembleWire } from "./surfaceBuilders-DXMOQVyx.js";
16
- import { _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$2, h as fuseAll$2, m as fuse$2, p as cutAll$2, r as makeCylinder, v as sectionToFace$1, y as slice$1 } from "./solidBuilders-Dcl1gZwH.js";
17
- import { A as edgesOfFace, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, F as chamferDistAngle, I as toBufferGeometryData, L as toGroupedBufferGeometryData, M as sharedEdges, N as verticesOfEdge, O as getNurbsSurfaceData, P as wiresOfFace, R as toLODGeometryData, S as intersectWithEvolution, T as cutAllBisect, _ as positionOnCurve, a as healFace, b as filletWithEvolution, c as isValid$1, d as draft$1, f as fillet$1, g as variableFillet, h as thicken$1, i as heal$1, j as facesOfEdge, k as adjacentFaces, l as solidFromShell, m as shell$1, n as fixSelfIntersection, o as healSolid, p as offset$1, r as fixShape, s as healWire, t as autoHeal, u as chamfer$1, v as chamferWithEvolution, w as checkBoolean, x as fuseWithEvolution, y as cutWithEvolution, z as toLineGeometryData } from "./healingFns-BiChNtRz.js";
18
- import { A as setJointValue, B as findNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as quatRotate, H as updateNode, I as addChild, J as createAssembly, K as linearPattern, L as collectShapes, M as sphericalJoint, N as quatFromAxisAngle, O as prismaticJoint, P as quatFromTo, R as countNodes, S as addJoint, T as jointTransform, U as walkAssembly, V as removeChild, W as circularPattern, _ as exportURDF, a as deserializeHistory, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, p as serializeHistory, q as exportAssemblySTEP, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as createAssemblyNode } from "./threadFns-D2kDxalD.js";
19
- import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-BH026Vs6.js";
20
- import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-CRB4YhSI.js";
21
- import { A as sketchEllipse, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-BoJx2cw1.js";
22
- import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-BrrVzFq0.js";
23
- import { t as cornerFinder } from "./cornerFinder-C6GEoGxi.js";
24
- import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BkoT0tyj.js";
25
- import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, n as createCompoundBlueprint, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-CsR4vknQ.js";
26
- import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-CcUm7pcu.js";
27
- import { a as revolve$1, c as multiSectionSweep, d as twistExtrude, i as extrudeAll, l as supportExtrude, n as loftAll, o as complexExtrude, r as extrude$1, s as guidedSweep, t as loft$1, u as sweep$1 } from "./loftFns-D5rQxNOI.js";
28
- import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, n as getFont, o as compoundSketchExtrude, p as sketchRevolve, r as loadFont, s as compoundSketchFace, t as textBlueprints, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-Da_l2ncZ.js";
29
- import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-B62EdiYs.js";
30
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-DwaQOil0.js";
31
- import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-CtUw9bYy.js";
15
+ import { _ as makeThreePointArc, d as makeCircle, h as makeLine, l as makeBSplineInterpolation, n as fill, r as makeFace, s as assembleWire } from "./surfaceBuilders-Bww4jhBo.js";
16
+ import { _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$2, h as fuseAll$2, m as fuse$2, p as cutAll$2, r as makeCylinder, v as sectionToFace$1, y as slice$1 } from "./solidBuilders-Biwv2cW3.js";
17
+ import { A as edgesOfFace, C as shellWithEvolution, D as getNurbsCurveData, E as fuseAllBisect, F as chamferDistAngle, I as toBufferGeometryData, L as toGroupedBufferGeometryData, M as sharedEdges, N as verticesOfEdge, O as getNurbsSurfaceData, P as wiresOfFace, R as toLODGeometryData, S as intersectWithEvolution, T as cutAllBisect, _ as positionOnCurve, a as healFace, b as filletWithEvolution, c as isValid$1, d as draft$1, f as fillet$1, g as variableFillet, h as thicken$1, i as heal$1, j as facesOfEdge, k as adjacentFaces, l as solidFromShell, m as shell$1, n as fixSelfIntersection, o as healSolid, p as offset$1, r as fixShape, s as healWire, t as autoHeal, u as chamfer$1, v as chamferWithEvolution, w as checkBoolean, x as fuseWithEvolution, y as cutWithEvolution, z as toLineGeometryData } from "./healingFns-Bb3eEBNm.js";
18
+ import { A as setJointValue, B as findNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as quatRotate, H as updateNode, I as addChild, J as createAssembly, K as linearPattern, L as collectShapes, M as sphericalJoint, N as quatFromAxisAngle, O as prismaticJoint, P as quatFromTo, R as countNodes, S as addJoint, T as jointTransform, U as walkAssembly, V as removeChild, W as circularPattern, _ as exportURDF, a as deserializeHistory, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, p as serializeHistory, q as exportAssemblySTEP, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as createAssemblyNode } from "./threadFns-8rKpQXiR.js";
19
+ import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-CEQ8s7TD.js";
20
+ import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-DT44wBAD.js";
21
+ import { A as sketchEllipse, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-CsXPFyDe.js";
22
+ import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-Dkh_DmrE.js";
23
+ import { t as cornerFinder } from "./cornerFinder-COqoeY--.js";
24
+ import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-8rB2sUzj.js";
25
+ import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, n as createCompoundBlueprint, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-BuPAK4OB.js";
26
+ import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-CEczwPdN.js";
27
+ import { a as revolve$1, c as multiSectionSweep, d as twistExtrude, i as extrudeAll, l as supportExtrude, n as loftAll, o as complexExtrude, r as extrude$1, s as guidedSweep, t as loft$1, u as sweep$1 } from "./loftFns-DyNuD9XL.js";
28
+ import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, n as getFont, o as compoundSketchExtrude, p as sketchRevolve, r as loadFont, s as compoundSketchFace, t as textBlueprints, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-CEzTC9vX.js";
29
+ import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-Bu6jgTKc.js";
30
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CBbDQ5QW.js";
31
+ import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-Cn4WNb3q.js";
32
32
  import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-CFetYgIm.js";
33
- import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere$1, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus$1, x as subFace, y as solid } from "./primitiveFns-DmF1hhYr.js";
33
+ import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere$1, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus$1, x as subFace, y as solid } from "./primitiveFns-62SO4ti5.js";
34
34
  //#region \0rolldown/runtime.js
35
35
  var __defProp = Object.defineProperty;
36
36
  var __exportAll = (all, no_symbols) => {
@@ -2910,8 +2910,8 @@ function sewMeshToSolid(triangles, errorCode, tolerance = 1e-6) {
2910
2910
  } catch {
2911
2911
  try {
2912
2912
  return ok(castShape(kernel.sew(triFaces, tolerance)));
2913
- } catch {
2914
- return err(ioError(errorCode, "Failed to sew triangular faces"));
2913
+ } catch (e) {
2914
+ return err(ioError(errorCode, "Failed to sew triangular faces", e));
2915
2915
  }
2916
2916
  }
2917
2917
  }
@@ -5648,34 +5648,61 @@ function cacheKey(node, env, kernelId, tolerance) {
5648
5648
  return `${toHex(node.structuralHash)}:${kernelId}:${toHex(projHash)}:${tolHash}`;
5649
5649
  }
5650
5650
  var Evaluator = class {
5651
- scope = new DisposalScope();
5652
5651
  cache = /* @__PURE__ */ new Map();
5653
- registered = /* @__PURE__ */ new WeakSet();
5652
+ refCounts = /* @__PURE__ */ new Map();
5653
+ evaluating = false;
5654
+ pendingKeys = [];
5654
5655
  kernelId;
5655
5656
  defaultTolerance;
5657
+ maxCacheEntries;
5656
5658
  onStep;
5657
5659
  hits = 0;
5658
5660
  misses = 0;
5661
+ evictions = 0;
5659
5662
  constructor(options = {}) {
5660
5663
  this.kernelId = options.kernel ?? getActiveKernelId() ?? "unregistered";
5661
5664
  this.defaultTolerance = options.tolerance;
5662
5665
  if (options.onStep) this.onStep = options.onStep;
5666
+ const max = options.maxCacheEntries;
5667
+ if (max !== void 0 && (!Number.isInteger(max) || max < 1)) throw new RangeError(`Evaluator: maxCacheEntries must be a positive integer, got ${String(max)}`);
5668
+ this.maxCacheEntries = max;
5663
5669
  }
5664
5670
  /**
5665
5671
  * Materialize a CSG IR tree against the given parameter environment.
5666
- * The returned shape is borrowed — valid for as long as this Evaluator is
5667
- * not disposed. Callers must NOT call `.delete()` / `[Symbol.dispose]()`
5668
- * on the returned shape; that would invalidate the cache entry for every
5669
- * future call returning the same handle.
5672
+ * The returned shape is borrowed — callers must NOT call `.delete()` /
5673
+ * `[Symbol.dispose]()` on it; that would invalidate the cache entry for
5674
+ * every future call returning the same handle. By default it stays valid
5675
+ * until the Evaluator is disposed; if `maxCacheEntries` is set, only until
5676
+ * the next successful evaluate() call (LRU eviction may free older entries),
5677
+ * and evaluate() is then non-reentrant — calling it from an onStep callback
5678
+ * throws.
5670
5679
  */
5671
5680
  evaluate(node, env = {}) {
5672
- return withKernel(this.kernelId, () => this.evaluateInner(node, env));
5681
+ if (this.maxCacheEntries !== void 0 && this.evaluating) throw new Error("Evaluator.evaluate() is not reentrant when maxCacheEntries is set — do not call it from an onStep callback.");
5682
+ return withKernel(this.kernelId, () => {
5683
+ this.evaluating = true;
5684
+ let committed = false;
5685
+ try {
5686
+ const result = this.evaluateInner(node, env);
5687
+ if (this.maxCacheEntries !== void 0 && result.ok) this.trimCache(this.maxCacheEntries);
5688
+ committed = result.ok;
5689
+ return result;
5690
+ } finally {
5691
+ if (!committed && this.maxCacheEntries !== void 0) this.rollbackPending();
5692
+ this.pendingKeys.length = 0;
5693
+ this.evaluating = false;
5694
+ }
5695
+ });
5673
5696
  }
5674
5697
  evaluateInner(node, env) {
5675
5698
  const key = cacheKey(node, env, this.kernelId, this.defaultTolerance);
5676
5699
  const cached = this.cache.get(key);
5677
5700
  if (cached !== void 0) {
5678
5701
  this.hits++;
5702
+ if (this.maxCacheEntries !== void 0) {
5703
+ this.cache.delete(key);
5704
+ this.cache.set(key, cached);
5705
+ }
5679
5706
  this.onStep?.({
5680
5707
  node,
5681
5708
  cacheKey: key,
@@ -5690,11 +5717,10 @@ var Evaluator = class {
5690
5717
  evalNode: (child) => this.evaluateInner(child, env)
5691
5718
  });
5692
5719
  if (!result.ok) return result;
5693
- if (!this.registered.has(result.value)) {
5694
- this.scope.register(result.value);
5695
- this.registered.add(result.value);
5696
- }
5697
- this.cache.set(key, result.value);
5720
+ const shape = result.value;
5721
+ this.refCounts.set(shape, (this.refCounts.get(shape) ?? 0) + 1);
5722
+ this.cache.set(key, shape);
5723
+ if (this.maxCacheEntries !== void 0) this.pendingKeys.push(key);
5698
5724
  this.onStep?.({
5699
5725
  node,
5700
5726
  cacheKey: key,
@@ -5702,19 +5728,48 @@ var Evaluator = class {
5702
5728
  });
5703
5729
  return result;
5704
5730
  }
5731
+ releaseShape(shape) {
5732
+ const next = (this.refCounts.get(shape) ?? 1) - 1;
5733
+ if (next <= 0) {
5734
+ this.refCounts.delete(shape);
5735
+ shape[Symbol.dispose]();
5736
+ } else this.refCounts.set(shape, next);
5737
+ }
5738
+ trimCache(max) {
5739
+ while (this.cache.size > max) {
5740
+ const oldest = this.cache.keys().next();
5741
+ if (oldest.done) break;
5742
+ const key = oldest.value;
5743
+ const shape = this.cache.get(key);
5744
+ this.cache.delete(key);
5745
+ this.evictions++;
5746
+ if (shape !== void 0) this.releaseShape(shape);
5747
+ }
5748
+ }
5749
+ rollbackPending() {
5750
+ for (const key of this.pendingKeys) {
5751
+ const shape = this.cache.get(key);
5752
+ if (shape === void 0) continue;
5753
+ this.cache.delete(key);
5754
+ this.releaseShape(shape);
5755
+ }
5756
+ }
5705
5757
  cacheStats() {
5706
5758
  return {
5707
5759
  hits: this.hits,
5708
5760
  misses: this.misses,
5709
- entries: this.cache.size
5761
+ entries: this.cache.size,
5762
+ evictions: this.evictions
5710
5763
  };
5711
5764
  }
5712
5765
  resetStats() {
5713
5766
  this.hits = 0;
5714
5767
  this.misses = 0;
5768
+ this.evictions = 0;
5715
5769
  }
5716
5770
  [Symbol.dispose]() {
5717
- this.scope[Symbol.dispose]();
5771
+ for (const shape of this.refCounts.keys()) shape[Symbol.dispose]();
5772
+ this.refCounts.clear();
5718
5773
  this.cache.clear();
5719
5774
  }
5720
5775
  };
@@ -1,6 +1,6 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, b as err, d as validationError } from "./errors-DNWJsfVU.js";
3
- import { s as getEdges } from "./topologyQueryFns-De27Nxmf.js";
3
+ import { s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
4
4
  import { c as vecLength, d as vecNormalize, g as vecSub, r as vecCross } from "./vecOps-SKPRvPH-.js";
5
5
  //#region src/projection/projectionPlanes.ts
6
6
  /** Lookup table mapping each {@link ProjectionPlane} to its camera configuration. */
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
4
4
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
5
5
  //#region src/projection/projectionPlanes.ts
6
6
  /** Lookup table mapping each {@link ProjectionPlane} to its camera configuration. */
@@ -1,5 +1,5 @@
1
1
  import { Vec3 } from './types.js';
2
- type KernelType = any;
2
+ import { KernelType } from '../kernel/types.js';
3
3
  /** Convert Vec3 to a kernel 3D vector. Caller must call .delete() when done. */
4
4
  export declare function toKernelVec(v: Vec3): KernelType;
5
5
  /** Convert Vec3 to a kernel 3D point. Caller must call .delete() when done. */
@@ -33,4 +33,3 @@ export declare function makeKernelAx2(origin: Vec3, zDir: Vec3, xDir?: Vec3): Ke
33
33
  * @testOnly Exercised by tests/occtBoundary.test.ts.
34
34
  */
35
35
  export declare function makeKernelAx3(origin: Vec3, zDir: Vec3, xDir?: Vec3): KernelType;
36
- export {};
package/dist/core.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_types = require("./types-KjA8tY4Y.cjs");
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-z5bfGPVI.js";
1
+ import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, B as unwrapOr, E as map, I as tryCatch, L as tryCatchAsync, O as mapErr, R as unwrap, T as isOk, V as unwrapOrElse, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-DNWJsfVU.js";
3
3
  import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
4
4
  import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-D24Y27N0.js";
@@ -1,6 +1,6 @@
1
1
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
2
2
  import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
3
- import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-CRB4YhSI.js";
3
+ import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-DT44wBAD.js";
4
4
  //#region src/query/cornerFinder.ts
5
5
  var PI_2 = 2 * Math.PI;
6
6
  function positiveHalfAngle(angle) {
@@ -1,6 +1,6 @@
1
1
  const require_constants = require("./constants-BOVyEYGH.cjs");
2
2
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
3
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
3
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
4
4
  //#region src/query/cornerFinder.ts
5
5
  var PI_2 = 2 * Math.PI;
6
6
  function positiveHalfAngle(angle) {
@@ -9,6 +9,18 @@ export interface EvaluatorOptions {
9
9
  readonly tolerance?: number | undefined;
10
10
  /** Optional callback fired after every node visit, including cache hits (`info.cacheHit` discriminates). */
11
11
  readonly onStep?: ((info: StepInfo) => void) | undefined;
12
+ /**
13
+ * Upper bound on the number of materialized entries kept in the content
14
+ * cache. When the cache exceeds this after a top-level evaluate(), the
15
+ * least-recently-used entries are evicted and their kernel handles disposed
16
+ * (a handle shared by several entries is freed only when its last entry is
17
+ * evicted). Defaults to unbounded — entries live for the Evaluator's
18
+ * lifetime. With a bound set, a returned shape is only guaranteed valid
19
+ * until the next successful evaluate() call; a failed or thrown evaluate() is
20
+ * transactional (the cache is left unchanged), and evaluate() is non-reentrant
21
+ * (calling it from an onStep callback throws). Must be a positive integer.
22
+ */
23
+ readonly maxCacheEntries?: number | undefined;
12
24
  }
13
25
  export interface StepInfo {
14
26
  readonly node: IRNode;
@@ -19,26 +31,37 @@ export interface CacheStats {
19
31
  readonly hits: number;
20
32
  readonly misses: number;
21
33
  readonly entries: number;
34
+ /** Number of entries evicted by the LRU bound over this Evaluator's life. */
35
+ readonly evictions: number;
22
36
  }
23
37
  export declare class Evaluator implements Disposable {
24
- private readonly scope;
25
38
  private readonly cache;
26
- private readonly registered;
39
+ private readonly refCounts;
40
+ private evaluating;
41
+ private readonly pendingKeys;
27
42
  private readonly kernelId;
28
43
  private readonly defaultTolerance;
44
+ private readonly maxCacheEntries;
29
45
  private readonly onStep?;
30
46
  private hits;
31
47
  private misses;
48
+ private evictions;
32
49
  constructor(options?: EvaluatorOptions);
33
50
  /**
34
51
  * Materialize a CSG IR tree against the given parameter environment.
35
- * The returned shape is borrowed — valid for as long as this Evaluator is
36
- * not disposed. Callers must NOT call `.delete()` / `[Symbol.dispose]()`
37
- * on the returned shape; that would invalidate the cache entry for every
38
- * future call returning the same handle.
52
+ * The returned shape is borrowed — callers must NOT call `.delete()` /
53
+ * `[Symbol.dispose]()` on it; that would invalidate the cache entry for
54
+ * every future call returning the same handle. By default it stays valid
55
+ * until the Evaluator is disposed; if `maxCacheEntries` is set, only until
56
+ * the next successful evaluate() call (LRU eviction may free older entries),
57
+ * and evaluate() is then non-reentrant — calling it from an onStep callback
58
+ * throws.
39
59
  */
40
60
  evaluate(node: IRNode, env?: Env): Result<AnyShape<Dimension>>;
41
61
  private evaluateInner;
62
+ private releaseShape;
63
+ private trimCache;
64
+ private rollbackPending;
42
65
  cacheStats(): CacheStats;
43
66
  resetStats(): void;
44
67
  [Symbol.dispose](): void;
@@ -1,4 +1,4 @@
1
- import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
3
3
  //#region src/topology/curveFns.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  //#region src/topology/curveFns.ts
4
4
  /**
@@ -1,22 +1,22 @@
1
- import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-z5bfGPVI.js";
1
+ import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
4
- import { s as getEdges } from "./topologyQueryFns-De27Nxmf.js";
4
+ import { s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
5
5
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
6
6
  import { r as toVec3 } from "./types-D24Y27N0.js";
7
7
  import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-SKPRvPH-.js";
8
8
  import { a as planeToWorld, o as resolvePlane } from "./planeOps-DSjjtrjg.js";
9
- import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as downcast } from "./faceFns-Cgpg9n36.js";
10
- import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-CaEoZJFJ.js";
9
+ import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as downcast } from "./faceFns-mo4ThIHz.js";
10
+ import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-CG05Jygr.js";
11
11
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
12
- import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-DXMOQVyx.js";
13
- import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-BH026Vs6.js";
14
- import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-CRB4YhSI.js";
15
- 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-CoG7hqAO.js";
16
- import { t as cornerFinder } from "./cornerFinder-C6GEoGxi.js";
17
- import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-BkoT0tyj.js";
18
- import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-Da_l2ncZ.js";
19
- import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-B62EdiYs.js";
12
+ import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-Bww4jhBo.js";
13
+ import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-CEQ8s7TD.js";
14
+ import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-DT44wBAD.js";
15
+ 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-CF12Nceg.js";
16
+ import { t as cornerFinder } from "./cornerFinder-COqoeY--.js";
17
+ import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-8rB2sUzj.js";
18
+ import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-CEzTC9vX.js";
19
+ import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-Bu6jgTKc.js";
20
20
  //#region src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -1,22 +1,22 @@
1
- const require_textBlueprints = require("./textBlueprints-A1zJwOLD.cjs");
2
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-08NcMO9T.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
3
3
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
4
4
  const require_errors = require("./errors-CXJtc4I7.cjs");
5
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
5
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
6
6
  const require_constants = require("./constants-BOVyEYGH.cjs");
7
7
  const require_types = require("./types-KjA8tY4Y.cjs");
8
8
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
9
9
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
10
- const require_faceFns = require("./faceFns-BvtC44tv.cjs");
11
- const require_curveFns = require("./curveFns-BIlzT4bO.cjs");
10
+ const require_faceFns = require("./faceFns-DKg2St8b.cjs");
11
+ const require_curveFns = require("./curveFns-Dx7_wMut.cjs");
12
12
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
13
- const require_surfaceBuilders = require("./surfaceBuilders-D_htXKwS.cjs");
14
- const require_blueprintSketcher = require("./blueprintSketcher-CNV3BF1m.cjs");
15
- const require_helpers = require("./helpers-DDN_oU6P.cjs");
16
- const require_blueprint = require("./blueprint-D60m51kI.cjs");
17
- const require_cornerFinder = require("./cornerFinder-oRnX2o08.cjs");
18
- const require_boolean2D = require("./boolean2D-DAy71yz-.cjs");
19
- const require_cameraFns = require("./cameraFns-B-T9D-ie.cjs");
13
+ const require_surfaceBuilders = require("./surfaceBuilders-FLnYYA70.cjs");
14
+ const require_blueprintSketcher = require("./blueprintSketcher-DCttG3KS.cjs");
15
+ const require_helpers = require("./helpers-8zxf2gkc.cjs");
16
+ const require_blueprint = require("./blueprint-D5ArjKiA.cjs");
17
+ const require_cornerFinder = require("./cornerFinder-Ci2NbbAW.cjs");
18
+ const require_boolean2D = require("./boolean2D-BCqDjg0y.cjs");
19
+ const require_cameraFns = require("./cameraFns-S7YbAxfg.cjs");
20
20
  //#region src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
4
4
  const require_types = require("./types-KjA8tY4Y.cjs");
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -35,11 +35,8 @@ var TOPO_TO_SHAPE_TYPE = {
35
35
  shape: "compound"
36
36
  };
37
37
  var iterTopo = function* iterTopo(shape, topo) {
38
- const shapeType = TOPO_TO_SHAPE_TYPE[topo];
39
- if (shapeType) {
40
- const shapes = require_shapeTypes.getKernel().iterShapes(shape, shapeType);
41
- for (const s of shapes) yield s;
42
- }
38
+ const shapes = require_shapeTypes.getKernel().iterShapes(shape, TOPO_TO_SHAPE_TYPE[topo]);
39
+ for (const s of shapes) yield s;
43
40
  };
44
41
  /** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
45
42
  var shapeType = (shape) => {
@@ -56,8 +53,8 @@ function downcast(shape) {
56
53
  if (require_shapeTypes.getKernel().isNull(shape)) return require_errors.err(require_errors.typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
57
54
  try {
58
55
  return require_errors.ok(require_shapeTypes.getKernel().downcast(shape));
59
- } catch {
60
- return require_errors.err(require_errors.typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
56
+ } catch (e) {
57
+ return require_errors.err(require_errors.typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type", e));
61
58
  }
62
59
  }
63
60
  /**
@@ -1,6 +1,6 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-De27Nxmf.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-Do8E4EXj.js";
4
4
  import { r as toVec3 } from "./types-D24Y27N0.js";
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -35,11 +35,8 @@ var TOPO_TO_SHAPE_TYPE = {
35
35
  shape: "compound"
36
36
  };
37
37
  var iterTopo = function* iterTopo(shape, topo) {
38
- const shapeType = TOPO_TO_SHAPE_TYPE[topo];
39
- if (shapeType) {
40
- const shapes = getKernel().iterShapes(shape, shapeType);
41
- for (const s of shapes) yield s;
42
- }
38
+ const shapes = getKernel().iterShapes(shape, TOPO_TO_SHAPE_TYPE[topo]);
39
+ for (const s of shapes) yield s;
43
40
  };
44
41
  /** Get the TopAbs_ShapeEnum type of an kernel shape, returning Err for null shapes. */
45
42
  var shapeType = (shape) => {
@@ -56,8 +53,8 @@ function downcast(shape) {
56
53
  if (getKernel().isNull(shape)) return err(typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
57
54
  try {
58
55
  return ok(getKernel().downcast(shape));
59
- } catch {
60
- return err(typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
56
+ } catch (e) {
57
+ return err(typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type", e));
61
58
  }
62
59
  }
63
60
  /**
@@ -1,11 +1,11 @@
1
- import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Z as getKernel, _ as isSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, y as isWire } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
3
- import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-De27Nxmf.js";
3
+ import { c as getFaces, i as getCachedIsValid, l as getOrCreateCache, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
- import { v as downcast } from "./faceFns-Cgpg9n36.js";
6
- import { _ as propagateAllMetadata, g as collectInputFaceHashes } from "./shapeFns-D-4StVDd.js";
5
+ import { v as downcast } from "./faceFns-mo4ThIHz.js";
6
+ import { _ as propagateAllMetadata, g as collectInputFaceHashes } from "./shapeFns-DyBbhU30.js";
7
7
  import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
8
- import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-Dcl1gZwH.js";
8
+ import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-Biwv2cW3.js";
9
9
  //#region src/topology/threeHelpers.ts
10
10
  /**
11
11
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -1,11 +1,11 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
- const require_faceFns = require("./faceFns-BvtC44tv.cjs");
6
- const require_shapeFns = require("./shapeFns-B3GP-0FJ.cjs");
5
+ const require_faceFns = require("./faceFns-DKg2St8b.cjs");
6
+ const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
7
7
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
8
- const require_solidBuilders = require("./solidBuilders-RRBbe3dp.cjs");
8
+ const require_solidBuilders = require("./solidBuilders-CgRmJEdn.cjs");
9
9
  //#region src/topology/threeHelpers.ts
10
10
  /**
11
11
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-DQfoZt_L.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Bwgm5N6R.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BLkQkExs.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-ygBBXxnP.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
6
- const require_faceFns = require("./faceFns-BvtC44tv.cjs");
7
- const require_shapeFns = require("./shapeFns-B3GP-0FJ.cjs");
8
- const require_curveFns = require("./curveFns-BIlzT4bO.cjs");
9
- const require_measureFns = require("./measureFns-D2Y2OOuw.cjs");
6
+ const require_faceFns = require("./faceFns-DKg2St8b.cjs");
7
+ const require_shapeFns = require("./shapeFns-L4a8kH_A.cjs");
8
+ const require_curveFns = require("./curveFns-Dx7_wMut.cjs");
9
+ const require_measureFns = require("./measureFns-Q2dnokUU.cjs");
10
10
  //#region src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,12 +1,12 @@
1
- import { Z as getKernel, p as isFace } from "./shapeTypes-z5bfGPVI.js";
1
+ import { Z as getKernel, p as isFace } from "./shapeTypes-C4lPfrc2.js";
2
2
  import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-DNWJsfVU.js";
3
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-De27Nxmf.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Do8E4EXj.js";
4
4
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
6
- import { l as normalAt, s as getSurfaceType } from "./faceFns-Cgpg9n36.js";
7
- import { a as isSameShape, n as getHashCode } from "./shapeFns-D-4StVDd.js";
8
- import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CaEoZJFJ.js";
9
- import { n as measureArea } from "./measureFns-BrrVzFq0.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-mo4ThIHz.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-DyBbhU30.js";
8
+ import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CG05Jygr.js";
9
+ import { n as measureArea } from "./measureFns-Dkh_DmrE.js";
10
10
  //#region src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;