brepjs 18.6.1 → 18.14.3

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 (652) hide show
  1. package/README.md +6 -0
  2. package/dist/{sketching/sketcher2d.d.ts → 2d/blueprints/baseSketcher2d.d.ts} +4 -91
  3. package/dist/2d/blueprints/blueprint.d.ts +0 -1
  4. package/dist/2d/blueprints/blueprintApproximations.d.ts +0 -1
  5. package/dist/2d/blueprints/blueprintCustomCorners.d.ts +0 -1
  6. package/dist/2d/blueprints/blueprintFns.d.ts +0 -1
  7. package/dist/2d/blueprints/blueprintOffset.d.ts +0 -1
  8. package/dist/2d/blueprints/blueprintSketcher.d.ts +29 -0
  9. package/dist/2d/blueprints/blueprints.d.ts +0 -1
  10. package/dist/2d/blueprints/boolean2D.d.ts +0 -1
  11. package/dist/2d/blueprints/booleanHelpers.d.ts +0 -1
  12. package/dist/2d/blueprints/booleanOperations.d.ts +0 -1
  13. package/dist/2d/blueprints/cannedBlueprints.d.ts +0 -1
  14. package/dist/2d/blueprints/compoundBlueprint.d.ts +0 -1
  15. package/dist/{sketching → 2d/blueprints}/ellipseUtils.d.ts +19 -2
  16. package/dist/{sketching/sketcherlib.d.ts → 2d/blueprints/genericSketcher.d.ts} +1 -20
  17. package/dist/2d/blueprints/index.d.ts +0 -1
  18. package/dist/2d/blueprints/intersectionSegments.d.ts +0 -1
  19. package/dist/2d/blueprints/lib.d.ts +0 -1
  20. package/dist/2d/blueprints/segmentAssembly.d.ts +0 -1
  21. package/dist/2d/blueprints/svg.d.ts +0 -1
  22. package/dist/2d/curve2dGeometryFns.d.ts +0 -1
  23. package/dist/2d/curves.d.ts +0 -1
  24. package/dist/2d/lib/approximations.d.ts +0 -1
  25. package/dist/2d/lib/boundingBox2d.d.ts +0 -1
  26. package/dist/2d/lib/curve2D.d.ts +0 -1
  27. package/dist/2d/lib/curve2dFns.d.ts +0 -1
  28. package/dist/2d/lib/customCorners.d.ts +0 -1
  29. package/dist/2d/lib/definitions.d.ts +0 -1
  30. package/dist/2d/lib/index.d.ts +0 -1
  31. package/dist/2d/lib/intersections.d.ts +0 -1
  32. package/dist/2d/lib/makeCurves.d.ts +0 -1
  33. package/dist/2d/lib/offset.d.ts +0 -1
  34. package/dist/2d/lib/precision.d.ts +0 -1
  35. package/dist/2d/lib/stitching.d.ts +0 -1
  36. package/dist/2d/lib/svgPath.d.ts +0 -1
  37. package/dist/2d/lib/utils.d.ts +0 -1
  38. package/dist/2d/lib/vectorOperations.d.ts +0 -1
  39. package/dist/2d.cjs +19 -18
  40. package/dist/2d.d.ts +0 -1
  41. package/dist/2d.js +6 -5
  42. package/dist/{blueprint-C5LxqHCa.cjs → blueprint-B8ogGJiQ.cjs} +6 -6
  43. package/dist/{blueprint-CBairprN.js → blueprint-Dv45Evnu.js} +6 -6
  44. package/dist/{blueprintFns-CwbDuLxf.cjs → blueprintFns-BK3FYYjO.cjs} +3 -3
  45. package/dist/{blueprintFns-D8ST0Cf4.js → blueprintFns-a9C2g8_E.js} +2 -2
  46. package/dist/{boolean2D-DxZ3Kwlq.cjs → blueprintSketcher-Bei866Bt.cjs} +53 -1373
  47. package/dist/{boolean2D-A5u9tJYl.js → blueprintSketcher-xDsl9GXO.js} +59 -1307
  48. package/dist/boolean2D-DGuiEJHA.cjs +902 -0
  49. package/dist/boolean2D-Z7P0c012.js +855 -0
  50. package/dist/{booleanFns-DjZF4MJ5.js → booleanFns-CRa80qMX.js} +5 -5
  51. package/dist/{booleanFns-DWQMtFDN.cjs → booleanFns-qmgMQyDl.cjs} +8 -8
  52. package/dist/brepjs.cjs +742 -92
  53. package/dist/brepjs.js +662 -22
  54. package/dist/cameraFns-1y1NyACI.cjs +315 -0
  55. package/dist/cameraFns-CUzI5RKS.js +274 -0
  56. package/dist/core/constants.d.ts +0 -1
  57. package/dist/core/curve2dHandle.d.ts +0 -1
  58. package/dist/core/dimensionTypes.d.ts +0 -1
  59. package/dist/core/disposal.d.ts +0 -1
  60. package/dist/core/errors.d.ts +0 -1
  61. package/dist/core/kernelBoundary.d.ts +0 -1
  62. package/dist/core/kernelCall.d.ts +0 -1
  63. package/dist/core/kernelErrorTranslation.d.ts +0 -1
  64. package/dist/core/planeOps.d.ts +0 -1
  65. package/dist/core/planeTypes.d.ts +0 -1
  66. package/dist/core/result.d.ts +0 -1
  67. package/dist/core/shapeTypeCache.d.ts +0 -1
  68. package/dist/core/shapeTypes.d.ts +0 -1
  69. package/dist/core/typeDiscriminants.d.ts +0 -1
  70. package/dist/core/types.d.ts +0 -1
  71. package/dist/core/validityTypes.d.ts +0 -1
  72. package/dist/core/vecOps.d.ts +0 -1
  73. package/dist/core.cjs +1 -1
  74. package/dist/core.d.ts +0 -1
  75. package/dist/core.js +1 -1
  76. package/dist/{cornerFinder-B2CpcVV9.cjs → cornerFinder-CC8EBRCR.cjs} +2 -2
  77. package/dist/{cornerFinder-DGvOt2ab.js → cornerFinder-Dix2ghke.js} +2 -2
  78. package/dist/{curveFns-DZYE3BGO.js → curveFns-B4tWuinR.js} +1 -1
  79. package/dist/{curveFns-B8KJKr8-.cjs → curveFns-CD20-4fM.cjs} +1 -1
  80. package/dist/{drawFns-Bl865kUL.js → drawFns-BsarLfUN.js} +155 -762
  81. package/dist/{drawFns-h8gJBx-H.cjs → drawFns-LlOZoFyp.cjs} +193 -976
  82. package/dist/{extrudeFns-O2s-SFf-.js → extrudeFns-7pE8dIWz.js} +1 -1
  83. package/dist/{extrudeFns-BlJKAnW8.cjs → extrudeFns-DD36mWKv.cjs} +1 -1
  84. package/dist/faceFns-BFWz17_E.js +218 -0
  85. package/dist/faceFns-DP7i60yJ.cjs +343 -0
  86. package/dist/gear/gearFns.d.ts +129 -0
  87. package/dist/gear/gearMath.d.ts +88 -0
  88. package/dist/gear/gearProfile.d.ts +16 -0
  89. package/dist/gear/index.d.ts +3 -0
  90. package/dist/{helpers-C3smxDtp.cjs → helpers-Cyj6gaqy.cjs} +11 -10
  91. package/dist/{helpers-DL1f3xp0.js → helpers-vV2ONZwD.js} +6 -5
  92. package/dist/{historyFns-CD9qXw5j.js → historyFns-DGb61ETW.js} +4 -4
  93. package/dist/{historyFns-DBdWeo7Y.cjs → historyFns-DfyrPjnK.cjs} +4 -4
  94. package/dist/{importFns-5tcN3-fK.cjs → importFns-C-p0vl_h.cjs} +3 -3
  95. package/dist/{importFns-B1p3FiGS.js → importFns-Ci-L2iB3.js} +3 -3
  96. package/dist/index.d.ts +16 -8
  97. package/dist/io/dxfExportFns.d.ts +0 -1
  98. package/dist/io/dxfImportFns.d.ts +0 -1
  99. package/dist/io/gltfExportFns.d.ts +0 -1
  100. package/dist/io/gltfImportFns.d.ts +0 -1
  101. package/dist/io/importFns.d.ts +0 -1
  102. package/dist/io/ioUtils.d.ts +0 -1
  103. package/dist/io/objExportFns.d.ts +0 -1
  104. package/dist/io/objImportFns.d.ts +0 -1
  105. package/dist/io/stepConfigFns.d.ts +0 -1
  106. package/dist/io/svgImportFns.d.ts +0 -1
  107. package/dist/io/threemfExportFns.d.ts +0 -1
  108. package/dist/io/threemfImportFns.d.ts +0 -1
  109. package/dist/io.cjs +2 -2
  110. package/dist/io.d.ts +0 -1
  111. package/dist/io.js +2 -2
  112. package/dist/kernel/brepkit/booleanOps.d.ts +23 -1
  113. package/dist/kernel/brepkit/brepkitAdapter.d.ts +21 -408
  114. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +0 -1
  115. package/dist/kernel/brepkit/constructionOps.d.ts +51 -1
  116. package/dist/kernel/brepkit/evolutionOps.d.ts +34 -3
  117. package/dist/kernel/brepkit/geometryOps.d.ts +63 -2
  118. package/dist/kernel/brepkit/helpers.d.ts +6 -1
  119. package/dist/kernel/brepkit/internalOps.d.ts +0 -1
  120. package/dist/kernel/brepkit/ioOps.d.ts +47 -9
  121. package/dist/kernel/brepkit/kernel2dOps.d.ts +113 -1
  122. package/dist/kernel/brepkit/measureOps.d.ts +39 -1
  123. package/dist/kernel/brepkit/meshOps.d.ts +7 -1
  124. package/dist/kernel/brepkit/modifierOps.d.ts +15 -1
  125. package/dist/kernel/brepkit/repairOps.d.ts +14 -1
  126. package/dist/kernel/brepkit/sketchOps.d.ts +3 -1
  127. package/dist/kernel/brepkit/sweepOps.d.ts +37 -1
  128. package/dist/kernel/brepkit/topologyOps.d.ts +16 -1
  129. package/dist/kernel/brepkit/transformOps.d.ts +18 -1
  130. package/dist/kernel/geometry2d.d.ts +0 -1
  131. package/dist/kernel/index.d.ts +0 -1
  132. package/dist/kernel/interfaces/booleanOps.d.ts +0 -1
  133. package/dist/kernel/interfaces/builderOps.d.ts +0 -1
  134. package/dist/kernel/interfaces/core.d.ts +0 -1
  135. package/dist/kernel/interfaces/curveOps.d.ts +0 -1
  136. package/dist/kernel/interfaces/evolutionOps.d.ts +0 -1
  137. package/dist/kernel/interfaces/index.d.ts +0 -1
  138. package/dist/kernel/interfaces/ioOps.d.ts +0 -1
  139. package/dist/kernel/interfaces/measureOps.d.ts +0 -1
  140. package/dist/kernel/interfaces/meshOps.d.ts +0 -1
  141. package/dist/kernel/interfaces/modifierOps.d.ts +0 -1
  142. package/dist/kernel/interfaces/primitiveOps.d.ts +0 -1
  143. package/dist/kernel/interfaces/repairOps.d.ts +0 -1
  144. package/dist/kernel/interfaces/surfaceOps.d.ts +0 -1
  145. package/dist/kernel/interfaces/sweepOps.d.ts +0 -1
  146. package/dist/kernel/interfaces/topologyOps.d.ts +0 -1
  147. package/dist/kernel/interfaces/transformOps.d.ts +0 -1
  148. package/dist/kernel/kernel2dTypes.d.ts +0 -1
  149. package/dist/kernel/occt/advancedOps.d.ts +126 -24
  150. package/dist/kernel/occt/booleanBatchOps.d.ts +0 -1
  151. package/dist/kernel/occt/booleanOps.d.ts +11 -1
  152. package/dist/kernel/occt/booleanPipelineOps.d.ts +10 -1
  153. package/dist/kernel/occt/constructorOps.d.ts +14 -1
  154. package/dist/kernel/occt/curveOps.d.ts +13 -1
  155. package/dist/kernel/occt/defaultAdapter.d.ts +10 -441
  156. package/dist/kernel/occt/evolutionOps.d.ts +0 -1
  157. package/dist/kernel/occt/extendedConstructorOps.d.ts +31 -1
  158. package/dist/kernel/occt/geometryQueryOps.d.ts +40 -1
  159. package/dist/kernel/occt/healingOps.d.ts +6 -1
  160. package/dist/kernel/occt/historyOps.d.ts +17 -1
  161. package/dist/kernel/occt/hullOps.d.ts +14 -1
  162. package/dist/kernel/occt/ioOps.d.ts +9 -1
  163. package/dist/kernel/occt/kernel2dOps.d.ts +113 -1
  164. package/dist/kernel/occt/measureOps.d.ts +19 -1
  165. package/dist/kernel/occt/meshOps.d.ts +5 -1
  166. package/dist/kernel/occt/modifierOps.d.ts +24 -1
  167. package/dist/kernel/occt/nurbsQueryOps.d.ts +5 -1
  168. package/dist/kernel/occt/sweepOps.d.ts +23 -1
  169. package/dist/kernel/occt/topologyOps.d.ts +10 -1
  170. package/dist/kernel/occt/transformOps.d.ts +14 -4
  171. package/dist/kernel/occt/wasmTypes/externals.d.ts +0 -1
  172. package/dist/kernel/occt/wasmTypes/index.d.ts +0 -1
  173. package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts +0 -1
  174. package/dist/kernel/occtWasm/adapterShims.d.ts +0 -1
  175. package/dist/kernel/occtWasm/booleanOps.d.ts +0 -1
  176. package/dist/kernel/occtWasm/constructionOps.d.ts +0 -1
  177. package/dist/kernel/occtWasm/curveOps.d.ts +0 -1
  178. package/dist/kernel/occtWasm/evolutionOps.d.ts +0 -1
  179. package/dist/kernel/occtWasm/helpers.d.ts +0 -1
  180. package/dist/kernel/occtWasm/hullOps.d.ts +0 -1
  181. package/dist/kernel/occtWasm/ioOps.d.ts +0 -1
  182. package/dist/kernel/occtWasm/kernel2dOps.d.ts +0 -1
  183. package/dist/kernel/occtWasm/measureOps.d.ts +0 -1
  184. package/dist/kernel/occtWasm/meshOps.d.ts +0 -1
  185. package/dist/kernel/occtWasm/modifierOps.d.ts +0 -1
  186. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +0 -1
  187. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +0 -1
  188. package/dist/kernel/occtWasm/primitiveOps.d.ts +0 -1
  189. package/dist/kernel/occtWasm/repairOps.d.ts +0 -1
  190. package/dist/kernel/occtWasm/surfaceOps.d.ts +0 -1
  191. package/dist/kernel/occtWasm/sweepOps.d.ts +0 -1
  192. package/dist/kernel/occtWasm/topologyOps.d.ts +0 -1
  193. package/dist/kernel/occtWasm/transformOps.d.ts +0 -1
  194. package/dist/kernel/perfStats.d.ts +0 -1
  195. package/dist/kernel/solverAdapter.d.ts +0 -1
  196. package/dist/kernel/types.d.ts +0 -1
  197. package/dist/{measureFns-CHmy_Inq.cjs → measureFns-6ifSQfJt.cjs} +5 -4
  198. package/dist/{measureFns-CJi8erDL.js → measureFns-Io2nHE1k.js} +3 -2
  199. package/dist/measurement/interferenceFns.d.ts +0 -1
  200. package/dist/measurement/measureCache.d.ts +0 -1
  201. package/dist/measurement/measureFns.d.ts +0 -1
  202. package/dist/measurement/measureTypes.d.ts +0 -1
  203. package/dist/measurement.cjs +1 -1
  204. package/dist/measurement.d.ts +0 -1
  205. package/dist/measurement.js +1 -1
  206. package/dist/{meshFns-t2lR4BDS.cjs → meshFns-BCRVZgPi.cjs} +2 -2
  207. package/dist/{meshFns-BkY1RAoC.js → meshFns-DSdkRFWq.js} +2 -2
  208. package/dist/ns/booleans.d.ts +0 -1
  209. package/dist/ns/construction.d.ts +0 -1
  210. package/dist/ns/ioNs.d.ts +0 -1
  211. package/dist/ns/measurement.d.ts +0 -1
  212. package/dist/ns/modifiers.d.ts +0 -1
  213. package/dist/ns/patterns.d.ts +0 -1
  214. package/dist/ns/primitives.d.ts +0 -1
  215. package/dist/ns/query.d.ts +0 -1
  216. package/dist/ns/transforms.d.ts +0 -1
  217. package/dist/operations/api.d.ts +0 -1
  218. package/dist/operations/assemblyFns.d.ts +0 -1
  219. package/dist/operations/compoundOpsFns.d.ts +0 -1
  220. package/dist/operations/convexHullFns.d.ts +0 -1
  221. package/dist/operations/exporterFns.d.ts +0 -1
  222. package/dist/operations/exporterUtils.d.ts +0 -1
  223. package/dist/operations/exporters.d.ts +0 -1
  224. package/dist/operations/extrudeFns.d.ts +0 -1
  225. package/dist/operations/extrudeUtils.d.ts +0 -1
  226. package/dist/operations/guidedSweepFns.d.ts +0 -1
  227. package/dist/operations/historyFns.d.ts +0 -1
  228. package/dist/operations/loftFns.d.ts +0 -1
  229. package/dist/operations/mateFns.d.ts +0 -1
  230. package/dist/operations/multiSweepFns.d.ts +0 -1
  231. package/dist/operations/patternFns.d.ts +0 -1
  232. package/dist/operations/roofFns.d.ts +0 -1
  233. package/dist/operations/straightSkeleton.d.ts +0 -1
  234. package/dist/operations/sweepFns.d.ts +0 -1
  235. package/dist/operations.cjs +2 -2
  236. package/dist/operations.d.ts +0 -1
  237. package/dist/operations.js +2 -2
  238. package/dist/{primitiveFns-DwhN--zB.cjs → primitiveFns-BH-JQPzh.cjs} +18 -17
  239. package/dist/{primitiveFns-Emvge_71.js → primitiveFns-C1p92ZcD.js} +6 -5
  240. package/dist/projection/cameraFns.d.ts +0 -1
  241. package/dist/projection/makeProjectedEdges.d.ts +0 -1
  242. package/dist/projection/projectionPlanes.d.ts +0 -1
  243. package/dist/projection.cjs +9 -0
  244. package/dist/projection.d.ts +11 -0
  245. package/dist/projection.js +2 -0
  246. package/dist/query/cornerFinder.d.ts +0 -1
  247. package/dist/query/directionUtils.d.ts +0 -1
  248. package/dist/query/edgeFinder.d.ts +0 -1
  249. package/dist/query/faceFinder.d.ts +0 -1
  250. package/dist/query/finderCore.d.ts +0 -1
  251. package/dist/query/finderFns.d.ts +0 -1
  252. package/dist/query/helpers.d.ts +0 -1
  253. package/dist/query/shapeDistanceFilter.d.ts +0 -1
  254. package/dist/query/shapeFinders.d.ts +0 -1
  255. package/dist/query/vertexFinder.d.ts +0 -1
  256. package/dist/query/wireFinder.d.ts +0 -1
  257. package/dist/query.cjs +2 -2
  258. package/dist/query.d.ts +0 -1
  259. package/dist/query.js +2 -2
  260. package/dist/result.d.ts +0 -1
  261. package/dist/{shapeFns-CObBAJoQ.cjs → shapeFns-B7x82K11.cjs} +15 -15
  262. package/dist/{shapeFns-DThjHtJI.js → shapeFns-BhZ9weSI.js} +2 -2
  263. package/dist/shapeRef.cjs +1 -1
  264. package/dist/shapeRef.d.ts +0 -1
  265. package/dist/shapeRef.js +1 -1
  266. package/dist/{shapeRefFns-WMhIFuGW.js → shapeRefFns-B9PsEqWf.js} +4 -3
  267. package/dist/{shapeRefFns-I0MHjRAq.cjs → shapeRefFns-wDY88A8u.cjs} +6 -5
  268. package/dist/{shapeTypes-8vB31RfA.cjs → shapeTypes-BTt_LLbk.cjs} +6928 -7750
  269. package/dist/{shapeTypes-AyL8vv_O.js → shapeTypes-C--1jaT1.js} +6618 -7440
  270. package/dist/sketching/cannedSketches.d.ts +0 -1
  271. package/dist/sketching/compoundSketch.d.ts +8 -7
  272. package/dist/sketching/draw3d.d.ts +1 -2
  273. package/dist/sketching/drawFns.d.ts +4 -3
  274. package/dist/sketching/{draw.d.ts → drawing.d.ts} +2 -127
  275. package/dist/sketching/drawingFactories.d.ts +94 -0
  276. package/dist/sketching/drawingPen.d.ts +34 -0
  277. package/dist/sketching/faceSketcher.d.ts +52 -0
  278. package/dist/sketching/shortcuts.d.ts +0 -1
  279. package/dist/sketching/sketch.d.ts +64 -10
  280. package/dist/sketching/sketchFns.d.ts +42 -95
  281. package/dist/sketching/sketcher.d.ts +2 -3
  282. package/dist/sketching/sketches.d.ts +5 -6
  283. package/dist/sketching.cjs +19 -18
  284. package/dist/sketching.d.ts +8 -5
  285. package/dist/sketching.js +3 -2
  286. package/dist/{solidBuilders-Djwgx2mj.cjs → solidBuilders-CX_197Xm.cjs} +2 -2
  287. package/dist/{solidBuilders-C7Xp_ikW.js → solidBuilders-Xs7VDMGD.js} +2 -2
  288. package/dist/{surfaceBuilders-BEnsewN9.cjs → surfaceBuilders-CYeTNW33.cjs} +24 -2
  289. package/dist/{surfaceBuilders-Con0IpLf.js → surfaceBuilders-CinmHCbZ.js} +19 -3
  290. package/dist/text/fontRegistry.d.ts +22 -0
  291. package/dist/text/sketchText.d.ts +30 -0
  292. package/dist/text/textBlueprints.d.ts +0 -91
  293. package/dist/text/textMetrics.d.ts +39 -0
  294. package/dist/text.cjs +9 -0
  295. package/dist/text.d.ts +12 -0
  296. package/dist/text.js +3 -0
  297. package/dist/textBlueprints-Do6xNsLt.js +643 -0
  298. package/dist/textBlueprints-oWhiABaY.cjs +800 -0
  299. package/dist/textMetrics-BjJ8sn_e.js +69 -0
  300. package/dist/textMetrics-CUvtglQE.cjs +86 -0
  301. package/dist/topology/adjacencyFns.d.ts +0 -1
  302. package/dist/topology/api.d.ts +0 -1
  303. package/dist/topology/apiTypes.d.ts +0 -1
  304. package/dist/topology/booleanDiagnosticFns.d.ts +0 -1
  305. package/dist/topology/booleanFns.d.ts +0 -1
  306. package/dist/topology/cast.d.ts +0 -1
  307. package/dist/topology/chamferAngleFns.d.ts +0 -1
  308. package/dist/topology/compoundOpsFns.d.ts +0 -1
  309. package/dist/topology/curveBuilders.d.ts +12 -1
  310. package/dist/topology/curveFns.d.ts +0 -1
  311. package/dist/topology/evolutionFns.d.ts +0 -1
  312. package/dist/topology/faceFns.d.ts +0 -1
  313. package/dist/topology/healingFns.d.ts +0 -1
  314. package/dist/topology/hullFns.d.ts +0 -1
  315. package/dist/topology/index.d.ts +0 -1
  316. package/dist/topology/meshCache.d.ts +0 -1
  317. package/dist/topology/meshFns.d.ts +0 -1
  318. package/dist/topology/metadata/colorFns.d.ts +0 -1
  319. package/dist/topology/metadata/faceTagFns.d.ts +0 -1
  320. package/dist/topology/metadata/metadataPropagation.d.ts +0 -1
  321. package/dist/topology/metadata/originTrackingFns.d.ts +0 -1
  322. package/dist/topology/minkowskiFns.d.ts +0 -1
  323. package/dist/topology/modifierFns.d.ts +0 -1
  324. package/dist/topology/nurbsFns.d.ts +0 -1
  325. package/dist/topology/polyhedronFns.d.ts +0 -1
  326. package/dist/topology/positionFns.d.ts +0 -1
  327. package/dist/topology/primitiveFns.d.ts +0 -1
  328. package/dist/topology/shapeBooleans.d.ts +0 -1
  329. package/dist/topology/shapeFns.d.ts +0 -1
  330. package/dist/topology/shapeHelpers.d.ts +0 -1
  331. package/dist/topology/shapeModifiers.d.ts +0 -1
  332. package/dist/topology/shapeRef/index.d.ts +0 -1
  333. package/dist/topology/shapeRef/scoring.d.ts +0 -1
  334. package/dist/topology/shapeRef/shapeRefFns.d.ts +0 -1
  335. package/dist/topology/shapeRef/shapeRefTypes.d.ts +0 -1
  336. package/dist/topology/shapeUtils.d.ts +0 -1
  337. package/dist/topology/solidBuilders.d.ts +0 -1
  338. package/dist/topology/surfaceBuilders.d.ts +0 -1
  339. package/dist/topology/surfaceFns.d.ts +0 -1
  340. package/dist/topology/threeHelpers.d.ts +0 -1
  341. package/dist/topology/topologyQueryFns.d.ts +0 -1
  342. package/dist/topology/transformFns.d.ts +0 -1
  343. package/dist/topology/wrapperFns.d.ts +0 -1
  344. package/dist/topology.cjs +18 -17
  345. package/dist/topology.d.ts +0 -1
  346. package/dist/topology.js +7 -6
  347. package/dist/{faceFns-B1H43mZ_.cjs → topologyQueryFns-BU0qdNJP.cjs} +1 -341
  348. package/dist/{faceFns-acz86gqR.js → topologyQueryFns-Dhf85ZBK.js} +3 -217
  349. package/dist/utils/arrayAccess.d.ts +0 -1
  350. package/dist/utils/bug.d.ts +0 -1
  351. package/dist/utils/ioFilename.d.ts +0 -1
  352. package/dist/utils/precisionRound.d.ts +0 -1
  353. package/dist/utils/range.d.ts +0 -1
  354. package/dist/utils/uuid.d.ts +0 -1
  355. package/dist/utils/vec2d.d.ts +0 -1
  356. package/dist/utils/vec3.d.ts +0 -1
  357. package/dist/utils/zip.d.ts +0 -1
  358. package/dist/vectors.d.ts +0 -1
  359. package/dist/worker/index.d.ts +0 -1
  360. package/dist/worker/protocol.d.ts +0 -1
  361. package/dist/worker/taskQueue.d.ts +0 -1
  362. package/dist/worker/workerClient.d.ts +0 -1
  363. package/dist/worker/workerHandler.d.ts +0 -1
  364. package/dist/worker.cjs +1 -1
  365. package/dist/worker.d.ts +0 -1
  366. package/dist/worker.js +1 -1
  367. package/package.json +35 -14
  368. package/dist/2d/blueprints/blueprint.d.ts.map +0 -1
  369. package/dist/2d/blueprints/blueprintApproximations.d.ts.map +0 -1
  370. package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +0 -1
  371. package/dist/2d/blueprints/blueprintFns.d.ts.map +0 -1
  372. package/dist/2d/blueprints/blueprintOffset.d.ts.map +0 -1
  373. package/dist/2d/blueprints/blueprints.d.ts.map +0 -1
  374. package/dist/2d/blueprints/boolean2D.d.ts.map +0 -1
  375. package/dist/2d/blueprints/booleanHelpers.d.ts.map +0 -1
  376. package/dist/2d/blueprints/booleanOperations.d.ts.map +0 -1
  377. package/dist/2d/blueprints/cannedBlueprints.d.ts.map +0 -1
  378. package/dist/2d/blueprints/compoundBlueprint.d.ts.map +0 -1
  379. package/dist/2d/blueprints/index.d.ts.map +0 -1
  380. package/dist/2d/blueprints/intersectionSegments.d.ts.map +0 -1
  381. package/dist/2d/blueprints/lib.d.ts.map +0 -1
  382. package/dist/2d/blueprints/segmentAssembly.d.ts.map +0 -1
  383. package/dist/2d/blueprints/svg.d.ts.map +0 -1
  384. package/dist/2d/curve2dGeometryFns.d.ts.map +0 -1
  385. package/dist/2d/curves.d.ts.map +0 -1
  386. package/dist/2d/lib/approximations.d.ts.map +0 -1
  387. package/dist/2d/lib/boundingBox2d.d.ts.map +0 -1
  388. package/dist/2d/lib/curve2D.d.ts.map +0 -1
  389. package/dist/2d/lib/curve2dFns.d.ts.map +0 -1
  390. package/dist/2d/lib/customCorners.d.ts.map +0 -1
  391. package/dist/2d/lib/definitions.d.ts.map +0 -1
  392. package/dist/2d/lib/index.d.ts.map +0 -1
  393. package/dist/2d/lib/intersections.d.ts.map +0 -1
  394. package/dist/2d/lib/makeCurves.d.ts.map +0 -1
  395. package/dist/2d/lib/offset.d.ts.map +0 -1
  396. package/dist/2d/lib/precision.d.ts.map +0 -1
  397. package/dist/2d/lib/stitching.d.ts.map +0 -1
  398. package/dist/2d/lib/svgPath.d.ts.map +0 -1
  399. package/dist/2d/lib/utils.d.ts.map +0 -1
  400. package/dist/2d/lib/vectorOperations.d.ts.map +0 -1
  401. package/dist/2d.d.ts.map +0 -1
  402. package/dist/core/constants.d.ts.map +0 -1
  403. package/dist/core/curve2dHandle.d.ts.map +0 -1
  404. package/dist/core/dimensionTypes.d.ts.map +0 -1
  405. package/dist/core/disposal.d.ts.map +0 -1
  406. package/dist/core/errors.d.ts.map +0 -1
  407. package/dist/core/kernelBoundary.d.ts.map +0 -1
  408. package/dist/core/kernelCall.d.ts.map +0 -1
  409. package/dist/core/kernelErrorTranslation.d.ts.map +0 -1
  410. package/dist/core/planeOps.d.ts.map +0 -1
  411. package/dist/core/planeTypes.d.ts.map +0 -1
  412. package/dist/core/result.d.ts.map +0 -1
  413. package/dist/core/shapeTypeCache.d.ts.map +0 -1
  414. package/dist/core/shapeTypes.d.ts.map +0 -1
  415. package/dist/core/typeDiscriminants.d.ts.map +0 -1
  416. package/dist/core/types.d.ts.map +0 -1
  417. package/dist/core/validityTypes.d.ts.map +0 -1
  418. package/dist/core/vecOps.d.ts.map +0 -1
  419. package/dist/core.d.ts.map +0 -1
  420. package/dist/index.d.ts.map +0 -1
  421. package/dist/io/dxfExportFns.d.ts.map +0 -1
  422. package/dist/io/dxfImportFns.d.ts.map +0 -1
  423. package/dist/io/gltfExportFns.d.ts.map +0 -1
  424. package/dist/io/gltfImportFns.d.ts.map +0 -1
  425. package/dist/io/importFns.d.ts.map +0 -1
  426. package/dist/io/ioUtils.d.ts.map +0 -1
  427. package/dist/io/objExportFns.d.ts.map +0 -1
  428. package/dist/io/objImportFns.d.ts.map +0 -1
  429. package/dist/io/stepConfigFns.d.ts.map +0 -1
  430. package/dist/io/svgImportFns.d.ts.map +0 -1
  431. package/dist/io/threemfExportFns.d.ts.map +0 -1
  432. package/dist/io/threemfImportFns.d.ts.map +0 -1
  433. package/dist/io.d.ts.map +0 -1
  434. package/dist/kernel/brepkit/booleanOps.d.ts.map +0 -1
  435. package/dist/kernel/brepkit/brepkitAdapter.d.ts.map +0 -1
  436. package/dist/kernel/brepkit/brepkitWasmTypes.d.ts.map +0 -1
  437. package/dist/kernel/brepkit/constructionOps.d.ts.map +0 -1
  438. package/dist/kernel/brepkit/evolutionOps.d.ts.map +0 -1
  439. package/dist/kernel/brepkit/geometryOps.d.ts.map +0 -1
  440. package/dist/kernel/brepkit/helpers.d.ts.map +0 -1
  441. package/dist/kernel/brepkit/internalOps.d.ts.map +0 -1
  442. package/dist/kernel/brepkit/ioOps.d.ts.map +0 -1
  443. package/dist/kernel/brepkit/kernel2dOps.d.ts.map +0 -1
  444. package/dist/kernel/brepkit/measureOps.d.ts.map +0 -1
  445. package/dist/kernel/brepkit/meshOps.d.ts.map +0 -1
  446. package/dist/kernel/brepkit/modifierOps.d.ts.map +0 -1
  447. package/dist/kernel/brepkit/repairOps.d.ts.map +0 -1
  448. package/dist/kernel/brepkit/sketchOps.d.ts.map +0 -1
  449. package/dist/kernel/brepkit/sweepOps.d.ts.map +0 -1
  450. package/dist/kernel/brepkit/topologyOps.d.ts.map +0 -1
  451. package/dist/kernel/brepkit/transformOps.d.ts.map +0 -1
  452. package/dist/kernel/geometry2d.d.ts.map +0 -1
  453. package/dist/kernel/index.d.ts.map +0 -1
  454. package/dist/kernel/interfaces/booleanOps.d.ts.map +0 -1
  455. package/dist/kernel/interfaces/builderOps.d.ts.map +0 -1
  456. package/dist/kernel/interfaces/core.d.ts.map +0 -1
  457. package/dist/kernel/interfaces/curveOps.d.ts.map +0 -1
  458. package/dist/kernel/interfaces/evolutionOps.d.ts.map +0 -1
  459. package/dist/kernel/interfaces/index.d.ts.map +0 -1
  460. package/dist/kernel/interfaces/ioOps.d.ts.map +0 -1
  461. package/dist/kernel/interfaces/measureOps.d.ts.map +0 -1
  462. package/dist/kernel/interfaces/meshOps.d.ts.map +0 -1
  463. package/dist/kernel/interfaces/modifierOps.d.ts.map +0 -1
  464. package/dist/kernel/interfaces/primitiveOps.d.ts.map +0 -1
  465. package/dist/kernel/interfaces/repairOps.d.ts.map +0 -1
  466. package/dist/kernel/interfaces/surfaceOps.d.ts.map +0 -1
  467. package/dist/kernel/interfaces/sweepOps.d.ts.map +0 -1
  468. package/dist/kernel/interfaces/topologyOps.d.ts.map +0 -1
  469. package/dist/kernel/interfaces/transformOps.d.ts.map +0 -1
  470. package/dist/kernel/kernel2dTypes.d.ts.map +0 -1
  471. package/dist/kernel/occt/advancedOps.d.ts.map +0 -1
  472. package/dist/kernel/occt/booleanBatchOps.d.ts.map +0 -1
  473. package/dist/kernel/occt/booleanOps.d.ts.map +0 -1
  474. package/dist/kernel/occt/booleanPipelineOps.d.ts.map +0 -1
  475. package/dist/kernel/occt/constructorOps.d.ts.map +0 -1
  476. package/dist/kernel/occt/curveOps.d.ts.map +0 -1
  477. package/dist/kernel/occt/defaultAdapter.d.ts.map +0 -1
  478. package/dist/kernel/occt/evolutionOps.d.ts.map +0 -1
  479. package/dist/kernel/occt/extendedConstructorOps.d.ts.map +0 -1
  480. package/dist/kernel/occt/geometryQueryOps.d.ts.map +0 -1
  481. package/dist/kernel/occt/healingOps.d.ts.map +0 -1
  482. package/dist/kernel/occt/historyOps.d.ts.map +0 -1
  483. package/dist/kernel/occt/hullOps.d.ts.map +0 -1
  484. package/dist/kernel/occt/ioOps.d.ts.map +0 -1
  485. package/dist/kernel/occt/kernel2dOps.d.ts.map +0 -1
  486. package/dist/kernel/occt/measureOps.d.ts.map +0 -1
  487. package/dist/kernel/occt/meshOps.d.ts.map +0 -1
  488. package/dist/kernel/occt/modifierOps.d.ts.map +0 -1
  489. package/dist/kernel/occt/nurbsQueryOps.d.ts.map +0 -1
  490. package/dist/kernel/occt/sweepOps.d.ts.map +0 -1
  491. package/dist/kernel/occt/topologyOps.d.ts.map +0 -1
  492. package/dist/kernel/occt/transformOps.d.ts.map +0 -1
  493. package/dist/kernel/occt/wasmTypes/externals.d.ts.map +0 -1
  494. package/dist/kernel/occt/wasmTypes/index.d.ts.map +0 -1
  495. package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts.map +0 -1
  496. package/dist/kernel/occtWasm/adapterShims.d.ts.map +0 -1
  497. package/dist/kernel/occtWasm/booleanOps.d.ts.map +0 -1
  498. package/dist/kernel/occtWasm/constructionOps.d.ts.map +0 -1
  499. package/dist/kernel/occtWasm/curveOps.d.ts.map +0 -1
  500. package/dist/kernel/occtWasm/evolutionOps.d.ts.map +0 -1
  501. package/dist/kernel/occtWasm/helpers.d.ts.map +0 -1
  502. package/dist/kernel/occtWasm/hullOps.d.ts.map +0 -1
  503. package/dist/kernel/occtWasm/ioOps.d.ts.map +0 -1
  504. package/dist/kernel/occtWasm/kernel2dOps.d.ts.map +0 -1
  505. package/dist/kernel/occtWasm/measureOps.d.ts.map +0 -1
  506. package/dist/kernel/occtWasm/meshOps.d.ts.map +0 -1
  507. package/dist/kernel/occtWasm/modifierOps.d.ts.map +0 -1
  508. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts.map +0 -1
  509. package/dist/kernel/occtWasm/occtWasmTypes.d.ts.map +0 -1
  510. package/dist/kernel/occtWasm/primitiveOps.d.ts.map +0 -1
  511. package/dist/kernel/occtWasm/repairOps.d.ts.map +0 -1
  512. package/dist/kernel/occtWasm/surfaceOps.d.ts.map +0 -1
  513. package/dist/kernel/occtWasm/sweepOps.d.ts.map +0 -1
  514. package/dist/kernel/occtWasm/topologyOps.d.ts.map +0 -1
  515. package/dist/kernel/occtWasm/transformOps.d.ts.map +0 -1
  516. package/dist/kernel/perfStats.d.ts.map +0 -1
  517. package/dist/kernel/solverAdapter.d.ts.map +0 -1
  518. package/dist/kernel/types.d.ts.map +0 -1
  519. package/dist/measurement/interferenceFns.d.ts.map +0 -1
  520. package/dist/measurement/measureCache.d.ts.map +0 -1
  521. package/dist/measurement/measureFns.d.ts.map +0 -1
  522. package/dist/measurement/measureTypes.d.ts.map +0 -1
  523. package/dist/measurement.d.ts.map +0 -1
  524. package/dist/ns/booleans.d.ts.map +0 -1
  525. package/dist/ns/construction.d.ts.map +0 -1
  526. package/dist/ns/ioNs.d.ts.map +0 -1
  527. package/dist/ns/measurement.d.ts.map +0 -1
  528. package/dist/ns/modifiers.d.ts.map +0 -1
  529. package/dist/ns/patterns.d.ts.map +0 -1
  530. package/dist/ns/primitives.d.ts.map +0 -1
  531. package/dist/ns/query.d.ts.map +0 -1
  532. package/dist/ns/transforms.d.ts.map +0 -1
  533. package/dist/operations/api.d.ts.map +0 -1
  534. package/dist/operations/assemblyFns.d.ts.map +0 -1
  535. package/dist/operations/compoundOpsFns.d.ts.map +0 -1
  536. package/dist/operations/convexHullFns.d.ts.map +0 -1
  537. package/dist/operations/exporterFns.d.ts.map +0 -1
  538. package/dist/operations/exporterUtils.d.ts.map +0 -1
  539. package/dist/operations/exporters.d.ts.map +0 -1
  540. package/dist/operations/extrudeFns.d.ts.map +0 -1
  541. package/dist/operations/extrudeUtils.d.ts.map +0 -1
  542. package/dist/operations/guidedSweepFns.d.ts.map +0 -1
  543. package/dist/operations/historyFns.d.ts.map +0 -1
  544. package/dist/operations/loftFns.d.ts.map +0 -1
  545. package/dist/operations/mateFns.d.ts.map +0 -1
  546. package/dist/operations/multiSweepFns.d.ts.map +0 -1
  547. package/dist/operations/patternFns.d.ts.map +0 -1
  548. package/dist/operations/roofFns.d.ts.map +0 -1
  549. package/dist/operations/straightSkeleton.d.ts.map +0 -1
  550. package/dist/operations/sweepFns.d.ts.map +0 -1
  551. package/dist/operations.d.ts.map +0 -1
  552. package/dist/projection/cameraFns.d.ts.map +0 -1
  553. package/dist/projection/makeProjectedEdges.d.ts.map +0 -1
  554. package/dist/projection/projectionPlanes.d.ts.map +0 -1
  555. package/dist/query/cornerFinder.d.ts.map +0 -1
  556. package/dist/query/directionUtils.d.ts.map +0 -1
  557. package/dist/query/edgeFinder.d.ts.map +0 -1
  558. package/dist/query/faceFinder.d.ts.map +0 -1
  559. package/dist/query/finderCore.d.ts.map +0 -1
  560. package/dist/query/finderFns.d.ts.map +0 -1
  561. package/dist/query/helpers.d.ts.map +0 -1
  562. package/dist/query/shapeDistanceFilter.d.ts.map +0 -1
  563. package/dist/query/shapeFinders.d.ts.map +0 -1
  564. package/dist/query/vertexFinder.d.ts.map +0 -1
  565. package/dist/query/wireFinder.d.ts.map +0 -1
  566. package/dist/query.d.ts.map +0 -1
  567. package/dist/quick.d.ts.map +0 -1
  568. package/dist/result.d.ts.map +0 -1
  569. package/dist/shapeRef.d.ts.map +0 -1
  570. package/dist/sketching/cannedSketches.d.ts.map +0 -1
  571. package/dist/sketching/compoundSketch.d.ts.map +0 -1
  572. package/dist/sketching/draw.d.ts.map +0 -1
  573. package/dist/sketching/draw3d.d.ts.map +0 -1
  574. package/dist/sketching/drawFns.d.ts.map +0 -1
  575. package/dist/sketching/ellipseUtils.d.ts.map +0 -1
  576. package/dist/sketching/shortcuts.d.ts.map +0 -1
  577. package/dist/sketching/sketch.d.ts.map +0 -1
  578. package/dist/sketching/sketchFns.d.ts.map +0 -1
  579. package/dist/sketching/sketchLib.d.ts +0 -47
  580. package/dist/sketching/sketchLib.d.ts.map +0 -1
  581. package/dist/sketching/sketchUtils.d.ts +0 -8
  582. package/dist/sketching/sketchUtils.d.ts.map +0 -1
  583. package/dist/sketching/sketcher.d.ts.map +0 -1
  584. package/dist/sketching/sketcher2d.d.ts.map +0 -1
  585. package/dist/sketching/sketcherlib.d.ts.map +0 -1
  586. package/dist/sketching/sketches.d.ts.map +0 -1
  587. package/dist/sketching.d.ts.map +0 -1
  588. package/dist/text/textBlueprints.d.ts.map +0 -1
  589. package/dist/topology/adjacencyFns.d.ts.map +0 -1
  590. package/dist/topology/api.d.ts.map +0 -1
  591. package/dist/topology/apiTypes.d.ts.map +0 -1
  592. package/dist/topology/booleanDiagnosticFns.d.ts.map +0 -1
  593. package/dist/topology/booleanFns.d.ts.map +0 -1
  594. package/dist/topology/cast.d.ts.map +0 -1
  595. package/dist/topology/chamferAngleFns.d.ts.map +0 -1
  596. package/dist/topology/compoundOpsFns.d.ts.map +0 -1
  597. package/dist/topology/curveBuilders.d.ts.map +0 -1
  598. package/dist/topology/curveFns.d.ts.map +0 -1
  599. package/dist/topology/evolutionFns.d.ts.map +0 -1
  600. package/dist/topology/faceFns.d.ts.map +0 -1
  601. package/dist/topology/healingFns.d.ts.map +0 -1
  602. package/dist/topology/hullFns.d.ts.map +0 -1
  603. package/dist/topology/index.d.ts.map +0 -1
  604. package/dist/topology/meshCache.d.ts.map +0 -1
  605. package/dist/topology/meshFns.d.ts.map +0 -1
  606. package/dist/topology/metadata/colorFns.d.ts.map +0 -1
  607. package/dist/topology/metadata/faceTagFns.d.ts.map +0 -1
  608. package/dist/topology/metadata/metadataPropagation.d.ts.map +0 -1
  609. package/dist/topology/metadata/originTrackingFns.d.ts.map +0 -1
  610. package/dist/topology/minkowskiFns.d.ts.map +0 -1
  611. package/dist/topology/modifierFns.d.ts.map +0 -1
  612. package/dist/topology/nurbsFns.d.ts.map +0 -1
  613. package/dist/topology/polyhedronFns.d.ts.map +0 -1
  614. package/dist/topology/positionFns.d.ts.map +0 -1
  615. package/dist/topology/primitiveFns.d.ts.map +0 -1
  616. package/dist/topology/shapeBooleans.d.ts.map +0 -1
  617. package/dist/topology/shapeFns.d.ts.map +0 -1
  618. package/dist/topology/shapeHelpers.d.ts.map +0 -1
  619. package/dist/topology/shapeModifiers.d.ts.map +0 -1
  620. package/dist/topology/shapeRef/index.d.ts.map +0 -1
  621. package/dist/topology/shapeRef/scoring.d.ts.map +0 -1
  622. package/dist/topology/shapeRef/shapeRefFns.d.ts.map +0 -1
  623. package/dist/topology/shapeRef/shapeRefTypes.d.ts.map +0 -1
  624. package/dist/topology/shapeUtils.d.ts.map +0 -1
  625. package/dist/topology/solidBuilders.d.ts.map +0 -1
  626. package/dist/topology/surfaceBuilders.d.ts.map +0 -1
  627. package/dist/topology/surfaceFns.d.ts.map +0 -1
  628. package/dist/topology/threeHelpers.d.ts.map +0 -1
  629. package/dist/topology/topologyQueryFns.d.ts.map +0 -1
  630. package/dist/topology/transformFns.d.ts.map +0 -1
  631. package/dist/topology/wrapperFns.d.ts.map +0 -1
  632. package/dist/topology.d.ts.map +0 -1
  633. package/dist/utils/arrayAccess.d.ts.map +0 -1
  634. package/dist/utils/bug.d.ts.map +0 -1
  635. package/dist/utils/ioFilename.d.ts.map +0 -1
  636. package/dist/utils/precisionRound.d.ts.map +0 -1
  637. package/dist/utils/range.d.ts.map +0 -1
  638. package/dist/utils/uuid.d.ts.map +0 -1
  639. package/dist/utils/vec2d.d.ts.map +0 -1
  640. package/dist/utils/vec3.d.ts.map +0 -1
  641. package/dist/utils/zip.d.ts.map +0 -1
  642. package/dist/vectors.d.ts.map +0 -1
  643. package/dist/worker/index.d.ts.map +0 -1
  644. package/dist/worker/protocol.d.ts.map +0 -1
  645. package/dist/worker/taskQueue.d.ts.map +0 -1
  646. package/dist/worker/workerClient.d.ts.map +0 -1
  647. package/dist/worker/workerHandler.d.ts.map +0 -1
  648. package/dist/worker.d.ts.map +0 -1
  649. /package/dist/{arrayAccess-Br-m2PP7.cjs → arrayAccess-7pTWqkJu.cjs} +0 -0
  650. /package/dist/{arrayAccess-2G0pRoaC.js → arrayAccess-C5IWcxs9.js} +0 -0
  651. /package/dist/{workerHandler-sCf818XJ.cjs → workerHandler-C7seK7H-.cjs} +0 -0
  652. /package/dist/{workerHandler-BndMJVx6.js → workerHandler-DaulgMax.js} +0 -0
@@ -0,0 +1,855 @@
1
+ import { n as wasmIndex } from "./vec3-BRj3eI54.js";
2
+ import { R as unwrap, h as bug, s as safeIndex } from "./errors-0fYW_YnO.js";
3
+ import { r as lastOrThrow } from "./arrayAccess-C5IWcxs9.js";
4
+ import { v as zip } from "./surfaceBuilders-CinmHCbZ.js";
5
+ import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-xDsl9GXO.js";
6
+ import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-vV2ONZwD.js";
7
+ import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-Dv45Evnu.js";
8
+ //#region src/2d/blueprints/cannedBlueprints.ts
9
+ /**
10
+ * Create a regular polygon blueprint inscribed in a circle of the given radius.
11
+ *
12
+ * @param radius - Circumscribed circle radius.
13
+ * @param sidesCount - Number of sides (3 = triangle, 6 = hexagon, etc.).
14
+ * @param sagitta - When non-zero, sides are replaced by sagitta arcs (bulge height).
15
+ * @returns A closed Blueprint representing the polygon.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const hexagon = polysidesBlueprint(10, 6);
20
+ * const roundedTriangle = polysidesBlueprint(10, 3, 2);
21
+ * ```
22
+ */
23
+ var polysidesBlueprint = (radius, sidesCount, sagitta = 0) => {
24
+ const points = [...Array(sidesCount).keys()].map((i) => {
25
+ const theta = -(Math.PI * 2 / sidesCount) * i;
26
+ return [radius * Math.sin(theta), radius * Math.cos(theta)];
27
+ });
28
+ const lastPoint = lastOrThrow(points);
29
+ const blueprint = new BlueprintSketcher().movePointerTo([lastPoint[0], lastPoint[1]]);
30
+ if (sagitta) points.forEach(([x, y]) => blueprint.sagittaArcTo([x, y], sagitta));
31
+ else points.forEach(([x, y]) => blueprint.lineTo([x, y]));
32
+ return blueprint.done();
33
+ };
34
+ /**
35
+ * Create an axis-aligned rectangle blueprint with optional rounded corners.
36
+ *
37
+ * The rectangle is centered at the origin. When `r` is zero the corners
38
+ * are sharp; otherwise they are filleted with circular or elliptical arcs.
39
+ *
40
+ * @param width - Total width of the rectangle.
41
+ * @param height - Total height of the rectangle.
42
+ * @param r - Corner radius. Pass a number for uniform rounding, or
43
+ * `{ rx, ry }` for elliptical corners. Clamped to half the respective
44
+ * dimension.
45
+ * @returns A closed Blueprint representing the rectangle.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const sharp = roundedRectangleBlueprint(20, 10);
50
+ * const rounded = roundedRectangleBlueprint(20, 10, 3);
51
+ * const elliptical = roundedRectangleBlueprint(20, 10, { rx: 4, ry: 2 });
52
+ * ```
53
+ */
54
+ var roundedRectangleBlueprint = (width, height, r = 0) => {
55
+ const { rx: inputRx = 0, ry: inputRy = 0 } = typeof r === "number" ? {
56
+ ry: r,
57
+ rx: r
58
+ } : r;
59
+ let rx = Math.min(inputRx, width / 2);
60
+ let ry = Math.min(inputRy, height / 2);
61
+ const withRadius = rx && ry;
62
+ if (!withRadius) {
63
+ rx = 0;
64
+ ry = 0;
65
+ }
66
+ const symmetricRadius = rx === ry;
67
+ const sk = new BlueprintSketcher([Math.min(0, -(width / 2 - rx)), -height / 2]);
68
+ const addFillet = (xDist, yDist) => {
69
+ if (withRadius) if (symmetricRadius) sk.tangentArc(xDist, yDist);
70
+ else sk.ellipse(xDist, yDist, rx, ry, 0, false, true);
71
+ };
72
+ if (rx < width / 2) sk.hLine(width - 2 * rx);
73
+ addFillet(rx, ry);
74
+ if (ry < height / 2) sk.vLine(height - 2 * ry);
75
+ addFillet(-rx, ry);
76
+ if (rx < width / 2) sk.hLine(-(width - 2 * rx));
77
+ addFillet(-rx, -ry);
78
+ if (ry < height / 2) sk.vLine(-(height - 2 * ry));
79
+ addFillet(rx, -ry);
80
+ return sk.close();
81
+ };
82
+ //#endregion
83
+ //#region src/2d/blueprints/booleanHelpers.ts
84
+ var samePoint = (x, y) => samePoint$1(x, y, PRECISION_INTERSECTION);
85
+ /**
86
+ * Hash a point for Set/Map lookup using precision rounding.
87
+ * Must match PRECISION_INTERSECTION (1e-9) to avoid hash collisions for
88
+ * nearly-equal points.
89
+ */
90
+ function hashPoint(p) {
91
+ return `${p[0].toFixed(9)},${p[1].toFixed(9)}`;
92
+ }
93
+ /**
94
+ * Hash a segment by both orientations for bidirectional lookup.
95
+ * The smaller hash comes first so that (A,B) and (B,A) produce the same key.
96
+ */
97
+ function hashSegment(first, last) {
98
+ const h1 = hashPoint(first);
99
+ const h2 = hashPoint(last);
100
+ return h1 < h2 ? `${h1}|${h2}` : `${h2}|${h1}`;
101
+ }
102
+ function startOfSegment(s) {
103
+ const first = s[0];
104
+ if (first === void 0) bug("startOfSegment", "empty segment");
105
+ return first.firstPoint;
106
+ }
107
+ function endOfSegment(s) {
108
+ const last = s[s.length - 1];
109
+ if (last === void 0) bug("endOfSegment", "empty segment");
110
+ return last.lastPoint;
111
+ }
112
+ function reverseSegment(segment) {
113
+ return [...segment].reverse().map((curve) => {
114
+ const newCurve = curve.clone();
115
+ newCurve.reverse();
116
+ return newCurve;
117
+ });
118
+ }
119
+ function reverseSegments(segments) {
120
+ return [...segments].reverse().map(reverseSegment);
121
+ }
122
+ function curveMidPoint(curve) {
123
+ const midParameter = (curve.lastParameter + curve.firstParameter) / 2;
124
+ return curve.value(midParameter);
125
+ }
126
+ /**
127
+ * Find the index of the first curve in `curves` whose firstPoint matches
128
+ * `point`. Uses hash for a fast first pass, then falls back to tolerance-only
129
+ * comparison to handle floating-point rounding at `toFixed(9)` boundaries.
130
+ * Returns -1 if no match is found.
131
+ */
132
+ function findCurveIndexByStartPoint(curves, point) {
133
+ const targetHash = hashPoint(point);
134
+ for (let i = 0; i < curves.length; i++) {
135
+ const curve = curves[i];
136
+ if (curve === void 0) continue;
137
+ if (hashPoint(curve.firstPoint) === targetHash && samePoint(point, curve.firstPoint)) return i;
138
+ }
139
+ for (let i = 0; i < curves.length; i++) {
140
+ const curve = curves[i];
141
+ if (curve === void 0) continue;
142
+ if (samePoint(point, curve.firstPoint)) return i;
143
+ }
144
+ return -1;
145
+ }
146
+ /**
147
+ * Find the index of the first curve in `curves` that matches the given
148
+ * segment's start and end points. Uses hash for a fast first pass, then
149
+ * falls back to tolerance-only comparison.
150
+ * Returns -1 if no match is found.
151
+ */
152
+ function findCurveIndexBySegment(curves, segFirstHash, segLastHash, matchesFn) {
153
+ for (let i = 0; i < curves.length; i++) {
154
+ const curve = curves[i];
155
+ if (curve === void 0) continue;
156
+ if (hashPoint(curve.firstPoint) === segFirstHash && hashPoint(curve.lastPoint) === segLastHash && matchesFn(curve)) return i;
157
+ }
158
+ for (let i = 0; i < curves.length; i++) {
159
+ const curve = curves[i];
160
+ if (curve === void 0) continue;
161
+ if (matchesFn(curve)) return i;
162
+ }
163
+ return -1;
164
+ }
165
+ /** Rotate an array so that element at `startIndex` becomes the first element. */
166
+ function rotateArray(arr, startIndex) {
167
+ if (startIndex <= 0) return arr;
168
+ return arr.slice(startIndex).concat(arr.slice(0, startIndex));
169
+ }
170
+ /**
171
+ * Rotate the curves array so that it starts at the curve whose firstPoint
172
+ * matches the given point.
173
+ */
174
+ function rotateToStartAt(curves, point) {
175
+ return rotateArray(curves, findCurveIndexByStartPoint(curves, point));
176
+ }
177
+ /**
178
+ * Rotate the curves array so that it starts at the curve matching the given
179
+ * segment. Tries both segment orientations (forward and flipped) against both
180
+ * curve orientations (original and reversed chain) to handle cases where
181
+ * `intersectCurves` returns a common segment oriented opposite to the
182
+ * matching curve in the split result.
183
+ */
184
+ function rotateToStartAtSegment(curves, segment) {
185
+ const segFirstHash = hashPoint(segment.firstPoint);
186
+ const segLastHash = hashPoint(segment.lastPoint);
187
+ const matchesForward = (curve) => samePoint(segment.firstPoint, curve.firstPoint) && samePoint(segment.lastPoint, curve.lastPoint);
188
+ const matchesFlipped = (curve) => samePoint(segment.lastPoint, curve.firstPoint) && samePoint(segment.firstPoint, curve.lastPoint);
189
+ function tryRotate(chain, firstHash, lastHash, matchFn) {
190
+ const idx = findCurveIndexBySegment(chain, firstHash, lastHash, matchFn);
191
+ return idx !== -1 ? rotateArray(chain, idx) : null;
192
+ }
193
+ const fwdFwd = tryRotate(curves, segFirstHash, segLastHash, matchesForward);
194
+ if (fwdFwd !== null) return fwdFwd;
195
+ const flipFwd = tryRotate(curves, segLastHash, segFirstHash, matchesFlipped);
196
+ if (flipFwd !== null) return flipFwd;
197
+ const reversed = reverseSegment(curves);
198
+ const fwdRev = tryRotate(reversed, segFirstHash, segLastHash, matchesForward);
199
+ if (fwdRev !== null) return fwdRev;
200
+ const flipRev = tryRotate(reversed, segLastHash, segFirstHash, matchesFlipped);
201
+ if (flipRev !== null) return flipRev;
202
+ bug("rotateToStartAtSegment", "failed to rotate to segment start");
203
+ }
204
+ //#endregion
205
+ //#region src/2d/blueprints/intersectionSegments.ts
206
+ function* createSegmentOnPoints(curves, allIntersections, allCommonSegments) {
207
+ const intersectionSet = new Set(allIntersections.map(hashPoint));
208
+ const commonSegmentSet = new Set(allCommonSegments.map((seg) => hashSegment(seg.firstPoint, seg.lastPoint)));
209
+ const matchesIntersection = (point) => {
210
+ if (intersectionSet.has(hashPoint(point))) return true;
211
+ return allIntersections.some((p) => samePoint(p, point));
212
+ };
213
+ const matchesCommonSegment = (first, last) => {
214
+ if (commonSegmentSet.has(hashSegment(first, last))) return true;
215
+ return allCommonSegments.some((seg) => samePoint(seg.firstPoint, first) && samePoint(seg.lastPoint, last) || samePoint(seg.firstPoint, last) && samePoint(seg.lastPoint, first));
216
+ };
217
+ let currentCurves = [];
218
+ for (const curve of curves) {
219
+ if (samePoint(curve.firstPoint, curve.lastPoint)) {
220
+ currentCurves.push(curve);
221
+ continue;
222
+ }
223
+ const endsAtIntersection = matchesIntersection(curve.lastPoint);
224
+ const isCommon = matchesCommonSegment(curve.firstPoint, curve.lastPoint);
225
+ if (endsAtIntersection) {
226
+ currentCurves.push(curve);
227
+ yield currentCurves;
228
+ currentCurves = [];
229
+ } else if (isCommon) {
230
+ if (currentCurves.length) {
231
+ yield currentCurves;
232
+ currentCurves = [];
233
+ }
234
+ yield [curve];
235
+ } else currentCurves.push(curve);
236
+ }
237
+ if (currentCurves.length) yield currentCurves;
238
+ }
239
+ /**
240
+ * Filter out intersection points where the curves only touch but do not
241
+ * actually cross from one side to the other.
242
+ */
243
+ function removeNonCrossingPoints(allIntersections, segmentedCurve, blueprintToCheck) {
244
+ return allIntersections.filter((intersection) => {
245
+ const touching = segmentedCurve.filter((s) => samePoint(s.firstPoint, intersection) || samePoint(s.lastPoint, intersection));
246
+ const effectiveTouching = touching.length % 2 ? touching.filter((s) => !(samePoint(s.firstPoint, intersection) && samePoint(s.lastPoint, intersection))) : touching;
247
+ if (effectiveTouching.length === 0 || effectiveTouching.length % 2) return false;
248
+ const insideFlags = effectiveTouching.map((segment) => blueprintToCheck.isInside(curveMidPoint(segment)));
249
+ return !(insideFlags.every(Boolean) || insideFlags.every((f) => !f));
250
+ });
251
+ }
252
+ /**
253
+ * Find all intersection points and common segments between two blueprints'
254
+ * curves. Returns per-curve intersection points for subsequent splitting.
255
+ */
256
+ function findAllIntersections(first, second) {
257
+ const allIntersections = [];
258
+ const allCommonSegments = [];
259
+ const firstCurvePoints = first.curves.map(() => []);
260
+ const secondCurvePoints = second.curves.map(() => []);
261
+ const secondIndex = new Flatbush(second.curves.length);
262
+ for (const curve of second.curves) {
263
+ const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
264
+ secondIndex.add(xMin, yMin, xMax, yMax);
265
+ }
266
+ secondIndex.finish();
267
+ first.curves.forEach((thisCurve, firstIdx) => {
268
+ const [[xMin, yMin], [xMax, yMax]] = thisCurve.boundingBox.bounds;
269
+ const candidates = secondIndex.search(xMin, yMin, xMax, yMax);
270
+ for (const secondIdx of candidates) {
271
+ const { intersections, commonSegments, commonSegmentsPoints } = unwrap(intersectCurves(thisCurve, wasmIndex(second.curves, secondIdx), PRECISION_INTERSECTION / 100));
272
+ allIntersections.push(...intersections);
273
+ firstCurvePoints[firstIdx]?.push(...intersections);
274
+ secondCurvePoints[secondIdx]?.push(...intersections);
275
+ allCommonSegments.push(...commonSegments);
276
+ allIntersections.push(...commonSegmentsPoints);
277
+ firstCurvePoints[firstIdx]?.push(...commonSegmentsPoints);
278
+ secondCurvePoints[secondIdx]?.push(...commonSegmentsPoints);
279
+ }
280
+ });
281
+ return {
282
+ allIntersections: removeDuplicatePoints(allIntersections, PRECISION_INTERSECTION),
283
+ allCommonSegments,
284
+ firstCurvePoints,
285
+ secondCurvePoints
286
+ };
287
+ }
288
+ /**
289
+ * Split each curve at its intersection points and return the resulting
290
+ * sub-curves.
291
+ */
292
+ function splitCurvesAtIntersections(curves, curvePoints) {
293
+ return zip([curves, curvePoints]).flatMap(([curve, intersections]) => {
294
+ if (intersections.length === 0) return [curve];
295
+ return curve.splitAt(intersections, PRECISION_INTERSECTION / 100);
296
+ });
297
+ }
298
+ /**
299
+ * Check whether a segment's start/end points match one of the common segment
300
+ * point pairs.
301
+ */
302
+ function isCommonSegmentMatch(commonSegmentsPoints, segmentStart, segmentEnd) {
303
+ return commonSegmentsPoints.some(([startPoint, endPoint]) => {
304
+ if (startPoint === void 0 || endPoint === void 0) return false;
305
+ return samePoint(startPoint, segmentStart) && samePoint(endPoint, segmentEnd) || samePoint(startPoint, segmentEnd) && samePoint(endPoint, segmentStart);
306
+ });
307
+ }
308
+ /**
309
+ * Given two closed blueprints, find their intersection points, split each
310
+ * blueprint's curves at those points, and pair up the resulting segments.
311
+ *
312
+ * Returns an array of paired segments (one from each blueprint) that share
313
+ * the same start/end intersection points, or `null` if the blueprints do not
314
+ * intersect.
315
+ */
316
+ function blueprintsIntersectionSegments(first, second) {
317
+ const { allIntersections: rawIntersections, allCommonSegments, firstCurvePoints, secondCurvePoints } = findAllIntersections(first, second);
318
+ if (rawIntersections.length <= 1) return null;
319
+ let firstCurveSegments = splitCurvesAtIntersections(first.curves, firstCurvePoints);
320
+ let secondCurveSegments = splitCurvesAtIntersections(second.curves, secondCurvePoints);
321
+ const commonSegmentsPoints = allCommonSegments.map((c) => [c.firstPoint, c.lastPoint]);
322
+ const allIntersections = removeNonCrossingPoints(removeNonCrossingPoints(rawIntersections, firstCurveSegments, second), secondCurveSegments, first);
323
+ if (allIntersections.length === 0 && allCommonSegments.length === 0) return null;
324
+ if (allCommonSegments.length === 0) {
325
+ const startAt = allIntersections[0];
326
+ if (startAt === void 0) return null;
327
+ firstCurveSegments = rotateToStartAt(firstCurveSegments, startAt);
328
+ secondCurveSegments = rotateToStartAt(secondCurveSegments, startAt);
329
+ } else {
330
+ const startSegment = allCommonSegments[0];
331
+ if (startSegment === void 0) return null;
332
+ firstCurveSegments = rotateToStartAtSegment(firstCurveSegments, startSegment);
333
+ secondCurveSegments = rotateToStartAtSegment(secondCurveSegments, startSegment);
334
+ }
335
+ const firstIntersectedSegments = Array.from(createSegmentOnPoints(firstCurveSegments, allIntersections, allCommonSegments));
336
+ let secondIntersectedSegments = Array.from(createSegmentOnPoints(secondCurveSegments, allIntersections, allCommonSegments));
337
+ const firstSeg = firstIntersectedSegments[0];
338
+ const secondSeg = secondIntersectedSegments[0];
339
+ if (firstSeg !== void 0 && secondSeg !== void 0) {
340
+ const endpointsMismatch = !samePoint(endOfSegment(secondSeg), endOfSegment(firstSeg));
341
+ const commonSegmentLengthMismatch = allCommonSegments.length > 0 && secondSeg.length !== 1;
342
+ if (endpointsMismatch || commonSegmentLengthMismatch) secondIntersectedSegments = reverseSegments(secondIntersectedSegments);
343
+ }
344
+ const maxLen = Math.max(firstIntersectedSegments.length, secondIntersectedSegments.length);
345
+ const result = [];
346
+ for (let i = 0; i < maxLen; i++) {
347
+ const firstSeg2 = firstIntersectedSegments[i];
348
+ const secondSeg2 = secondIntersectedSegments[i];
349
+ if (firstSeg2 === void 0 || secondSeg2 === void 0) {
350
+ const available = firstSeg2 ?? secondSeg2;
351
+ if (available === void 0) continue;
352
+ result.push([available, available]);
353
+ continue;
354
+ }
355
+ if (isCommonSegmentMatch(commonSegmentsPoints, startOfSegment(firstSeg2), endOfSegment(firstSeg2))) result.push([firstSeg2, "same"]);
356
+ else result.push([firstSeg2, secondSeg2]);
357
+ }
358
+ return result;
359
+ }
360
+ //#endregion
361
+ //#region src/2d/blueprints/segmentAssembly.ts
362
+ /**
363
+ * Merge adjacent collinear line segments into single segments.
364
+ *
365
+ * Boolean operations can split a line at intersection points that lie on the
366
+ * line itself (e.g. when a cut rectangle's edge is collinear with the
367
+ * profile's edge). The extra split creates a C0 discontinuity in swept
368
+ * surfaces. Merging eliminates unnecessary vertices.
369
+ */
370
+ function mergeCollinearSegments(curves) {
371
+ if (curves.length < 2) return curves;
372
+ const result = [];
373
+ let i = 0;
374
+ while (i < curves.length) {
375
+ const current = wasmIndex(curves, i);
376
+ if (current.geomType !== "LINE") {
377
+ result.push(current);
378
+ i++;
379
+ continue;
380
+ }
381
+ let endPoint = current.lastPoint;
382
+ let j = i + 1;
383
+ while (j < curves.length) {
384
+ const next = wasmIndex(curves, j);
385
+ if (next.geomType !== "LINE") break;
386
+ if (!samePoint(endPoint, next.firstPoint)) break;
387
+ const dir1 = subtract2d(endPoint, current.firstPoint);
388
+ const dir2 = subtract2d(next.lastPoint, next.firstPoint);
389
+ if (Math.abs(crossProduct2d(dir1, dir2)) > 1e-9) break;
390
+ endPoint = next.lastPoint;
391
+ j++;
392
+ }
393
+ if (j > i + 1) result.push(make2dSegmentCurve(current.firstPoint, endPoint));
394
+ else result.push(current);
395
+ i = j;
396
+ }
397
+ return result;
398
+ }
399
+ /**
400
+ * Split an array of curves into separate continuous paths. A discontinuity
401
+ * occurs where one curve's lastPoint does not match the next curve's
402
+ * firstPoint.
403
+ */
404
+ function splitPaths(curves) {
405
+ const startPoints = curves.map((c) => c.firstPoint);
406
+ const shiftedEndPoints = curves.map((c) => c.lastPoint);
407
+ const discontinuities = zip([startPoints, shiftedEndPoints.slice(-1).concat(shiftedEndPoints.slice(0, -1))]).map(([startPoint, endPoint], index) => {
408
+ if (startPoint === void 0 || endPoint === void 0) return null;
409
+ return samePoint(startPoint, endPoint) ? null : index;
410
+ }).filter((f) => f !== null);
411
+ if (discontinuities.length === 0) return [curves];
412
+ const paths = zip([discontinuities.slice(0, -1), discontinuities.slice(1)]).map(([start, end]) => curves.slice(start, end));
413
+ let lastPath = curves.slice(discontinuities[discontinuities.length - 1]);
414
+ const firstDiscontinuity = discontinuities[0];
415
+ if (firstDiscontinuity !== void 0 && firstDiscontinuity !== 0) lastPath = lastPath.concat(curves.slice(0, firstDiscontinuity));
416
+ paths.push(lastPath);
417
+ return paths;
418
+ }
419
+ /**
420
+ * Handle the case where two segments overlap ("same"). The decision depends
421
+ * on how many segments are entering the current intersection node.
422
+ */
423
+ function handleSameSegment(firstSegment, segmentsIn, lastWasSame) {
424
+ if (segmentsIn === 1) return {
425
+ curves: [...firstSegment],
426
+ segmentsIn: 1,
427
+ lastWasSame: null
428
+ };
429
+ if (segmentsIn === 2 || segmentsIn === 0) return {
430
+ curves: [],
431
+ segmentsIn: null,
432
+ lastWasSame: null
433
+ };
434
+ if (segmentsIn === null) return {
435
+ curves: [],
436
+ segmentsIn: null,
437
+ lastWasSame: lastWasSame ? [...lastWasSame, ...firstSegment] : firstSegment
438
+ };
439
+ return {
440
+ curves: [],
441
+ segmentsIn,
442
+ lastWasSame
443
+ };
444
+ }
445
+ /**
446
+ * Determine which non-overlapping segments to keep based on
447
+ * inside/outside status relative to the other blueprint.
448
+ */
449
+ function selectSegments(firstSegment, secondSegment, first, second, config, segmentsIn, lastWasSame) {
450
+ let segments = [];
451
+ let segmentsOut = 0;
452
+ const firstCurve = firstSegment[0];
453
+ if (firstCurve !== void 0) {
454
+ const firstSegmentPoint = curveMidPoint(firstCurve);
455
+ const firstInSecond = second.isInside(firstSegmentPoint);
456
+ if (config.firstInside === "keep" && firstInSecond || config.firstInside === "remove" && !firstInSecond) {
457
+ segmentsOut += 1;
458
+ segments.push(...firstSegment);
459
+ }
460
+ }
461
+ const secondCurve = secondSegment[0];
462
+ if (secondCurve !== void 0) {
463
+ const secondSegmentPoint = curveMidPoint(secondCurve);
464
+ const secondInFirst = first.isInside(secondSegmentPoint);
465
+ if (config.secondInside === "keep" && secondInFirst || config.secondInside === "remove" && !secondInFirst) {
466
+ let segmentsToAdd = secondSegment;
467
+ if (segmentsOut === 1) segmentsToAdd = reverseSegment(secondSegment);
468
+ segmentsOut += 1;
469
+ segments.push(...segmentsToAdd);
470
+ }
471
+ }
472
+ if (segmentsIn === null && segmentsOut === 1 && lastWasSame !== null) segments = [...lastWasSame, ...segments];
473
+ return {
474
+ curves: segments,
475
+ segmentsIn: segmentsOut === 1 ? segmentsOut : segmentsIn,
476
+ lastWasSame: segmentsOut === 1 ? null : lastWasSame
477
+ };
478
+ }
479
+ /**
480
+ * Core boolean operation between two simple (non-compound) blueprints.
481
+ *
482
+ * Segments both blueprints at their intersection points, then selects which
483
+ * segments to keep based on the `firstInside`/`secondInside` configuration.
484
+ */
485
+ function booleanOperation(first, second, config) {
486
+ const segments = blueprintsIntersectionSegments(first, second);
487
+ if (segments === null) return buildNoIntersectionResult(first, second);
488
+ if (segments.every(([, secondSegment]) => secondSegment === "same")) return { identical: true };
489
+ let segmentsIn = null;
490
+ let lastWasSame = null;
491
+ let assembledCurves = segments.flatMap(([firstSegment, secondSegment]) => {
492
+ if (secondSegment === "same") {
493
+ const result = handleSameSegment(firstSegment, segmentsIn, lastWasSame);
494
+ segmentsIn = result.segmentsIn;
495
+ lastWasSame = result.lastWasSame;
496
+ return result.curves;
497
+ }
498
+ const result = selectSegments(firstSegment, secondSegment, first, second, config, segmentsIn, lastWasSame);
499
+ segmentsIn = result.segmentsIn;
500
+ lastWasSame = result.lastWasSame;
501
+ return result.curves;
502
+ });
503
+ const finalLastWasSame = lastWasSame;
504
+ if (finalLastWasSame !== null && segmentsIn === 1) assembledCurves = [...finalLastWasSame, ...assembledCurves];
505
+ const paths = splitPaths(mergeCollinearSegments(assembledCurves)).filter((b) => b.length > 0).map((b) => new Blueprint(b));
506
+ if (paths.length === 0) return null;
507
+ if (paths.length === 1) {
508
+ const single = paths[0];
509
+ if (single === void 0) return null;
510
+ return single;
511
+ }
512
+ return organiseBlueprints(paths);
513
+ }
514
+ function buildNoIntersectionResult(first, second) {
515
+ const firstCurve = first.curves[0];
516
+ const secondCurve = second.curves[0];
517
+ return {
518
+ identical: false,
519
+ firstCurveInSecond: firstCurve !== void 0 && second.isInside(curveMidPoint(firstCurve)),
520
+ secondCurveInFirst: secondCurve !== void 0 && first.isInside(curveMidPoint(secondCurve))
521
+ };
522
+ }
523
+ //#endregion
524
+ //#region src/2d/blueprints/booleanOperations.ts
525
+ /**
526
+ * Boolean operations on 2D blueprints: fuse, cut, and intersect.
527
+ *
528
+ * This module is the public API. Internal logic is split across:
529
+ * - `booleanHelpers.ts` — hashing, segment types, rotation utilities
530
+ * - `intersectionSegments.ts` — curve intersection and segment pairing
531
+ * - `segmentAssembly.ts` — segment selection and path assembly
532
+ */
533
+ /**
534
+ * Compute the boolean union of two simple blueprints.
535
+ *
536
+ * Segments each blueprint at their intersection points, discards segments
537
+ * inside the other shape, and reassembles the remaining curves.
538
+ *
539
+ * @param first - First blueprint operand.
540
+ * @param second - Second blueprint operand.
541
+ * @returns The fused outline, a {@link Blueprints} if the result is
542
+ * disjoint, or `null` if the operation produces no geometry.
543
+ *
544
+ * @remarks Both blueprints must be closed. For compound or multi-blueprint
545
+ * inputs, use {@link fuse2D} instead.
546
+ */
547
+ function fuseBlueprints(first, second) {
548
+ const result = booleanOperation(first, second, {
549
+ firstInside: "remove",
550
+ secondInside: "remove"
551
+ });
552
+ if (result === null || result instanceof Blueprint || result instanceof Blueprints) return result;
553
+ if (result.identical) return first.clone();
554
+ if (result.firstCurveInSecond) return second.clone();
555
+ if (result.secondCurveInFirst) return first.clone();
556
+ return new Blueprints([first, second]);
557
+ }
558
+ /**
559
+ * Compute the boolean difference of two simple blueprints (first minus second).
560
+ *
561
+ * Segments the blueprints at their intersections, keeps segments of the first
562
+ * that are outside the second, and segments of the second that are inside the
563
+ * first (reversed to form the boundary of the cut).
564
+ *
565
+ * @param first - Base blueprint to cut from.
566
+ * @param second - Tool blueprint to subtract.
567
+ * @returns The remaining outline, or `null` if nothing remains.
568
+ *
569
+ * @remarks Both blueprints must be closed. For compound inputs use {@link cut2D}.
570
+ */
571
+ function cutBlueprints(first, second) {
572
+ const result = booleanOperation(first, second, {
573
+ firstInside: "remove",
574
+ secondInside: "keep"
575
+ });
576
+ if (result === null || result instanceof Blueprint || result instanceof Blueprints) return result;
577
+ if (result.identical) return null;
578
+ if (result.firstCurveInSecond) return null;
579
+ if (result.secondCurveInFirst) return new Blueprints([new CompoundBlueprint([first, second])]);
580
+ return first.clone();
581
+ }
582
+ /**
583
+ * Compute the boolean intersection of two simple blueprints.
584
+ *
585
+ * Keeps only the segments of each blueprint that lie inside the other,
586
+ * producing the overlapping region.
587
+ *
588
+ * @param first - First blueprint operand.
589
+ * @param second - Second blueprint operand.
590
+ * @returns The intersection outline, or `null` if the blueprints do not overlap.
591
+ *
592
+ * @remarks Both blueprints must be closed. For compound inputs use {@link intersect2D}.
593
+ */
594
+ function intersectBlueprints(first, second) {
595
+ const result = booleanOperation(first, second, {
596
+ firstInside: "keep",
597
+ secondInside: "keep"
598
+ });
599
+ if (result === null || result instanceof Blueprint || result instanceof Blueprints) return result;
600
+ if (result.identical) return first.clone();
601
+ if (result.firstCurveInSecond) return first.clone();
602
+ if (result.secondCurveInFirst) return second.clone();
603
+ return null;
604
+ }
605
+ //#endregion
606
+ //#region src/2d/blueprints/boolean2D.ts
607
+ var genericIntersects = (first, second) => {
608
+ if (first instanceof Blueprint && second instanceof Blueprint) {
609
+ let allIntersections = [];
610
+ first.curves.forEach((thisCurve) => {
611
+ second.curves.forEach((otherCurve) => {
612
+ const { intersections, commonSegmentsPoints } = unwrap(intersectCurves(thisCurve, otherCurve));
613
+ allIntersections.push(...intersections);
614
+ allIntersections.push(...commonSegmentsPoints);
615
+ });
616
+ });
617
+ allIntersections = removeDuplicatePoints(allIntersections);
618
+ return allIntersections.length > 1;
619
+ }
620
+ if (first instanceof CompoundBlueprint || first instanceof Blueprints) return first.blueprints.some((bp) => genericIntersects(bp, second));
621
+ if (second instanceof CompoundBlueprint || second instanceof Blueprints) return second.blueprints.some((bp) => genericIntersects(first, bp));
622
+ bug("genericIntersects", "Unhandled shape combination in genericIntersects");
623
+ };
624
+ var genericFuse = (first, second) => {
625
+ if (first instanceof CompoundBlueprint) {
626
+ if (second instanceof Blueprint) return fuseBlueprintWithCompound(second, first);
627
+ if (second instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
628
+ }
629
+ if (second instanceof CompoundBlueprint) {
630
+ if (first instanceof Blueprint) return fuseBlueprintWithCompound(first, second);
631
+ if (first instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
632
+ }
633
+ if (first instanceof Blueprint && second instanceof Blueprint) return fuseBlueprints(first, second);
634
+ bug("genericFuse", "Unhandled shape combination in genericFuse");
635
+ };
636
+ var fuseIntersectingBlueprints = (blueprints) => {
637
+ const fused = /* @__PURE__ */ new Map();
638
+ const output = [];
639
+ blueprints.forEach((inputBlueprint, i) => {
640
+ let savedBlueprint;
641
+ if (fused.has(i)) savedBlueprint = fused.get(i);
642
+ else {
643
+ savedBlueprint = {
644
+ current: inputBlueprint,
645
+ fusedWith: new Set([i])
646
+ };
647
+ output.push(savedBlueprint);
648
+ }
649
+ blueprints.slice(i + 1).forEach((inputOtherBlueprint, j) => {
650
+ const blueprint = savedBlueprint.current;
651
+ const currentIndex = i + j + 1;
652
+ if (savedBlueprint.fusedWith.has(currentIndex)) return;
653
+ let otherBlueprint = inputOtherBlueprint;
654
+ let otherIsFused = false;
655
+ if (fused.has(currentIndex)) {
656
+ otherBlueprint = fused.get(currentIndex).current;
657
+ otherIsFused = true;
658
+ }
659
+ if (blueprint.boundingBox.isOut(otherBlueprint.boundingBox)) return;
660
+ if (!genericIntersects(blueprint, otherBlueprint)) return;
661
+ let newFused;
662
+ if (blueprint instanceof Blueprints || otherBlueprint instanceof Blueprints) {
663
+ const fused = fuse2D(blueprint, otherBlueprint);
664
+ if (fused === null) bug("fuseIntersectingBlueprints", "fuse2D returned null for non-null inputs");
665
+ newFused = fused;
666
+ } else newFused = genericFuse(blueprint, otherBlueprint);
667
+ if (!(newFused instanceof Blueprint || newFused instanceof CompoundBlueprint)) {
668
+ if (newFused instanceof Blueprints && newFused.blueprints.length === 2) return;
669
+ else if (newFused instanceof Blueprints && newFused.blueprints.length === 1) newFused = safeIndex(newFused.blueprints, 0, "fuseIntersectingBlueprints");
670
+ else if (!(newFused instanceof Blueprints)) bug("fuseIntersectingBlueprints", "Fuse produced unexpected non-blueprint result");
671
+ }
672
+ savedBlueprint.fusedWith.add(currentIndex);
673
+ savedBlueprint.current = newFused;
674
+ if (!otherIsFused) fused.set(currentIndex, savedBlueprint);
675
+ });
676
+ });
677
+ return organiseBlueprints(output.map(({ current }) => current).flatMap((b) => allBlueprints(b)));
678
+ };
679
+ var allBlueprints = (shape) => {
680
+ if (shape instanceof Blueprint) return [shape];
681
+ if (shape instanceof CompoundBlueprint) return shape.blueprints;
682
+ if (shape instanceof Blueprints) return shape.blueprints.flatMap((b) => allBlueprints(b));
683
+ return [];
684
+ };
685
+ var fuseBlueprintWithCompound = (blueprint, compound) => {
686
+ const outerFused = fuseBlueprints(blueprint, safeIndex(compound.blueprints, 0, "fuseBlueprintWithCompound"));
687
+ const innerFused = compound.blueprints.slice(1).map((c) => cutBlueprints(c, blueprint));
688
+ return organiseBlueprints([...allBlueprints(outerFused), ...innerFused.flatMap((fused) => allBlueprints(fused))]);
689
+ };
690
+ function allPairs(list1, list2) {
691
+ const result = [];
692
+ for (const l1 of list1) for (const l2 of list2) result.push([l1, l2]);
693
+ return result;
694
+ }
695
+ var fuseCompoundWithCompound = (first, second) => {
696
+ const firstOuter = safeIndex(first.blueprints, 0, "fuseCompoundWithCompound");
697
+ const secondOuter = safeIndex(second.blueprints, 0, "fuseCompoundWithCompound");
698
+ const outerFused = fuseBlueprints(firstOuter, secondOuter);
699
+ const inner1Fused = second.blueprints.slice(1).map((c) => cutBlueprints(c, firstOuter));
700
+ const inner2Fused = first.blueprints.slice(1).map((c) => cutBlueprints(c, secondOuter));
701
+ const innerIntersections = allPairs(first.blueprints.slice(1), second.blueprints.slice(1)).flatMap(([first, second]) => {
702
+ return allBlueprints(intersectBlueprints(first, second));
703
+ });
704
+ return organiseBlueprints([
705
+ ...allBlueprints(outerFused),
706
+ ...inner1Fused.flatMap((fused) => allBlueprints(fused)),
707
+ ...inner2Fused.flatMap((fused) => allBlueprints(fused)),
708
+ ...innerIntersections
709
+ ]);
710
+ };
711
+ /**
712
+ * Compute the boolean union of two 2D shapes.
713
+ *
714
+ * Handles all combinations of {@link Blueprint}, {@link CompoundBlueprint},
715
+ * {@link Blueprints}, and `null`. When both inputs are simple blueprints the
716
+ * operation delegates to {@link fuseBlueprints}; compound and multi-blueprint
717
+ * cases are decomposed recursively.
718
+ *
719
+ * @param first - First operand (or `null` for empty).
720
+ * @param second - Second operand (or `null` for empty).
721
+ * @returns The fused shape, or `null` if both operands are empty.
722
+ *
723
+ * @example
724
+ * ```ts
725
+ * const union = fuse2D(circleBlueprint, squareBlueprint);
726
+ * ```
727
+ *
728
+ * @see {@link fuse2D} for the functional API.
729
+ */
730
+ var fuse2D = (first, second) => {
731
+ if (first === null) return second?.clone() ?? null;
732
+ if (second === null) return first.clone();
733
+ if (!(first instanceof Blueprints) && second instanceof Blueprints) return fuseIntersectingBlueprints([first, ...second.blueprints]);
734
+ if (!(second instanceof Blueprints) && first instanceof Blueprints) return fuseIntersectingBlueprints([second, ...first.blueprints]);
735
+ if (first instanceof Blueprints && second instanceof Blueprints) {
736
+ let out = fuse2D(safeIndex(first.blueprints, 0, "fuse2D"), second);
737
+ first.blueprints.slice(1).forEach((bp) => {
738
+ out = fuse2D(bp, out);
739
+ });
740
+ return out;
741
+ }
742
+ if (first instanceof CompoundBlueprint) {
743
+ if (second instanceof Blueprints) return fuse2D(second, first);
744
+ if (second instanceof Blueprint) return fuseBlueprintWithCompound(second, first);
745
+ if (second instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
746
+ }
747
+ if (second instanceof CompoundBlueprint) {
748
+ if (first instanceof Blueprints) return fuse2D(first, second);
749
+ if (first instanceof Blueprint) return fuseBlueprintWithCompound(first, second);
750
+ if (first instanceof CompoundBlueprint) return fuseCompoundWithCompound(first, second);
751
+ }
752
+ if (first instanceof Blueprint && second instanceof Blueprint) return fuseBlueprints(first, second);
753
+ return null;
754
+ };
755
+ var mergeNonIntersecting = (shapes) => {
756
+ const exploded = shapes.flatMap((s) => {
757
+ if (s === null) return [];
758
+ if (s instanceof Blueprints) return s.blueprints;
759
+ return s;
760
+ });
761
+ if (exploded.length === 1) return safeIndex(exploded, 0, "mergeNonIntersecting");
762
+ return new Blueprints(exploded);
763
+ };
764
+ /**
765
+ * Compute the boolean difference of two 2D shapes (first minus second).
766
+ *
767
+ * Removes the region covered by `second` from `first`. When the tool is fully
768
+ * inside the base, the result is a {@link CompoundBlueprint} (base with a
769
+ * hole).
770
+ *
771
+ * @param first - Base shape to cut from.
772
+ * @param second - Tool shape to subtract.
773
+ * @returns The remaining shape, or `null` if nothing remains.
774
+ *
775
+ * @example
776
+ * ```ts
777
+ * const withHole = cut2D(outerRect, innerCircle);
778
+ * ```
779
+ *
780
+ * @see {@link cut2D} for the functional API.
781
+ */
782
+ var cut2D = (first, second) => {
783
+ if (first === null) return null;
784
+ if (second === null) return first.clone();
785
+ if (first instanceof Blueprints) return mergeNonIntersecting(first.blueprints.map((bp) => cut2D(bp, second)));
786
+ if (first instanceof CompoundBlueprint) {
787
+ const wrapper = safeIndex(first.blueprints, 0, "cut2D");
788
+ if (second instanceof Blueprint && !second.intersects(wrapper)) {
789
+ if (!wrapper.isInside(second.firstPoint)) return first.clone();
790
+ return organiseBlueprints([wrapper, ...allBlueprints(fuse2D(second, new Blueprints(first.blueprints.slice(1))))]);
791
+ } else {
792
+ let out = cut2D(wrapper, second);
793
+ first.blueprints.slice(1).forEach((bp) => {
794
+ out = cut2D(out, bp);
795
+ });
796
+ return out;
797
+ }
798
+ }
799
+ if (second instanceof Blueprints) {
800
+ let out = first;
801
+ for (const bp of second.blueprints) out = cut2D(out, bp);
802
+ return out;
803
+ }
804
+ if (second instanceof CompoundBlueprint) {
805
+ let out = cutBlueprints(first, safeIndex(second.blueprints, 0, "cut2D"));
806
+ second.blueprints.slice(1).forEach((bp) => {
807
+ out = fuse2D(out, intersectBlueprints(bp, first));
808
+ });
809
+ return out;
810
+ }
811
+ return cutBlueprints(first, second);
812
+ };
813
+ /**
814
+ * Compute the boolean intersection of two 2D shapes.
815
+ *
816
+ * Returns only the region common to both shapes. Compound and multi-blueprint
817
+ * operands are decomposed recursively, with holes handled via complementary
818
+ * cut operations.
819
+ *
820
+ * @param first - First operand.
821
+ * @param second - Second operand.
822
+ * @returns The intersection shape, or `null` if the shapes do not overlap.
823
+ *
824
+ * @example
825
+ * ```ts
826
+ * const overlap = intersect2D(circle, rectangle);
827
+ * ```
828
+ *
829
+ * @see {@link intersect2D} for the functional API.
830
+ */
831
+ function intersect2D(first, second) {
832
+ if (first === null || second === null) return null;
833
+ if (first instanceof Blueprint && second instanceof Blueprint) return intersectBlueprints(first, second);
834
+ if (first instanceof Blueprints) return mergeNonIntersecting(first.blueprints.map((bp) => intersect2D(bp, second)));
835
+ if (first instanceof CompoundBlueprint) {
836
+ const wrapper = safeIndex(first.blueprints, 0, "intersect2D");
837
+ const cuts = first.blueprints.slice(1);
838
+ if (cuts.length === 0) return intersect2D(wrapper, second);
839
+ let result = intersect2D(wrapper, second);
840
+ for (const cut of cuts) result = cut2D(result, cut);
841
+ return result;
842
+ }
843
+ if (second instanceof Blueprints) return mergeNonIntersecting(second.blueprints.map((bp) => intersect2D(first, bp)));
844
+ if (second instanceof CompoundBlueprint) {
845
+ const wrapper = safeIndex(second.blueprints, 0, "intersect2D");
846
+ const cuts = second.blueprints.slice(1);
847
+ if (cuts.length === 0) return intersect2D(wrapper, first);
848
+ let result = intersect2D(wrapper, first);
849
+ for (const cut of cuts) result = cut2D(result, cut);
850
+ return result;
851
+ }
852
+ bug("intersect2D", "Unhandled Shape2D combination");
853
+ }
854
+ //#endregion
855
+ export { fuseBlueprints as a, roundedRectangleBlueprint as c, cutBlueprints as i, fuse2D as n, intersectBlueprints as o, intersect2D as r, polysidesBlueprint as s, cut2D as t };