brepjs 20.12.4 → 20.12.6

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 (102) hide show
  1. package/dist/2d/lib/offset.d.ts +1 -1
  2. package/dist/2d.cjs +6 -6
  3. package/dist/2d.js +6 -6
  4. package/dist/{adjacencyFns-54UTqtan.js → adjacencyFns--KmBIKYJ.js} +3 -3
  5. package/dist/{adjacencyFns-C_Vb1AeW.cjs → adjacencyFns-BFJfaUwX.cjs} +3 -3
  6. package/dist/{blueprint-DFpjcrlm.js → blueprint-BhIk9Pvm.js} +7 -8
  7. package/dist/{blueprint-D0VEeTzJ.cjs → blueprint-D83DDDPb.cjs} +7 -8
  8. package/dist/{blueprintFns-Douf5ZdX.cjs → blueprintFns-C4TQn-x_.cjs} +2 -2
  9. package/dist/{blueprintFns-Dye1jezD.js → blueprintFns-eULVgkq9.js} +2 -2
  10. package/dist/{blueprintSketcher-Cr0Lr1Dq.js → blueprintSketcher-D_Faf0GO.js} +32 -14
  11. package/dist/{blueprintSketcher-W9yON-UC.cjs → blueprintSketcher-Di376t-0.cjs} +32 -14
  12. package/dist/{boolean2D-C9VghXHG.cjs → boolean2D-CNZFI_y8.cjs} +4 -4
  13. package/dist/{boolean2D-CCV3R6lN.js → boolean2D-DqpCF72W.js} +4 -4
  14. package/dist/brepjs.cjs +128 -100
  15. package/dist/brepjs.js +128 -100
  16. package/dist/{cameraFns-DZOI_ewG.js → cameraFns-CrClIkmV.js} +3 -3
  17. package/dist/{cameraFns-x3L6dtA8.cjs → cameraFns-RqraCXIc.cjs} +3 -3
  18. package/dist/core.cjs +2 -2
  19. package/dist/core.js +2 -2
  20. package/dist/{cornerFinder-BY10jciz.js → cornerFinder-BZuQkRp2.js} +1 -1
  21. package/dist/{cornerFinder-B8PqO4um.cjs → cornerFinder-CdOe1Wrb.cjs} +1 -1
  22. package/dist/{curveFns-B4308HNM.js → curveFns-BP3srCfK.js} +1 -1
  23. package/dist/{curveFns-8lUhNquZ.cjs → curveFns-CyIvQNYT.cjs} +1 -1
  24. package/dist/{drawFns-C7zAvera.cjs → drawFns-71cOhWD-.cjs} +29 -16
  25. package/dist/{drawFns-DjnU3fEd.js → drawFns-DxDwJ5zZ.js} +29 -16
  26. package/dist/{faceFns-BjmlYcc9.cjs → faceFns-B7MiDYj1.cjs} +2 -2
  27. package/dist/{faceFns-7eHqNM0P.js → faceFns-iVPbTxki.js} +2 -2
  28. package/dist/{healingFns-BW7mZ_SW.js → healingFns-BhP8zfp1.js} +5 -5
  29. package/dist/{healingFns-CYLIcIWv.cjs → healingFns-DWljGTNR.cjs} +5 -5
  30. package/dist/{helpers-BQ6XMFcm.js → helpers-D2hANLRu.js} +14 -10
  31. package/dist/{helpers-De0Z_6iV.cjs → helpers-DKEVm6Hu.cjs} +14 -10
  32. package/dist/{importFns-BCL4-H8e.js → importFns-DUzIkns7.js} +2 -2
  33. package/dist/{importFns-3IMBHQrQ.cjs → importFns-KEPAgbjj.cjs} +2 -2
  34. package/dist/index.d.ts +2 -2
  35. package/dist/io.cjs +2 -2
  36. package/dist/io.js +2 -2
  37. package/dist/kernel/bspline2dFit.d.ts +42 -0
  38. package/dist/kernel/geometry2d.d.ts +45 -0
  39. package/dist/kernel/occt/kernel2dOps.d.ts +1 -1
  40. package/dist/kernel/occtWasm/constructionOps.d.ts +1 -1
  41. package/dist/kernel/occtWasm/kernel2dOps.d.ts +7 -4
  42. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  43. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +3 -3
  44. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  45. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +7 -0
  46. package/dist/{loftFns-DlG5oR0X.cjs → loftFns-D5AvfCGG.cjs} +17 -2
  47. package/dist/{loftFns-H4ZOpRAk.js → loftFns-D5NJpHLZ.js} +17 -2
  48. package/dist/{measureFns-Ce01LVwq.cjs → measureFns-CZHNWkiA.cjs} +102 -35
  49. package/dist/{measureFns-1IfNe629.js → measureFns-mxBdPiWa.js} +102 -35
  50. package/dist/measurement/measureFns.d.ts +3 -2
  51. package/dist/measurement.cjs +2 -2
  52. package/dist/measurement.js +2 -2
  53. package/dist/{meshFns-nEvfwNRF.cjs → meshFns-Czlt-GBJ.cjs} +3 -3
  54. package/dist/{meshFns-DaRZxa7B.js → meshFns-DmjMzNbH.js} +3 -3
  55. package/dist/{occtWasmAdapter-ipKUdNLN.js → occtWasmAdapter-B9d0Q0Vl.js} +1160 -261
  56. package/dist/{occtWasmAdapter-CRd9RFEu.cjs → occtWasmAdapter-DVxLkjlJ.cjs} +1171 -260
  57. package/dist/operations/patternFns.d.ts +6 -1
  58. package/dist/operations.cjs +2 -2
  59. package/dist/operations.js +2 -2
  60. package/dist/{originTrackingFns-zrksCJTa.js → originTrackingFns-CBnyKLm7.js} +2 -2
  61. package/dist/{originTrackingFns-9gyCMFFQ.cjs → originTrackingFns-CHymOLLm.cjs} +2 -2
  62. package/dist/{primitiveFns-BRXZ7jnP.cjs → primitiveFns-BVeBEaa4.cjs} +7 -14
  63. package/dist/{primitiveFns-ClQP6zMQ.js → primitiveFns-DeNl60Rw.js} +7 -14
  64. package/dist/{principalBoxFns-DsfWOoXg.js → principalBoxFns-3mW_hA6z.js} +3 -3
  65. package/dist/{principalBoxFns-tIv-crMB.cjs → principalBoxFns-CG6kG7vT.cjs} +3 -3
  66. package/dist/projection.cjs +1 -1
  67. package/dist/projection.js +1 -1
  68. package/dist/query/finderCore.d.ts +7 -7
  69. package/dist/query.cjs +2 -2
  70. package/dist/query.js +2 -2
  71. package/dist/{refResolveFns-BZdUlv9f.cjs → refResolveFns-BAs4p9z7.cjs} +6 -6
  72. package/dist/{refResolveFns-BG3JGs--.js → refResolveFns-DHx1Y3GG.js} +6 -6
  73. package/dist/{shapeFns-BbXqiNqY.cjs → shapeFns-C0w8vvfb.cjs} +2 -2
  74. package/dist/{shapeFns-BCgegapL.js → shapeFns-CgqKICF_.js} +2 -2
  75. package/dist/shapeRef.cjs +1 -1
  76. package/dist/shapeRef.js +1 -1
  77. package/dist/{shapeTypes-DJT3SnGK.cjs → shapeTypes-Dc7j-MYg.cjs} +10 -16
  78. package/dist/{shapeTypes-DAz6aAnJ.js → shapeTypes-DwvQUp9M.js} +10 -16
  79. package/dist/sketching/sketches.d.ts +2 -0
  80. package/dist/sketching.cjs +3 -3
  81. package/dist/sketching.js +3 -3
  82. package/dist/{solidBuilders-8xytLt8-.js → solidBuilders-DT1gpVWM.js} +5 -5
  83. package/dist/{solidBuilders-BWbqhbyv.cjs → solidBuilders-iS5DDwg8.cjs} +5 -5
  84. package/dist/{surfaceBuilders-CwG_RPdZ.cjs → surfaceBuilders-BvwSgD3C.cjs} +3 -3
  85. package/dist/{surfaceBuilders-BO96DMCH.js → surfaceBuilders-CPLe0bbk.js} +3 -3
  86. package/dist/text.cjs +2 -2
  87. package/dist/text.js +2 -2
  88. package/dist/{textBlueprints-Dhe8_Uvc.js → textBlueprints-BU0Rhk54.js} +19 -11
  89. package/dist/{textBlueprints-DHfYmLtP.cjs → textBlueprints-CNPCPJix.cjs} +19 -11
  90. package/dist/{textMetrics-CwYDH9js.cjs → textMetrics-C71g4TmO.cjs} +1 -1
  91. package/dist/{textMetrics-Bbf-Dllw.js → textMetrics-Df9aLYK2.js} +1 -1
  92. package/dist/{threadFns-B23RqugN.cjs → threadFns-CzXEnnmo.cjs} +37 -29
  93. package/dist/{threadFns-Cn7_bmux.js → threadFns-DESH7lcs.js} +36 -28
  94. package/dist/topology/apiTypes.d.ts +13 -7
  95. package/dist/topology.cjs +9 -9
  96. package/dist/topology.d.ts +1 -1
  97. package/dist/topology.js +9 -9
  98. package/dist/{topologyQueryFns-xh11vEQw.cjs → topologyQueryFns-5Frx8Y-0.cjs} +1 -1
  99. package/dist/{topologyQueryFns-BfYdGOJc.js → topologyQueryFns-LXV1nTaS.js} +1 -1
  100. package/dist/{validityTypes-CXkecqMw.cjs → validityTypes-C6rROGTP.cjs} +1 -1
  101. package/dist/{validityTypes-BfOuvfyp.js → validityTypes-DM-Iwe8N.js} +1 -1
  102. package/package.json +2 -1
package/dist/brepjs.js CHANGED
@@ -1,40 +1,40 @@
1
- import { $ as initFromOC, A as as3D, C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, G as _usingCtx, H as withScope, I as getDisposalStats, J as getKernel2D, K as getActiveKernelId, L as isLive, M as is3D, N as DisposalScope, P as createHandle, Q as initFromManifold, S as isShell, T as isWire, U as withScopeResult, V as withArenaCheckpoint, W as withScopeResultAsync, X as getKernelTier, Y as getKernelCapabilities, Z as init, _ as isCompound, a as castShape3D, at as withTier, b as isShape1D, c as createEdge, ct as resetPerformanceStats, d as createSolid, et as prewarm, f as createVertex, h as disposeResultShape, i as castShape, it as withQuality, j as is2D, k as as2D, l as createFace, lt as currentQuality, n as castResultShape, nt as registerKernelTier, ot as BrepkitAdapter, p as createWire, q as getKernel, rt as withKernel, s as createCompound, st as getPerformanceStats, tt as registerKernel, u as createShell, ut as qualityDeflection, v as isEdge, w as isVertex, x as isShape3D, y as isFace, z as resetDisposalStats } from "./shapeTypes-DAz6aAnJ.js";
2
- import { A as DEFAULT_CAPABILITIES, j as EXACT_BREP_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-ipKUdNLN.js";
1
+ import { $ as initFromOC, A as as3D, C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, G as _usingCtx, H as withScope, I as getDisposalStats, J as getKernel2D, K as getActiveKernelId, L as isLive, M as is3D, N as DisposalScope, P as createHandle, Q as initFromManifold, S as isShell, T as isWire, U as withScopeResult, V as withArenaCheckpoint, W as withScopeResultAsync, X as getKernelTier, Y as getKernelCapabilities, Z as init, _ as isCompound, a as castShape3D, at as withTier, b as isShape1D, c as createEdge, ct as resetPerformanceStats, d as createSolid, et as prewarm, f as createVertex, h as disposeResultShape, i as castShape, it as withQuality, j as is2D, k as as2D, l as createFace, lt as currentQuality, n as castResultShape, nt as registerKernelTier, ot as BrepkitAdapter, p as createWire, q as getKernel, rt as withKernel, s as createCompound, st as getPerformanceStats, tt as registerKernel, u as createShell, ut as qualityDeflection, v as isEdge, w as isVertex, x as isShape3D, y as isFace, z as resetDisposalStats } from "./shapeTypes-DwvQUp9M.js";
2
+ import { M as DEFAULT_CAPABILITIES, N as EXACT_BREP_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-B9d0Q0Vl.js";
3
3
  import { i as wasmIndex, n as bug, t as BrepBugError } from "./bug-ClMTAJhe.js";
4
4
  import { A as tap, C as mapBoth, D as or, E as ok, F as unwrapErr, I as unwrapOr, L as unwrapOrElse, M as tryCatch, N as tryCatchAsync, O as orElse, P as unwrap, R as zip, S as map, T as match, _ as flatMap, a as moduleInitError, b as isErr, c as sketcherStateError, d as validationError, f as OK, g as err, h as collect, i as kernelError, j as tapErr, k as pipeline, l as typeCastError, m as andThen, n as computationError, o as queryError, p as all, r as ioError, t as BrepErrorCode, u as unsupportedError, v as flatten, w as mapErr, x as isOk, y as fromNullable } from "./errors-BTccWbtE.js";
5
- import { D as kernelCallScoped, E as kernelCallRaw, T as kernelCall, _ 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 vertexPosition, x as iterWires, y as iterSolids } from "./topologyQueryFns-BfYdGOJc.js";
6
- import { a as isPlanarFace, c as manifoldShell, d as planarWire, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, o as isPlanarWire, r as isManifoldShell, s as isValidSolid, t as closedWire, u as planarFace } from "./validityTypes-BfOuvfyp.js";
5
+ import { D as kernelCallScoped, E as kernelCallRaw, T as kernelCall, _ 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 vertexPosition, x as iterWires, y as iterSolids } from "./topologyQueryFns-LXV1nTaS.js";
6
+ import { a as isPlanarFace, c as manifoldShell, d as planarWire, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, o as isPlanarWire, r as isManifoldShell, s as isValidSolid, t as closedWire, u as planarFace } from "./validityTypes-DM-Iwe8N.js";
7
7
  import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
8
8
  import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-CKXsIm9-.js";
9
9
  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-S-m9H_fe.js";
10
10
  import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-D3yDuMux.js";
11
- import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, 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, x as isCompSolid, y as downcast } from "./faceFns-7eHqNM0P.js";
12
- import { i as setShapeOrigin, t as getFaceOrigins } from "./originTrackingFns-zrksCJTa.js";
13
- import { A as parseColor, D as colorShape, E as colorFaces, F as tagFaces, M as getFaceTags, N as getTagMetadata, O as getFaceColor, P as setTagMetadata, S as hasAnyMetadata, T as propagateMetadataThroughRelocation, _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$2, h as fuseAll$2, j as findFacesByTag, k as getShapeColor, m as fuse$2, p as cutAll$2, r as makeCylinder, t as makeCompound, v as sectionToFace$1, y as slice$1 } from "./solidBuilders-8xytLt8-.js";
14
- import { A as locate$1, C as threePointArc, D as wireLoop, E as wire, F as transformCopy$1, I as translate$2, M as resize, N as rotate$2, O as applyMatrix$1, P as scale$3, 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, j as mirror$2, k as composeTransforms, 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-ClQP6zMQ.js";
15
- import { a as isSameShape, i as isEqualShape, n as getHashCode, o as simplify$1, r as isEmpty$2, s as toBREP$1, t as clone$1 } from "./shapeFns-BCgegapL.js";
16
- 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-B4308HNM.js";
17
- import { a as meshEdges$1, c as meshMultiLOD, d as clearMeshCache, f as createMeshCache, i as mesh$1, l as scaleDefaultTolerance, n as exportSTEP, o as meshLODs, r as exportSTL, s as meshLODsProgressive, t as exportIGES, u as buildMeshCacheKey } from "./meshFns-DaRZxa7B.js";
11
+ import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, 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, x as isCompSolid, y as downcast } from "./faceFns-iVPbTxki.js";
12
+ import { i as setShapeOrigin, t as getFaceOrigins } from "./originTrackingFns-CBnyKLm7.js";
13
+ import { A as parseColor, D as colorShape, E as colorFaces, F as tagFaces, M as getFaceTags, N as getTagMetadata, O as getFaceColor, P as setTagMetadata, S as hasAnyMetadata, T as propagateMetadataThroughRelocation, _ as section$1, b as split$1, d as booleanPipeline, f as cut$2, g as intersect$2, h as fuseAll$2, j as findFacesByTag, k as getShapeColor, m as fuse$2, p as cutAll$2, r as makeCylinder, t as makeCompound, v as sectionToFace$1, y as slice$1 } from "./solidBuilders-DT1gpVWM.js";
14
+ import { A as locate$1, C as threePointArc, D as wireLoop, E as wire, F as transformCopy$1, I as translate$2, M as resize, N as rotate$2, O as applyMatrix$1, P as scale$3, 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, j as mirror$2, k as composeTransforms, 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-DeNl60Rw.js";
15
+ import { a as isSameShape, i as isEqualShape, n as getHashCode, o as simplify$1, r as isEmpty$2, s as toBREP$1, t as clone$1 } from "./shapeFns-CgqKICF_.js";
16
+ 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-BP3srCfK.js";
17
+ import { a as meshEdges$1, c as meshMultiLOD, d as clearMeshCache, f as createMeshCache, i as mesh$1, l as scaleDefaultTolerance, n as exportSTEP, o as meshLODs, r as exportSTL, s as meshLODsProgressive, t as exportIGES, u as buildMeshCacheKey } from "./meshFns-DmjMzNbH.js";
18
18
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
19
- import { _ as makeThreePointArc, d as makeCircle, h as makeLine, l as makeBSplineInterpolation, n as fill, p as makeEllipseArc, r as makeFace, s as assembleWire, u as makeBezierCurve } from "./surfaceBuilders-BO96DMCH.js";
20
- import { A as variableFillet, C as chamfer$2, D as removeFaces$1, E as offset$1, F as toLineGeometryData, M as toGroupedBufferGeometryData, N as toLODGeometryData, O as shell$2, P as toLODGeometryLevels, S as chamferDistAngle, T as fillet$2, _ as checkBoolean, a as healFace, b as getNurbsCurveData, c as isValid$1, d as chamferWithEvolution, f as cutWithEvolution, g as shellWithEvolution, h as intersectWithEvolution, i as heal$1, j as toBufferGeometryData, k as thicken$1, l as solidFromShell, m as fuseWithEvolution, n as fixSelfIntersection, o as healSolid, p as filletWithEvolution, r as fixShape, s as healWire, t as autoHeal, u as positionOnCurve, v as cutAllBisect, w as draft$1, x as getNurbsSurfaceData, y as fuseAllBisect } from "./healingFns-BW7mZ_SW.js";
21
- import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, G as quatFromAxisAngle, H as circularPattern, I as createAssemblyNode, J as quatRotate, K as quatFromTo, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, Y as createAssembly, _ 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 quatMultiply, 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 updateNode } from "./threadFns-Cn7_bmux.js";
22
- import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-Cr0Lr1Dq.js";
23
- import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-BQ6XMFcm.js";
24
- import { _ as approximateAsSvgCompatibleCurve, o as ellipseArcFlags } from "./blueprint-DFpjcrlm.js";
25
- 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-DjnU3fEd.js";
26
- 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-1IfNe629.js";
27
- import { t as cornerFinder } from "./cornerFinder-BY10jciz.js";
28
- 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-CCV3R6lN.js";
29
- 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-Dye1jezD.js";
30
- 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-BCL4-H8e.js";
31
- import { S as revolve$2, a as Sketches, b as extrude$2, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, i as setFallbackFont, l as compoundSketchLoft, m as sketchRevolve, n as getFont, o as Sketch, p as sketchLoft, r as loadFont, s as compoundSketchExtrude, t as textBlueprints, u as compoundSketchRevolve, x as extrudeAll, y as CompoundSketch } from "./textBlueprints-Dhe8_Uvc.js";
32
- import { a as multiSectionSweep, c as twistExtrude, i as guidedSweep, n as loftAll, o as supportExtrude, r as complexExtrude, s as sweep$1, t as loft$2 } from "./loftFns-H4ZOpRAk.js";
33
- import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BG3JGs--.js";
34
- import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns-54UTqtan.js";
35
- import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-DZOI_ewG.js";
36
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Bbf-Dllw.js";
37
- import { t as principalBoundingBox } from "./principalBoxFns-DsfWOoXg.js";
19
+ import { _ as makeThreePointArc, d as makeCircle, h as makeLine, l as makeBSplineInterpolation, n as fill, p as makeEllipseArc, r as makeFace, s as assembleWire, u as makeBezierCurve } from "./surfaceBuilders-CPLe0bbk.js";
20
+ import { A as variableFillet, C as chamfer$2, D as removeFaces$1, E as offset$1, F as toLineGeometryData, M as toGroupedBufferGeometryData, N as toLODGeometryData, O as shell$2, P as toLODGeometryLevels, S as chamferDistAngle, T as fillet$2, _ as checkBoolean, a as healFace, b as getNurbsCurveData, c as isValid$1, d as chamferWithEvolution, f as cutWithEvolution, g as shellWithEvolution, h as intersectWithEvolution, i as heal$1, j as toBufferGeometryData, k as thicken$1, l as solidFromShell, m as fuseWithEvolution, n as fixSelfIntersection, o as healSolid, p as filletWithEvolution, r as fixShape, s as healWire, t as autoHeal, u as positionOnCurve, v as cutAllBisect, w as draft$1, x as getNurbsSurfaceData, y as fuseAllBisect } from "./healingFns-BhP8zfp1.js";
21
+ import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, G as quatFromAxisAngle, H as circularPattern, I as createAssemblyNode, J as quatRotate, K as quatFromTo, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, Y as createAssembly, _ 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 quatMultiply, 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 updateNode } from "./threadFns-DESH7lcs.js";
22
+ import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-D_Faf0GO.js";
23
+ import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-D2hANLRu.js";
24
+ import { _ as approximateAsSvgCompatibleCurve, o as ellipseArcFlags } from "./blueprint-BhIk9Pvm.js";
25
+ 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-DxDwJ5zZ.js";
26
+ 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-mxBdPiWa.js";
27
+ import { t as cornerFinder } from "./cornerFinder-BZuQkRp2.js";
28
+ 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-DqpCF72W.js";
29
+ 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-eULVgkq9.js";
30
+ 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-DUzIkns7.js";
31
+ import { S as revolve$2, a as Sketches, b as extrude$2, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, i as setFallbackFont, l as compoundSketchLoft, m as sketchRevolve, n as getFont, o as Sketch, p as sketchLoft, r as loadFont, s as compoundSketchExtrude, t as textBlueprints, u as compoundSketchRevolve, x as extrudeAll, y as CompoundSketch } from "./textBlueprints-BU0Rhk54.js";
32
+ import { a as multiSectionSweep, c as twistExtrude, i as guidedSweep, n as loftAll, o as supportExtrude, r as complexExtrude, s as sweep$1, t as loft$2 } from "./loftFns-D5NJpHLZ.js";
33
+ import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-DHx1Y3GG.js";
34
+ import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns--KmBIKYJ.js";
35
+ import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CrClIkmV.js";
36
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Df9aLYK2.js";
37
+ import { t as principalBoundingBox } from "./principalBoxFns-3mW_hA6z.js";
38
38
  import { _ as isSuccessResponse, a as createWorkerClient, c as enqueueTask, d as rejectAll, f as isBatchRequest, g as isOperationRequest, h as isInitRequest, i as registerHandler, l as isEmpty$1, m as isErrorResponse, n as createOperationRegistry, o as createTaskQueue, p as isDisposeRequest, r as createWorkerHandler, s as dequeueTask, t as createWorkerPool, u as pendingCount } from "./workerPool-Bc5hmJc4.js";
39
39
  // \0rolldown/runtime.js
40
40
  var __defProp = Object.defineProperty;
@@ -5133,29 +5133,29 @@ function toKernelPnt(v) {
5133
5133
  function toKernelDir(v) {
5134
5134
  return getKernel().createDirection3d(v[0], v[1], v[2]);
5135
5135
  }
5136
- /** Extract Vec3 from a kernel 3D vector */
5137
- function fromKernelVec(ocVec) {
5136
+ function xyzOf(v) {
5137
+ if (typeof v.X === "function") return [
5138
+ v.X(),
5139
+ v.Y(),
5140
+ v.Z()
5141
+ ];
5138
5142
  return [
5139
- ocVec.X(),
5140
- ocVec.Y(),
5141
- ocVec.Z()
5143
+ v.x,
5144
+ v.y,
5145
+ v.z
5142
5146
  ];
5143
5147
  }
5148
+ /** Extract Vec3 from a kernel 3D vector */
5149
+ function fromKernelVec(ocVec) {
5150
+ return xyzOf(ocVec);
5151
+ }
5144
5152
  /** Extract Vec3 from a kernel 3D point */
5145
5153
  function fromKernelPnt(ocPnt) {
5146
- return [
5147
- ocPnt.X(),
5148
- ocPnt.Y(),
5149
- ocPnt.Z()
5150
- ];
5154
+ return xyzOf(ocPnt);
5151
5155
  }
5152
5156
  /** Extract Vec3 from a kernel 3D direction */
5153
5157
  function fromKernelDir(ocDir) {
5154
- return [
5155
- ocDir.X(),
5156
- ocDir.Y(),
5157
- ocDir.Z()
5158
- ];
5158
+ return xyzOf(ocDir);
5159
5159
  }
5160
5160
  /** Execute fn with a temporary kernel 3D vector, auto-deleted after. */
5161
5161
  function withKernelVec(v, fn) {
@@ -7958,19 +7958,73 @@ function resolveTargetFace(shape, faceSpec) {
7958
7958
  return ok(faceSpec);
7959
7959
  }
7960
7960
  /**
7961
- * Convert a DrawingLike or Wire to a ClosedWire & PlanarWire (profiles are always
7962
- * closed and planar). `owned` is true when we materialised a fresh sketch wire
7963
- * (the caller must dispose it); false when the caller's own Wire is passed through.
7961
+ * Build the profile's face in the XY plane. A Drawing's sketch is released once
7962
+ * its face exists; a caller's Wire is expected to be closed and planar.
7964
7963
  */
7965
- function toWire(profile) {
7966
- if ("sketchOnPlane" in profile && typeof profile.sketchOnPlane === "function") return {
7967
- wire: profile.sketchOnPlane("XY").wire,
7968
- owned: true
7969
- };
7970
- return {
7971
- wire: profile,
7972
- owned: false
7973
- };
7964
+ function profileFace(profile) {
7965
+ if ("sketchOnPlane" in profile && typeof profile.sketchOnPlane === "function") {
7966
+ const sketch = profile.sketchOnPlane("XY");
7967
+ try {
7968
+ return ok(sketch.face());
7969
+ } catch (e) {
7970
+ return err(validationError("COMPOUND_PROFILE_INVALID", `compoundOps: the profile does not make a single face: ${e instanceof Error ? e.message : String(e)}`));
7971
+ } finally {
7972
+ sketch.delete?.();
7973
+ }
7974
+ }
7975
+ return makeFace(profile);
7976
+ }
7977
+ /**
7978
+ * Move a face drawn in XY onto a target face: its origin to `center`, its Z axis
7979
+ * to `normal`. Faces parallel to XY keep the world X and Y axes; on any other
7980
+ * face local Y runs up the face (world +Z projected onto it) and local X is
7981
+ * Y x normal, which points right when the face is seen from outside.
7982
+ */
7983
+ function placeOnFace(face, normal, center) {
7984
+ const [nx, ny, nz] = normal;
7985
+ if (Math.abs(nz) > 1 - 1e-9) return ok(translate$2(face, center));
7986
+ const yDir = vecNormalize([
7987
+ -nx * nz,
7988
+ -ny * nz,
7989
+ 1 - nz * nz
7990
+ ]);
7991
+ const xDir = vecCross(yDir, normal);
7992
+ return applyMatrix$1(face, {
7993
+ linear: [
7994
+ xDir[0],
7995
+ yDir[0],
7996
+ nx,
7997
+ xDir[1],
7998
+ yDir[1],
7999
+ ny,
8000
+ xDir[2],
8001
+ yDir[2],
8002
+ nz
8003
+ ],
8004
+ translation: center
8005
+ });
8006
+ }
8007
+ /** Extrude the profile, placed on the target face, by `distance` along the face normal. */
8008
+ function profileTool(shape, faceSpec, profile, distance) {
8009
+ try {
8010
+ var _usingCtx$3 = _usingCtx();
8011
+ const targetResult = resolveTargetFace(shape, faceSpec);
8012
+ if (isErr(targetResult)) return targetResult;
8013
+ const normal = vecNormalize(normalAt(targetResult.value));
8014
+ const center = faceCenter(targetResult.value);
8015
+ const scope = _usingCtx$3.u(new DisposalScope());
8016
+ const flat = profileFace(profile);
8017
+ if (isErr(flat)) return flat;
8018
+ scope.register(flat.value);
8019
+ const placed = placeOnFace(flat.value, normal, center);
8020
+ if (isErr(placed)) return placed;
8021
+ scope.register(placed.value);
8022
+ return extrude$2(placed.value, vecScale(normal, distance));
8023
+ } catch (_) {
8024
+ _usingCtx$3.e = _;
8025
+ } finally {
8026
+ _usingCtx$3.d();
8027
+ }
7974
8028
  }
7975
8029
  /**
7976
8030
  * Drill a hole through a 3D shape.
@@ -8076,31 +8130,18 @@ function drill(shape, options) {
8076
8130
  */
8077
8131
  function pocket(shape, options) {
8078
8132
  try {
8079
- var _usingCtx$3 = _usingCtx();
8133
+ var _usingCtx3 = _usingCtx();
8080
8134
  const s = resolve(shape);
8081
8135
  const { profile, depth } = options;
8082
8136
  if (depth <= 0) return err(validationError("POCKET_INVALID_DEPTH", "Pocket depth must be positive"));
8083
- const targetResult = resolveTargetFace(s, options.face);
8084
- if (isErr(targetResult)) return targetResult;
8085
- const targetFace = targetResult.value;
8086
- const normal = normalAt(targetFace);
8087
- const center = faceCenter(targetFace);
8088
- const scope = _usingCtx$3.u(new DisposalScope());
8089
- const { wire: w, owned } = toWire(profile);
8090
- if (owned) scope.register(w);
8091
- const faceResult = makeFace(w);
8092
- if (isErr(faceResult)) return faceResult;
8093
- scope.register(faceResult.value);
8094
- const positioned = scope.register(translate$2(faceResult.value, center));
8095
- const extDir = vecScale(vecNormalize(normal), -depth);
8096
- const toolResult = extrude$2(positioned, extDir);
8137
+ const toolResult = profileTool(s, options.face, profile, -depth);
8097
8138
  if (isErr(toolResult)) return toolResult;
8098
- scope.register(toolResult.value);
8099
- return cut$2(s, toolResult.value, { unsafe: true });
8139
+ const tool = _usingCtx3.u(toolResult.value);
8140
+ return cut$2(s, tool, { unsafe: true });
8100
8141
  } catch (_) {
8101
- _usingCtx$3.e = _;
8142
+ _usingCtx3.e = _;
8102
8143
  } finally {
8103
- _usingCtx$3.d();
8144
+ _usingCtx3.d();
8104
8145
  }
8105
8146
  }
8106
8147
  /**
@@ -8111,31 +8152,18 @@ function pocket(shape, options) {
8111
8152
  */
8112
8153
  function boss(shape, options) {
8113
8154
  try {
8114
- var _usingCtx3 = _usingCtx();
8155
+ var _usingCtx4 = _usingCtx();
8115
8156
  const s = resolve(shape);
8116
8157
  const { profile, height } = options;
8117
8158
  if (height <= 0) return err(validationError("BOSS_INVALID_HEIGHT", "Boss height must be positive"));
8118
- const targetResult = resolveTargetFace(s, options.face);
8119
- if (isErr(targetResult)) return targetResult;
8120
- const targetFace = targetResult.value;
8121
- const normal = normalAt(targetFace);
8122
- const center = faceCenter(targetFace);
8123
- const scope = _usingCtx3.u(new DisposalScope());
8124
- const { wire: w, owned } = toWire(profile);
8125
- if (owned) scope.register(w);
8126
- const faceResult = makeFace(w);
8127
- if (isErr(faceResult)) return faceResult;
8128
- scope.register(faceResult.value);
8129
- const positioned = scope.register(translate$2(faceResult.value, center));
8130
- const extDir = vecScale(vecNormalize(normal), height);
8131
- const toolResult = extrude$2(positioned, extDir);
8159
+ const toolResult = profileTool(s, options.face, profile, height);
8132
8160
  if (isErr(toolResult)) return toolResult;
8133
- scope.register(toolResult.value);
8134
- return fuse$2(s, toolResult.value, { unsafe: true });
8161
+ const tool = _usingCtx4.u(toolResult.value);
8162
+ return fuse$2(s, tool, { unsafe: true });
8135
8163
  } catch (_) {
8136
- _usingCtx3.e = _;
8164
+ _usingCtx4.e = _;
8137
8165
  } finally {
8138
- _usingCtx3.d();
8166
+ _usingCtx4.d();
8139
8167
  }
8140
8168
  }
8141
8169
  /**
@@ -8145,7 +8173,7 @@ function boss(shape, options) {
8145
8173
  */
8146
8174
  function mirrorJoin(shape, options) {
8147
8175
  try {
8148
- var _usingCtx4 = _usingCtx();
8176
+ var _usingCtx5 = _usingCtx();
8149
8177
  const s = resolve(shape);
8150
8178
  const normal = options?.normal ?? [
8151
8179
  1,
@@ -8154,12 +8182,12 @@ function mirrorJoin(shape, options) {
8154
8182
  ];
8155
8183
  const planeOrigin = options?.at;
8156
8184
  if (vecIsZero(normal)) return err(validationError("MIRROR_ZERO_NORMAL", "Mirror plane normal cannot be zero"));
8157
- const mirrored = _usingCtx4.u(mirror$2(s, normal, planeOrigin));
8185
+ const mirrored = _usingCtx5.u(mirror$2(s, normal, planeOrigin));
8158
8186
  return fuse$2(s, mirrored, { unsafe: true });
8159
8187
  } catch (_) {
8160
- _usingCtx4.e = _;
8188
+ _usingCtx5.e = _;
8161
8189
  } finally {
8162
- _usingCtx4.d();
8190
+ _usingCtx5.d();
8163
8191
  }
8164
8192
  }
8165
8193
  /**
@@ -8174,7 +8202,7 @@ function rectangularPattern(shape, options) {
8174
8202
  if (xCount < 1 || yCount < 1) return err(validationError("PATTERN_INVALID_COUNT", "Pattern counts must be at least 1"));
8175
8203
  if (vecIsZero(xDir)) return err(validationError("PATTERN_ZERO_DIRECTION", "X direction cannot be zero"));
8176
8204
  if (vecIsZero(yDir)) return err(validationError("PATTERN_ZERO_DIRECTION", "Y direction cannot be zero"));
8177
- if (xCount === 1 && yCount === 1) return ok(s);
8205
+ if (xCount === 1 && yCount === 1) return clone$1(s);
8178
8206
  const xNorm = vecNormalize(xDir);
8179
8207
  const yNorm = vecNormalize(yDir);
8180
8208
  const copies = [s];
@@ -1,8 +1,8 @@
1
- import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-DAz6aAnJ.js";
1
+ import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-DwvQUp9M.js";
2
2
  import { E as ok, P as unwrap, d as validationError, g as err } from "./errors-BTccWbtE.js";
3
- import { s as getEdges } from "./topologyQueryFns-BfYdGOJc.js";
3
+ import { s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
4
4
  import { c as vecLength, d as vecNormalize, g as vecSub, r as vecCross } from "./vecOps-S-m9H_fe.js";
5
- import { t as clone } from "./shapeFns-BCgegapL.js";
5
+ import { t as clone } from "./shapeFns-CgqKICF_.js";
6
6
  // src/projection/projectionPlanes.ts
7
7
  /** Lookup table mapping each {@link ProjectionPlane} to its camera configuration. */
8
8
  var PROJECTION_PLANES = {
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-DJT3SnGK.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-xh11vEQw.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
4
4
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
5
- const require_shapeFns = require("./shapeFns-BbXqiNqY.cjs");
5
+ const require_shapeFns = require("./shapeFns-C0w8vvfb.cjs");
6
6
  // src/projection/projectionPlanes.ts
7
7
  /** Lookup table mapping each {@link ProjectionPlane} to its camera configuration. */
8
8
  var PROJECTION_PLANES = {
package/dist/core.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_shapeTypes = require("./shapeTypes-DJT3SnGK.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
3
3
  const require_bug = require("./bug-CBcpIPuf.cjs");
4
4
  const require_errors = require("./errors-O_blYTWT.cjs");
5
- const require_validityTypes = require("./validityTypes-CXkecqMw.cjs");
5
+ const require_validityTypes = require("./validityTypes-C6rROGTP.cjs");
6
6
  const require_constants = require("./constants-oee0S_x6.cjs");
7
7
  const require_types = require("./types-CjF9Rofr.cjs");
8
8
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
- import { C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, H as withScope, L as isLive, M as is3D, N as DisposalScope, P as createHandle, S as isShell, T as isWire, U as withScopeResult, W as withScopeResultAsync, _ as isCompound, b as isShape1D, i as castShape, j as is2D, v as isEdge, w as isVertex, x as isShape3D, y as isFace } from "./shapeTypes-DAz6aAnJ.js";
1
+ import { C as isSolid, D as getShapeKind, E as GeometryCleanupError, F as createKernelHandle, H as withScope, L as isLive, M as is3D, N as DisposalScope, P as createHandle, S as isShell, T as isWire, U as withScopeResult, W as withScopeResultAsync, _ as isCompound, b as isShape1D, i as castShape, j as is2D, v as isEdge, w as isVertex, x as isShape3D, y as isFace } from "./shapeTypes-DwvQUp9M.js";
2
2
  import { n as bug, t as BrepBugError } from "./bug-ClMTAJhe.js";
3
3
  import { E as ok, F as unwrapErr, I as unwrapOr, L as unwrapOrElse, M as tryCatch, N as tryCatchAsync, P as unwrap, S as map, T as match, _ as flatMap, a as moduleInitError, b as isErr, c as sketcherStateError, d as validationError, f as OK, g as err, h as collect, i as kernelError, l as typeCastError, m as andThen, n as computationError, o as queryError, r as ioError, u as unsupportedError, w as mapErr, x as isOk } from "./errors-BTccWbtE.js";
4
- import { c as manifoldShell, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, r as isManifoldShell, s as isValidSolid, t as closedWire } from "./validityTypes-BfOuvfyp.js";
4
+ import { c as manifoldShell, f as validSolid, i as isOrientedFace, l as orientedFace, n as isClosedWire, r as isManifoldShell, s as isValidSolid, t as closedWire } from "./validityTypes-DM-Iwe8N.js";
5
5
  import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-iraOnb2p.js";
6
6
  import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-CKXsIm9-.js";
7
7
  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-S-m9H_fe.js";
@@ -1,6 +1,6 @@
1
1
  import { t as DEG2RAD } from "./constants-iraOnb2p.js";
2
2
  import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
3
- import { p as distance2d, u as angle2d, v as samePoint } from "./helpers-BQ6XMFcm.js";
3
+ import { p as distance2d, u as angle2d, v as samePoint } from "./helpers-D2hANLRu.js";
4
4
  // 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-oee0S_x6.cjs");
2
2
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
3
- const require_helpers = require("./helpers-De0Z_6iV.cjs");
3
+ const require_helpers = require("./helpers-DKEVm6Hu.cjs");
4
4
  // src/query/cornerFinder.ts
5
5
  var PI_2 = 2 * Math.PI;
6
6
  function positiveHalfAngle(angle) {
@@ -1,4 +1,4 @@
1
- import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-DAz6aAnJ.js";
1
+ import { T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, v as isEdge } from "./shapeTypes-DwvQUp9M.js";
2
2
  import { E as ok, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
3
3
  // src/topology/curveFns.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-DJT3SnGK.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
3
  // src/topology/curveFns.ts
4
4
  /**
@@ -1,22 +1,22 @@
1
- const require_shapeTypes = require("./shapeTypes-DJT3SnGK.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
2
2
  const require_bug = require("./bug-CBcpIPuf.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-xh11vEQw.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
6
  const require_types = require("./types-CjF9Rofr.cjs");
7
7
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
8
8
  const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
9
- const require_faceFns = require("./faceFns-BjmlYcc9.cjs");
10
- const require_curveFns = require("./curveFns-8lUhNquZ.cjs");
9
+ const require_faceFns = require("./faceFns-B7MiDYj1.cjs");
10
+ const require_curveFns = require("./curveFns-CyIvQNYT.cjs");
11
11
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
12
- const require_surfaceBuilders = require("./surfaceBuilders-CwG_RPdZ.cjs");
13
- const require_blueprintSketcher = require("./blueprintSketcher-W9yON-UC.cjs");
14
- const require_helpers = require("./helpers-De0Z_6iV.cjs");
15
- const require_blueprint = require("./blueprint-D0VEeTzJ.cjs");
16
- const require_cornerFinder = require("./cornerFinder-B8PqO4um.cjs");
17
- const require_boolean2D = require("./boolean2D-C9VghXHG.cjs");
18
- const require_textBlueprints = require("./textBlueprints-DHfYmLtP.cjs");
19
- const require_cameraFns = require("./cameraFns-x3L6dtA8.cjs");
12
+ const require_surfaceBuilders = require("./surfaceBuilders-BvwSgD3C.cjs");
13
+ const require_blueprintSketcher = require("./blueprintSketcher-Di376t-0.cjs");
14
+ const require_helpers = require("./helpers-DKEVm6Hu.cjs");
15
+ const require_blueprint = require("./blueprint-D83DDDPb.cjs");
16
+ const require_cornerFinder = require("./cornerFinder-CdOe1Wrb.cjs");
17
+ const require_boolean2D = require("./boolean2D-CNZFI_y8.cjs");
18
+ const require_textBlueprints = require("./textBlueprints-CNPCPJix.cjs");
19
+ const require_cameraFns = require("./cameraFns-RqraCXIc.cjs");
20
20
  // src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -513,9 +513,17 @@ var sketchHelix = (pitch, height, radius, center = [
513
513
  0,
514
514
  1
515
515
  ], lefthand = false) => {
516
- const centerVec3 = require_types.toVec3(center);
517
- const dirVec3 = require_types.toVec3(dir);
518
- return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([require_surfaceBuilders.makeHelix(pitch, height, radius, centerVec3, dirVec3, lefthand)])));
516
+ try {
517
+ var _usingCtx5 = require_shapeTypes._usingCtx();
518
+ const centerVec3 = require_types.toVec3(center);
519
+ const dirVec3 = require_types.toVec3(dir);
520
+ const helix = _usingCtx5.u(require_surfaceBuilders.makeHelix(pitch, height, radius, centerVec3, dirVec3, lefthand));
521
+ return new require_textBlueprints.Sketch(require_errors.unwrap(require_surfaceBuilders.assembleWire([helix])));
522
+ } catch (_) {
523
+ _usingCtx5.e = _;
524
+ } finally {
525
+ _usingCtx5.d();
526
+ }
519
527
  };
520
528
  // src/sketching/shortcuts.ts
521
529
  /**
@@ -691,6 +699,10 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
691
699
  else if (!samePoint(curve.offset.firstPoint, curve.offset.lastPoint)) offsettedArray.push(require_blueprint.make2dSegmentCurve(curve.offset.firstPoint, curve.offset.lastPoint));
692
700
  }
693
701
  const iterateOffsetCurves = function* () {
702
+ if (offsetCurves.length === 1) {
703
+ yield require_errors.safeIndex(offsetCurves, 0, "rawOffsets");
704
+ return;
705
+ }
694
706
  for (const curve of offsetCurves.slice(0, -1)) yield curve;
695
707
  if (!savedLastCurve) require_bug.bug("offset.rawOffsets", "No saved curve after iterating offset segments");
696
708
  yield savedLastCurve;
@@ -738,7 +750,8 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
738
750
  */
739
751
  function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
740
752
  const offsettedArray = rawOffsets(blueprint, offset, offsetConfig);
741
- if (offsettedArray.length < 2) return null;
753
+ const [onlyCurve] = offsettedArray;
754
+ if (!onlyCurve || offsettedArray.length === 1 && !samePoint(onlyCurve.firstPoint, onlyCurve.lastPoint)) return null;
742
755
  const allIntersections = findSelfIntersections(offsettedArray);
743
756
  if (!allIntersections.size) {
744
757
  const offsettedBlueprint = new require_blueprint.Blueprint(offsettedArray);
@@ -1,22 +1,22 @@
1
- import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-DAz6aAnJ.js";
1
+ import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel } from "./shapeTypes-DwvQUp9M.js";
2
2
  import { i as wasmIndex, n as bug } from "./bug-ClMTAJhe.js";
3
3
  import { P as unwrap, s as safeIndex } from "./errors-BTccWbtE.js";
4
- import { s as getEdges } from "./topologyQueryFns-BfYdGOJc.js";
4
+ import { s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
5
5
  import { t as DEG2RAD } from "./constants-iraOnb2p.js";
6
6
  import { r as toVec3 } from "./types-CKXsIm9-.js";
7
7
  import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-S-m9H_fe.js";
8
8
  import { a as planeToWorld, o as resolvePlane } from "./planeOps-D3yDuMux.js";
9
- import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-7eHqNM0P.js";
10
- import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-B4308HNM.js";
9
+ import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as copyShape, y as downcast } from "./faceFns-iVPbTxki.js";
10
+ import { h as offsetWire2D, i as curveIsClosed, l as curveStartPoint } from "./curveFns-BP3srCfK.js";
11
11
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
12
- import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-BO96DMCH.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-Cr0Lr1Dq.js";
14
- import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-BQ6XMFcm.js";
15
- import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-DFpjcrlm.js";
16
- import { t as cornerFinder } from "./cornerFinder-BY10jciz.js";
17
- import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CCV3R6lN.js";
18
- import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-Dhe8_Uvc.js";
19
- import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-DZOI_ewG.js";
12
+ import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-CPLe0bbk.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-D_Faf0GO.js";
14
+ import { b as squareDistance2d, l as add2d, s as PRECISION_OFFSET, v as samePoint$1, x as subtract2d } from "./helpers-D2hANLRu.js";
15
+ import { _ as approximateAsSvgCompatibleCurve, a as edgeToCurve, f as make2dInerpolatedBSplineCurve, i as curvesAsEdgesOnPlane, l as make2dCircle, p as make2dSegmentCurve, s as make2dArcFromCenter, t as Blueprint, u as make2dEllipse, v as Curve2D, x as BoundingBox2d, y as deserializeCurve2D } from "./blueprint-BhIk9Pvm.js";
16
+ import { t as cornerFinder } from "./cornerFinder-BZuQkRp2.js";
17
+ import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-DqpCF72W.js";
18
+ import { _ as wrapSketchData, a as Sketches, o as Sketch, t as textBlueprints, v as wrapSketchDataArray } from "./textBlueprints-BU0Rhk54.js";
19
+ import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-CrClIkmV.js";
20
20
  // src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -513,9 +513,17 @@ var sketchHelix = (pitch, height, radius, center = [
513
513
  0,
514
514
  1
515
515
  ], lefthand = false) => {
516
- const centerVec3 = toVec3(center);
517
- const dirVec3 = toVec3(dir);
518
- return new Sketch(unwrap(assembleWire([makeHelix(pitch, height, radius, centerVec3, dirVec3, lefthand)])));
516
+ try {
517
+ var _usingCtx5 = _usingCtx();
518
+ const centerVec3 = toVec3(center);
519
+ const dirVec3 = toVec3(dir);
520
+ const helix = _usingCtx5.u(makeHelix(pitch, height, radius, centerVec3, dirVec3, lefthand));
521
+ return new Sketch(unwrap(assembleWire([helix])));
522
+ } catch (_) {
523
+ _usingCtx5.e = _;
524
+ } finally {
525
+ _usingCtx5.d();
526
+ }
519
527
  };
520
528
  // src/sketching/shortcuts.ts
521
529
  /**
@@ -691,6 +699,10 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
691
699
  else if (!samePoint(curve.offset.firstPoint, curve.offset.lastPoint)) offsettedArray.push(make2dSegmentCurve(curve.offset.firstPoint, curve.offset.lastPoint));
692
700
  }
693
701
  const iterateOffsetCurves = function* () {
702
+ if (offsetCurves.length === 1) {
703
+ yield safeIndex(offsetCurves, 0, "rawOffsets");
704
+ return;
705
+ }
694
706
  for (const curve of offsetCurves.slice(0, -1)) yield curve;
695
707
  if (!savedLastCurve) bug("offset.rawOffsets", "No saved curve after iterating offset segments");
696
708
  yield savedLastCurve;
@@ -738,7 +750,8 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
738
750
  */
739
751
  function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
740
752
  const offsettedArray = rawOffsets(blueprint, offset, offsetConfig);
741
- if (offsettedArray.length < 2) return null;
753
+ const [onlyCurve] = offsettedArray;
754
+ if (!onlyCurve || offsettedArray.length === 1 && !samePoint(onlyCurve.firstPoint, onlyCurve.lastPoint)) return null;
742
755
  const allIntersections = findSelfIntersections(offsettedArray);
743
756
  if (!allIntersections.size) {
744
757
  const offsettedBlueprint = new Blueprint(offsettedArray);
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-DJT3SnGK.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-Dc7j-MYg.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-xh11vEQw.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-5Frx8Y-0.cjs");
4
4
  const require_types = require("./types-CjF9Rofr.cjs");
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,6 +1,6 @@
1
- import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-DAz6aAnJ.js";
1
+ import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-DwvQUp9M.js";
2
2
  import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-BfYdGOJc.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-LXV1nTaS.js";
4
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,10 +1,10 @@
1
- import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-DAz6aAnJ.js";
2
- import { k as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-ipKUdNLN.js";
1
+ import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-DwvQUp9M.js";
2
+ import { j as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-B9d0Q0Vl.js";
3
3
  import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError, x as isOk } from "./errors-BTccWbtE.js";
4
- import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BfYdGOJc.js";
4
+ import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-LXV1nTaS.js";
5
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
6
- import { y as downcast } from "./faceFns-7eHqNM0P.js";
7
- import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-8xytLt8-.js";
6
+ import { y as downcast } from "./faceFns-iVPbTxki.js";
7
+ import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-DT1gpVWM.js";
8
8
  import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
9
9
  // src/topology/threeHelpers.ts
10
10
  /**