brepjs 20.11.0 → 20.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-CS62XPcQ.cjs → adjacencyFns-ChCZyiBA.cjs} +3 -3
  4. package/dist/{adjacencyFns-DG9R99LR.js → adjacencyFns-Cu9Zjjsv.js} +3 -3
  5. package/dist/{blueprint-B8tYa1RE.js → blueprint-CHmxRlJw.js} +5 -5
  6. package/dist/{blueprint-YK9OBMxh.cjs → blueprint-DxAD4jsT.cjs} +5 -5
  7. package/dist/{blueprintFns-DDiWI0Ol.cjs → blueprintFns-BxEYPNV5.cjs} +2 -2
  8. package/dist/{blueprintFns-C0x5vPm-.js → blueprintFns-CVjTOusS.js} +2 -2
  9. package/dist/{blueprintSketcher-DcyidOGa.js → blueprintSketcher-BECQIPIt.js} +3 -3
  10. package/dist/{blueprintSketcher-7v6ufdam.cjs → blueprintSketcher-Cy1atQHR.cjs} +3 -3
  11. package/dist/{boolean2D-DYAua9O_.js → boolean2D-Cf9l3KK0.js} +4 -4
  12. package/dist/{boolean2D-B21GheGE.cjs → boolean2D-DF0i9O9B.cjs} +4 -4
  13. package/dist/brepjs.cjs +397 -76
  14. package/dist/brepjs.js +397 -76
  15. package/dist/{cameraFns-CAjuoPKb.js → cameraFns-CkLHhFRs.js} +3 -3
  16. package/dist/{cameraFns-HpsMe1iL.cjs → cameraFns-nr0q89z5.cjs} +3 -3
  17. package/dist/core.cjs +2 -2
  18. package/dist/core.js +2 -2
  19. package/dist/{cornerFinder-DHg0ej_Q.js → cornerFinder-6S-UlbNA.js} +1 -1
  20. package/dist/{cornerFinder-DVHtBOzM.cjs → cornerFinder-CrceCNPv.cjs} +1 -1
  21. package/dist/{curveFns-DUSOe8uJ.cjs → curveFns-BBx04S8G.cjs} +1 -1
  22. package/dist/{curveFns-BdmSrGqT.js → curveFns-DdG-DkSs.js} +1 -1
  23. package/dist/{drawFns-Cy7P1Q-L.cjs → drawFns-COim8Ti4.cjs} +12 -12
  24. package/dist/{drawFns-X0cS9iAp.js → drawFns-Vb8LHeb-.js} +12 -12
  25. package/dist/{faceFns-DKEm5U-p.js → faceFns-3VaHLMb8.js} +2 -2
  26. package/dist/{faceFns-vVGf6osa.cjs → faceFns-DolWAvAu.cjs} +2 -2
  27. package/dist/{healingFns-CW0olP8u.cjs → healingFns-BZRF9VAs.cjs} +5 -5
  28. package/dist/{healingFns-C_3Zf9sr.js → healingFns-xog7HTv1.js} +5 -5
  29. package/dist/{helpers-CcZp3tLI.js → helpers-BhBnVALd.js} +6 -6
  30. package/dist/{helpers-BIpWypkW.cjs → helpers-BjVuQMLI.cjs} +6 -6
  31. package/dist/{importFns-D_tBVKl2.js → importFns-BExUbyad.js} +48 -11
  32. package/dist/{importFns-DI3Q8B0Q.cjs → importFns-Uz6iAurc.cjs} +48 -11
  33. package/dist/io/dxfExportFns.d.ts +2 -2
  34. package/dist/io/dxfImportFns.d.ts +4 -2
  35. package/dist/io.cjs +2 -2
  36. package/dist/io.js +2 -2
  37. package/dist/kernel/occtWasm/meshOps.d.ts +1 -1
  38. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  39. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  40. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -1
  41. package/dist/{loftFns-DIsFP0VL.js → loftFns-B7rgdvke.js} +1 -1
  42. package/dist/{loftFns-tGsV_hHY.cjs → loftFns-nWtrZfoY.cjs} +1 -1
  43. package/dist/{measureFns-eCuwj0im.js → measureFns-AxoHtJ3J.js} +3 -3
  44. package/dist/{measureFns-BoNCUOKe.cjs → measureFns-eOGL04SI.cjs} +3 -3
  45. package/dist/measurement.cjs +2 -2
  46. package/dist/measurement.js +2 -2
  47. package/dist/{meshFns-0W1-80zv.cjs → meshFns-BhOC8SuD.cjs} +3 -3
  48. package/dist/{meshFns-B9jPfcB2.js → meshFns-C1nJQkWC.js} +3 -3
  49. package/dist/{occtWasmAdapter-CsDULjij.cjs → occtWasmAdapter-D1EXktNq.cjs} +5 -2
  50. package/dist/{occtWasmAdapter-ClvPe3OJ.js → occtWasmAdapter-RBm-JLoN.js} +5 -2
  51. package/dist/operations.cjs +2 -2
  52. package/dist/operations.js +2 -2
  53. package/dist/{originTrackingFns-BW2BaJW8.js → originTrackingFns-4z3sWvOD.js} +2 -2
  54. package/dist/{originTrackingFns-cEKFxtia.cjs → originTrackingFns-DRRVoZxG.cjs} +2 -2
  55. package/dist/{primitiveFns-BJ-ehvvd.cjs → primitiveFns-BdSDbmhs.cjs} +4 -4
  56. package/dist/{primitiveFns-BOZ7Kx0M.js → primitiveFns-D-5rBhH4.js} +4 -4
  57. package/dist/{principalBoxFns-B6PZwxDM.js → principalBoxFns-BeOAlafI.js} +3 -3
  58. package/dist/{principalBoxFns-B1j2sNAc.cjs → principalBoxFns-CY98NNKz.cjs} +3 -3
  59. package/dist/projection.cjs +1 -1
  60. package/dist/projection.js +1 -1
  61. package/dist/query.cjs +2 -2
  62. package/dist/query.js +2 -2
  63. package/dist/{refResolveFns-DvDeMCVU.cjs → refResolveFns--VMNo9vf.cjs} +6 -6
  64. package/dist/{refResolveFns-BxvibZPu.js → refResolveFns-DB8FIWrZ.js} +6 -6
  65. package/dist/{shapeFns-De7CbEeQ.js → shapeFns-BTfhLPET.js} +2 -2
  66. package/dist/{shapeFns-CJrIL2CG.cjs → shapeFns-CREKqmcG.cjs} +2 -2
  67. package/dist/shapeRef.cjs +1 -1
  68. package/dist/shapeRef.js +1 -1
  69. package/dist/{shapeTypes-BCy8JI0O.js → shapeTypes-Db3yAgTO.js} +1 -1
  70. package/dist/{shapeTypes-CNQn1x5H.cjs → shapeTypes-HDVHzNk1.cjs} +1 -1
  71. package/dist/sketching.cjs +3 -3
  72. package/dist/sketching.js +3 -3
  73. package/dist/{solidBuilders-BN1p303l.cjs → solidBuilders-BeanhIbq.cjs} +5 -5
  74. package/dist/{solidBuilders-YbLOfWIp.js → solidBuilders-CSg8AUaL.js} +5 -5
  75. package/dist/{surfaceBuilders-CaN-lye8.js → surfaceBuilders-4F0VrN1_.js} +3 -3
  76. package/dist/{surfaceBuilders-C5lz2TNF.cjs → surfaceBuilders-BdOO4OJU.cjs} +3 -3
  77. package/dist/text.cjs +2 -2
  78. package/dist/text.js +2 -2
  79. package/dist/{textBlueprints-jlqCGG4p.cjs → textBlueprints-0pLR2X5a.cjs} +7 -7
  80. package/dist/{textBlueprints-BlfIkOUx.js → textBlueprints-BpituhGG.js} +7 -7
  81. package/dist/{textMetrics-B2KxCoHk.cjs → textMetrics-BhIL6fpo.cjs} +1 -1
  82. package/dist/{textMetrics-BjhB4Zur.js → textMetrics-DmgaIDzF.js} +1 -1
  83. package/dist/{threadFns-DWMumhmK.js → threadFns-C54cXKrZ.js} +7 -7
  84. package/dist/{threadFns-DO9SkBPb.cjs → threadFns-LGRpYJea.cjs} +7 -7
  85. package/dist/topology.cjs +9 -9
  86. package/dist/topology.js +9 -9
  87. package/dist/{topologyQueryFns-BwhwOtxv.cjs → topologyQueryFns-BJ5U4AmO.cjs} +1 -1
  88. package/dist/{topologyQueryFns-Clkdolgd.js → topologyQueryFns-BYXQ2Kkn.js} +1 -1
  89. package/dist/{validityTypes-B_6gRPPO.cjs → validityTypes-C2l1ryPq.cjs} +1 -1
  90. package/dist/{validityTypes-txYFYYN6.js → validityTypes-ClsRW650.js} +1 -1
  91. package/package.json +1 -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-BCy8JI0O.js";
2
- import { A as DEFAULT_CAPABILITIES, j as EXACT_BREP_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-ClvPe3OJ.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-Db3yAgTO.js";
2
+ import { A as DEFAULT_CAPABILITIES, j as EXACT_BREP_CAPABILITIES, t as OcctWasmAdapter } from "./occtWasmAdapter-RBm-JLoN.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-CUsZRWJ7.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-Clkdolgd.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-txYFYYN6.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-BYXQ2Kkn.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-ClsRW650.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-DgG0vHN7.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-DKEm5U-p.js";
12
- import { i as setShapeOrigin, t as getFaceOrigins } from "./originTrackingFns-BW2BaJW8.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-YbLOfWIp.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-BOZ7Kx0M.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-De7CbEeQ.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-BdmSrGqT.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-B9jPfcB2.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-3VaHLMb8.js";
12
+ import { i as setShapeOrigin, t as getFaceOrigins } from "./originTrackingFns-4z3sWvOD.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-CSg8AUaL.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-D-5rBhH4.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-BTfhLPET.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-DdG-DkSs.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-C1nJQkWC.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-CaN-lye8.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-C_3Zf9sr.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-DWMumhmK.js";
22
- import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DcyidOGa.js";
23
- import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-CcZp3tLI.js";
24
- import { _ as approximateAsSvgCompatibleCurve, o as ellipseArcFlags } from "./blueprint-B8tYa1RE.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-X0cS9iAp.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-eCuwj0im.js";
27
- import { t as cornerFinder } from "./cornerFinder-DHg0ej_Q.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-DYAua9O_.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-C0x5vPm-.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-D_tBVKl2.js";
31
- import { a as Sketch, b as extrudeAll, 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, x as revolve$2, y as extrude$2 } from "./textBlueprints-BlfIkOUx.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-DIsFP0VL.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-BxvibZPu.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-DG9R99LR.js";
35
- import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CAjuoPKb.js";
36
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-BjhB4Zur.js";
37
- import { t as principalBoundingBox } from "./principalBoxFns-B6PZwxDM.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-4F0VrN1_.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-xog7HTv1.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-C54cXKrZ.js";
22
+ import { n as BaseSketcher2d, r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-BECQIPIt.js";
23
+ import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-BhBnVALd.js";
24
+ import { _ as approximateAsSvgCompatibleCurve, o as ellipseArcFlags } from "./blueprint-CHmxRlJw.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-Vb8LHeb-.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-AxoHtJ3J.js";
27
+ import { t as cornerFinder } from "./cornerFinder-6S-UlbNA.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-Cf9l3KK0.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-CVjTOusS.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-BExUbyad.js";
31
+ import { a as Sketch, b as extrudeAll, 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, x as revolve$2, y as extrude$2 } from "./textBlueprints-BpituhGG.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-B7rgdvke.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-DB8FIWrZ.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-Cu9Zjjsv.js";
35
+ import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CkLHhFRs.js";
36
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-DmgaIDzF.js";
37
+ import { t as principalBoundingBox } from "./principalBoxFns-BeOAlafI.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;
@@ -6190,7 +6190,7 @@ function sub(a, b) {
6190
6190
  function dot(a, b) {
6191
6191
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
6192
6192
  }
6193
- function cross(a, b) {
6193
+ function cross$1(a, b) {
6194
6194
  return [
6195
6195
  a[1] * b[2] - a[2] * b[1],
6196
6196
  a[2] * b[0] - a[0] * b[2],
@@ -6214,7 +6214,7 @@ function normalize(a) {
6214
6214
  }
6215
6215
  /** A unit vector perpendicular to `v` (for the parallel-normals degenerate case). */
6216
6216
  function anyPerpendicular(v) {
6217
- return normalize(cross(v, Math.abs(v[0]) < .9 ? [
6217
+ return normalize(cross$1(v, Math.abs(v[0]) < .9 ? [
6218
6218
  1,
6219
6219
  0,
6220
6220
  0
@@ -6294,7 +6294,7 @@ function solveAngle(ref, dep, angleRad) {
6294
6294
  1
6295
6295
  ]);
6296
6296
  const phi = Math.acos(Math.max(-1, Math.min(1, dot(nDep, nRef))));
6297
- const c = cross(nDep, nRef);
6297
+ const c = cross$1(nDep, nRef);
6298
6298
  const axis = Math.hypot(c[0], c[1], c[2]) < 1e-9 ? anyPerpendicular(nDep) : c;
6299
6299
  return {
6300
6300
  position: [
@@ -6801,63 +6801,378 @@ function parseEntities(text) {
6801
6801
  current = {
6802
6802
  type: value,
6803
6803
  layer: "0",
6804
- data: /* @__PURE__ */ new Map()
6804
+ data: /* @__PURE__ */ new Map(),
6805
+ pairs: []
6805
6806
  };
6806
6807
  continue;
6807
6808
  }
6808
6809
  if (current) {
6810
+ current.pairs.push([code, value]);
6809
6811
  if (code === 8) current.layer = value;
6810
6812
  else current.data.set(code, value);
6811
6813
  }
6812
6814
  }
6813
6815
  return entities;
6814
6816
  }
6815
- function getNum(data, code, fallback = 0) {
6816
- const v = data.get(code);
6817
- if (v === void 0) return fallback;
6818
- const n = parseFloat(v);
6817
+ function num(value, fallback = 0) {
6818
+ if (value === void 0) return fallback;
6819
+ const n = parseFloat(value);
6819
6820
  return isNaN(n) ? fallback : n;
6820
6821
  }
6821
- function entityToEdge(entity) {
6822
- const { type, data } = entity;
6823
- const kernel = getKernel();
6824
- if (type === "LINE") return kernel.makeLineEdge([
6825
- getNum(data, 10),
6826
- getNum(data, 20),
6827
- getNum(data, 30)
6828
- ], [
6829
- getNum(data, 11),
6830
- getNum(data, 21),
6831
- getNum(data, 31)
6822
+ function getNum(data, code, fallback = 0) {
6823
+ return num(data.get(code), fallback);
6824
+ }
6825
+ /** LWPOLYLINE vertices: each 10 starts one and its 20 and 42 follow; 38 is the elevation. */
6826
+ function lwVertices(entity) {
6827
+ const z = getNum(entity.data, 38);
6828
+ const out = [];
6829
+ for (const [code, value] of entity.pairs) {
6830
+ const last = out[out.length - 1];
6831
+ if (code === 10) out.push({
6832
+ point: [
6833
+ num(value),
6834
+ 0,
6835
+ z
6836
+ ],
6837
+ bulge: 0
6838
+ });
6839
+ else if (code === 20 && last) last.point[1] = num(value);
6840
+ else if (code === 42 && last) last.bulge = num(value);
6841
+ }
6842
+ return out;
6843
+ }
6844
+ /**
6845
+ * The DXF R12 polyline: a POLYLINE header, its VERTEX entities, then SEQEND. They arrive as
6846
+ * separate entities, so the header gathers the vertices that follow it.
6847
+ */
6848
+ function gatherPolylines(entities) {
6849
+ const out = [];
6850
+ for (let i = 0; i < entities.length; i++) {
6851
+ const e = entities[i];
6852
+ if (e === void 0) continue;
6853
+ if (e.type !== "POLYLINE") {
6854
+ if (e.type !== "VERTEX" && e.type !== "SEQEND") out.push(e);
6855
+ continue;
6856
+ }
6857
+ const vertices = [];
6858
+ let j = i + 1;
6859
+ for (; j < entities.length && entities[j]?.type === "VERTEX"; j++) {
6860
+ const v = entities[j];
6861
+ if (v === void 0) continue;
6862
+ vertices.push([10, v.data.get(10) ?? "0"], [20, v.data.get(20) ?? "0"], [30, v.data.get(30) ?? "0"], [42, v.data.get(42) ?? "0"]);
6863
+ }
6864
+ if (entities[j]?.type === "SEQEND") j++;
6865
+ const own = e.pairs.filter(([code]) => code !== 10 && code !== 20 && code !== 30);
6866
+ out.push({
6867
+ ...e,
6868
+ pairs: [...own, ...vertices]
6869
+ });
6870
+ i = j - 1;
6871
+ }
6872
+ return out;
6873
+ }
6874
+ function polyVertices(entity) {
6875
+ if (entity.type === "LWPOLYLINE") return lwVertices(entity);
6876
+ const out = [];
6877
+ const p = entity.pairs;
6878
+ for (let k = 0; k < p.length; k++) {
6879
+ if (p[k]?.[0] !== 10) continue;
6880
+ out.push({
6881
+ point: [
6882
+ num(p[k]?.[1]),
6883
+ num(p[k + 1]?.[1]),
6884
+ num(p[k + 2]?.[1])
6885
+ ],
6886
+ bulge: num(p[k + 3]?.[1])
6887
+ });
6888
+ }
6889
+ return out;
6890
+ }
6891
+ var JOIN_TOL = 1e-7;
6892
+ var TURN = 2 * Math.PI;
6893
+ function cross(a, b) {
6894
+ return [
6895
+ a[1] * b[2] - a[2] * b[1],
6896
+ a[2] * b[0] - a[0] * b[2],
6897
+ a[0] * b[1] - a[1] * b[0]
6898
+ ];
6899
+ }
6900
+ function unit(v) {
6901
+ const l = Math.hypot(v[0], v[1], v[2]) || 1;
6902
+ return [
6903
+ v[0] / l,
6904
+ v[1] / l,
6905
+ v[2] / l
6906
+ ];
6907
+ }
6908
+ /**
6909
+ * The entity's object coordinate system, from its extrusion direction (210/220/230), by DXF's
6910
+ * arbitrary axis algorithm. Planar entities (circles, arcs, 2D polylines) store their points in
6911
+ * it; the default extrusion +Z makes it the world frame.
6912
+ */
6913
+ function ocsOf(data) {
6914
+ const normal = unit([
6915
+ getNum(data, 210),
6916
+ getNum(data, 220),
6917
+ getNum(data, 230, 1)
6832
6918
  ]);
6833
- if (type === "CIRCLE") return kernel.makeCircleEdge([
6834
- getNum(data, 10),
6835
- getNum(data, 20),
6836
- getNum(data, 30)
6837
- ], [
6919
+ if (normal[0] === 0 && normal[1] === 0 && normal[2] > 0) return {
6920
+ normal: [
6921
+ 0,
6922
+ 0,
6923
+ 1
6924
+ ],
6925
+ identity: true,
6926
+ toWorld: (p) => p
6927
+ };
6928
+ const ax = unit(cross(Math.abs(normal[0]) < 1 / 64 && Math.abs(normal[1]) < 1 / 64 ? [
6929
+ 0,
6930
+ 1,
6931
+ 0
6932
+ ] : [
6838
6933
  0,
6839
6934
  0,
6840
6935
  1
6841
- ], getNum(data, 40));
6842
- if (type === "ARC") {
6843
- const startAngle = getNum(data, 50) * Math.PI / 180;
6844
- const endAngle = getNum(data, 51) * Math.PI / 180;
6845
- return kernel.makeCircleArc([
6846
- getNum(data, 10),
6847
- getNum(data, 20),
6848
- getNum(data, 30)
6849
- ], [
6936
+ ], normal));
6937
+ const ay = unit(cross(normal, ax));
6938
+ return {
6939
+ normal,
6940
+ identity: false,
6941
+ toWorld: ([x, y, z]) => [
6942
+ ax[0] * x + ay[0] * y + normal[0] * z,
6943
+ ax[1] * x + ay[1] * y + normal[1] * z,
6944
+ ax[2] * x + ay[2] * y + normal[2] * z
6945
+ ]
6946
+ };
6947
+ }
6948
+ function apart(a, b) {
6949
+ return Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]) > JOIN_TOL;
6950
+ }
6951
+ function linePiece(a, b) {
6952
+ return {
6953
+ start: a,
6954
+ end: b,
6955
+ build: () => getKernel().makeLineEdge(a, b)
6956
+ };
6957
+ }
6958
+ /**
6959
+ * An ARC entity about OCS center `c`, counterclockwise from angle `from` through `sweep` (0, 2π].
6960
+ * In the default OCS, which is most files, it's built from its center and angles, which stays
6961
+ * exact for a shallow arc. In a rotated OCS, whose in-plane axes the kernel doesn't share, it goes
6962
+ * through three points on it, or is a line when its sagitta is under the tolerance.
6963
+ */
6964
+ function arcPiece(c, r, from, sweep, ocs) {
6965
+ const on = (t) => ocs.toWorld([
6966
+ c[0] + r * Math.cos(t),
6967
+ c[1] + r * Math.sin(t),
6968
+ c[2]
6969
+ ]);
6970
+ const start = on(from);
6971
+ const end = on(from + sweep);
6972
+ if (ocs.identity) return {
6973
+ start,
6974
+ end,
6975
+ build: () => getKernel().makeCircleArc(c, [
6976
+ 0,
6977
+ 0,
6978
+ 1
6979
+ ], r, from, from + sweep)
6980
+ };
6981
+ if (r * (1 - Math.cos(sweep / 2)) <= JOIN_TOL) return linePiece(start, end);
6982
+ const mid = on(from + sweep / 2);
6983
+ return {
6984
+ start,
6985
+ end,
6986
+ build: () => getKernel().makeArcEdge(start, mid, end)
6987
+ };
6988
+ }
6989
+ /**
6990
+ * A polyline segment in its OCS: straight, or the arc a bulge describes. A bulge is tan(θ/4) of
6991
+ * the arc's included angle, counterclockwise when positive, so the arc's midpoint lies the sagitta
6992
+ * (bulge × half the chord) off the chord's midpoint, to its right for a positive bulge. The arc
6993
+ * goes through the supplied vertices exactly, so it meets its neighbours; one whose sagitta is
6994
+ * under the tolerance is a line to the kernel and is built as one.
6995
+ */
6996
+ function segment(a, b, bulge, ocs) {
6997
+ const dx = b[0] - a[0];
6998
+ const dy = b[1] - a[1];
6999
+ const d = Math.hypot(dx, dy);
7000
+ const s = bulge * d / 2;
7001
+ if (Math.abs(s) <= JOIN_TOL) return linePiece(ocs.toWorld(a), ocs.toWorld(b));
7002
+ const mid = [
7003
+ (a[0] + b[0]) / 2 + dy / d * s,
7004
+ (a[1] + b[1]) / 2 - dx / d * s,
7005
+ a[2]
7006
+ ];
7007
+ const [wa, wm, wb] = [
7008
+ ocs.toWorld(a),
7009
+ ocs.toWorld(mid),
7010
+ ocs.toWorld(b)
7011
+ ];
7012
+ return {
7013
+ start: wa,
7014
+ end: wb,
7015
+ build: () => getKernel().makeArcEdge(wa, wm, wb)
7016
+ };
7017
+ }
7018
+ var CLOSED = 1;
7019
+ var POLYLINE_3D = 8;
7020
+ var MESH_FORMS = 80;
7021
+ function polylinePieces(entity) {
7022
+ const flags = getNum(entity.data, 70);
7023
+ if (entity.type === "POLYLINE" && (flags & MESH_FORMS) !== 0) return [];
7024
+ const is3d = entity.type === "POLYLINE" && (flags & POLYLINE_3D) !== 0;
7025
+ const ocs = is3d ? {
7026
+ normal: [
6850
7027
  0,
6851
7028
  0,
6852
7029
  1
6853
- ], getNum(data, 40), startAngle, endAngle);
7030
+ ],
7031
+ identity: true,
7032
+ toWorld: (p) => p
7033
+ } : ocsOf(entity.data);
7034
+ const elevation = entity.type === "POLYLINE" && !is3d ? getNum(entity.data, 30) : void 0;
7035
+ const vertices = polyVertices(entity).map((v) => elevation === void 0 ? v : {
7036
+ ...v,
7037
+ point: [
7038
+ v.point[0],
7039
+ v.point[1],
7040
+ elevation
7041
+ ]
7042
+ });
7043
+ const closed = (flags & CLOSED) === CLOSED;
7044
+ const pieces = [];
7045
+ const count = closed ? vertices.length : vertices.length - 1;
7046
+ for (let k = 0; k < count; k++) {
7047
+ const a = vertices[k];
7048
+ const b = vertices[(k + 1) % vertices.length];
7049
+ if (!a || !b || !apart(a.point, b.point)) continue;
7050
+ pieces.push(segment(a.point, b.point, is3d ? 0 : a.bulge, ocs));
7051
+ }
7052
+ return pieces;
7053
+ }
7054
+ function entityToPieces(entity) {
7055
+ const { type, data } = entity;
7056
+ if (type === "LINE") {
7057
+ const start = [
7058
+ getNum(data, 10),
7059
+ getNum(data, 20),
7060
+ getNum(data, 30)
7061
+ ];
7062
+ const end = [
7063
+ getNum(data, 11),
7064
+ getNum(data, 21),
7065
+ getNum(data, 31)
7066
+ ];
7067
+ return apart(start, end) ? [linePiece(start, end)] : [];
6854
7068
  }
7069
+ if (type === "CIRCLE" || type === "ARC") {
7070
+ const ocs = ocsOf(data);
7071
+ const c = [
7072
+ getNum(data, 10),
7073
+ getNum(data, 20),
7074
+ getNum(data, 30)
7075
+ ];
7076
+ const r = getNum(data, 40);
7077
+ if (!(r > 0) || !Number.isFinite(r)) return [];
7078
+ if (type === "CIRCLE") {
7079
+ const center = ocs.toWorld(c);
7080
+ const at = ocs.toWorld([
7081
+ c[0] + r,
7082
+ c[1],
7083
+ c[2]
7084
+ ]);
7085
+ return [{
7086
+ start: at,
7087
+ end: at,
7088
+ build: () => getKernel().makeCircleEdge(center, ocs.normal, r)
7089
+ }];
7090
+ }
7091
+ const from = getNum(data, 50) * Math.PI / 180;
7092
+ const to = getNum(data, 51) * Math.PI / 180;
7093
+ if (!Number.isFinite(from) || !Number.isFinite(to)) return [];
7094
+ let sweep = (to - from) % TURN;
7095
+ if (sweep <= 0) sweep += TURN;
7096
+ return [arcPiece(c, r, from % TURN, sweep, ocs)];
7097
+ }
7098
+ if (type === "LWPOLYLINE" || type === "POLYLINE") return polylinePieces(entity);
7099
+ return [];
7100
+ }
7101
+ /** Gives endpoints within JOIN_TOL of each other one id, by a grid of JOIN_TOL cells. */
7102
+ function pointIds() {
7103
+ const cells = /* @__PURE__ */ new Map();
7104
+ let next = 0;
7105
+ return (p) => {
7106
+ const c = p.map((v) => Math.floor(v / JOIN_TOL));
7107
+ for (let dx = -1; dx <= 1; dx++) for (let dy = -1; dy <= 1; dy++) for (let dz = -1; dz <= 1; dz++) {
7108
+ const hit = cells.get(`${(c[0] ?? 0) + dx},${(c[1] ?? 0) + dy},${(c[2] ?? 0) + dz}`)?.find((e) => !apart(e.p, p));
7109
+ if (hit) return hit.id;
7110
+ }
7111
+ const key = c.join(",");
7112
+ const id = next++;
7113
+ const cell = cells.get(key);
7114
+ if (cell) cell.push({
7115
+ p,
7116
+ id
7117
+ });
7118
+ else cells.set(key, [{
7119
+ p,
7120
+ id
7121
+ }]);
7122
+ return id;
7123
+ };
7124
+ }
7125
+ /** The pieces in connected chains, each in walking order, so every chain makes one wire. */
7126
+ function chainPieces(pieces) {
7127
+ const idOf = pointIds();
7128
+ const ends = pieces.map((p) => [idOf(p.start), idOf(p.end)]);
7129
+ const at = /* @__PURE__ */ new Map();
7130
+ ends.forEach(([s, e], i) => {
7131
+ for (const id of s === e ? [s] : [s, e]) {
7132
+ const list = at.get(id);
7133
+ if (list) list.push(i);
7134
+ else at.set(id, [i]);
7135
+ }
7136
+ });
7137
+ const used = /* @__PURE__ */ new Set();
7138
+ const cursor = /* @__PURE__ */ new Map();
7139
+ const step = (tip) => {
7140
+ const list = at.get(tip) ?? [];
7141
+ let c = cursor.get(tip) ?? 0;
7142
+ while (c < list.length && used.has(list[c] ?? -1)) c++;
7143
+ cursor.set(tip, c + 1);
7144
+ const i = list[c];
7145
+ if (i === void 0) return void 0;
7146
+ used.add(i);
7147
+ const [s, e] = ends[i] ?? [tip, tip];
7148
+ return {
7149
+ i,
7150
+ tip: s === tip ? e : s
7151
+ };
7152
+ };
7153
+ const chains = [];
7154
+ pieces.forEach((first, i) => {
7155
+ if (used.has(i)) return;
7156
+ used.add(i);
7157
+ const chain = [first];
7158
+ const [s, e] = ends[i] ?? [0, 0];
7159
+ for (const [dir, from] of [[1, e], [-1, s]]) for (let hop = step(from); hop; hop = step(hop.tip)) {
7160
+ const piece = pieces[hop.i];
7161
+ if (!piece) continue;
7162
+ if (dir === 1) chain.push(piece);
7163
+ else chain.unshift(piece);
7164
+ }
7165
+ chains.push(chain);
7166
+ });
7167
+ return chains;
6855
7168
  }
6856
7169
  /**
6857
7170
  * Import a DXF file from a Blob, returning kernel wires.
6858
7171
  *
6859
- * Parses ASCII DXF LINE, CIRCLE, and ARC entities.
6860
- * Edges are assembled into wires using `BRepBuilderAPI_MakeWire`.
7172
+ * Parses ASCII DXF LINE, CIRCLE, ARC, LWPOLYLINE and R12 POLYLINE entities, polyline bulges
7173
+ * included, in world coordinates (planar entities are mapped out of their object coordinate
7174
+ * system). Polygon and polyface meshes are skipped. Edges that meet end to end become one wire,
7175
+ * so disconnected outlines come back as separate wires.
6861
7176
  *
6862
7177
  * @param blob - A Blob containing ASCII DXF data.
6863
7178
  * @param options - Optional import settings (layer filter).
@@ -6870,22 +7185,28 @@ async function importDXF(blob, options) {
6870
7185
  } catch (cause) {
6871
7186
  return err(ioError(BrepErrorCode.DXF_IMPORT_FAILED, "Failed to read DXF blob", cause));
6872
7187
  }
6873
- const allEntities = parseEntities(text);
6874
- const entities = options?.layer !== void 0 ? allEntities.filter((e) => e.layer === options.layer) : allEntities;
6875
- if (entities.length === 0) return ok([]);
7188
+ const allEntities = gatherPolylines(parseEntities(text));
7189
+ const pieces = (options?.layer !== void 0 ? allEntities.filter((e) => e.layer === options.layer) : allEntities).flatMap(entityToPieces);
7190
+ if (pieces.length === 0) return ok([]);
7191
+ const kernel = getKernel();
6876
7192
  const edges = [];
7193
+ const wires = [];
6877
7194
  try {
6878
- for (const entity of entities) {
6879
- const edge = entityToEdge(entity);
6880
- if (edge !== void 0) edges.push(edge);
7195
+ for (const chain of chainPieces(pieces)) {
7196
+ const chainEdges = [];
7197
+ for (const p of chain) {
7198
+ const edge = p.build();
7199
+ edges.push(edge);
7200
+ chainEdges.push(edge);
7201
+ }
7202
+ wires.push(createWire(kernel.makeWire(chainEdges)));
6881
7203
  }
6882
- if (edges.length === 0) return ok([]);
6883
- const wire = getKernel().makeWire(edges);
6884
- return ok([createWire(wire)]);
7204
+ return ok(wires);
6885
7205
  } catch (cause) {
7206
+ for (const w of wires) w[Symbol.dispose]();
6886
7207
  return err(ioError(BrepErrorCode.DXF_IMPORT_FAILED, "Failed to convert DXF entities to geometry", cause));
6887
7208
  } finally {
6888
- for (const edge of edges) edge.delete();
7209
+ for (const edge of edges) kernel.dispose(edge);
6889
7210
  }
6890
7211
  }
6891
7212
  // src/io/ioUtils.ts
@@ -1,8 +1,8 @@
1
- import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-BCy8JI0O.js";
1
+ import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-Db3yAgTO.js";
2
2
  import { E as ok, P as unwrap, d as validationError, g as err } from "./errors-CUsZRWJ7.js";
3
- import { s as getEdges } from "./topologyQueryFns-Clkdolgd.js";
3
+ import { s as getEdges } from "./topologyQueryFns-BYXQ2Kkn.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-De7CbEeQ.js";
5
+ import { t as clone } from "./shapeFns-BTfhLPET.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-CNQn1x5H.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-HDVHzNk1.cjs");
2
2
  const require_errors = require("./errors-B9r_Dzs1.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BwhwOtxv.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-BJ5U4AmO.cjs");
4
4
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
5
- const require_shapeFns = require("./shapeFns-CJrIL2CG.cjs");
5
+ const require_shapeFns = require("./shapeFns-CREKqmcG.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-CNQn1x5H.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-HDVHzNk1.cjs");
3
3
  const require_bug = require("./bug-CBcpIPuf.cjs");
4
4
  const require_errors = require("./errors-B9r_Dzs1.cjs");
5
- const require_validityTypes = require("./validityTypes-B_6gRPPO.cjs");
5
+ const require_validityTypes = require("./validityTypes-C2l1ryPq.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-BCy8JI0O.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-Db3yAgTO.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-CUsZRWJ7.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-txYFYYN6.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-ClsRW650.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-CcZp3tLI.js";
3
+ import { p as distance2d, u as angle2d, v as samePoint } from "./helpers-BhBnVALd.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-BIpWypkW.cjs");
3
+ const require_helpers = require("./helpers-BjVuQMLI.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
- const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-HDVHzNk1.cjs");
2
2
  const require_errors = require("./errors-B9r_Dzs1.cjs");
3
3
  // src/topology/curveFns.ts
4
4
  /**