brepjs 12.8.2 → 12.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/2d/blueprints/{approximations.d.ts → blueprintApproximations.d.ts} +1 -1
  2. package/dist/2d/blueprints/blueprintApproximations.d.ts.map +1 -0
  3. package/dist/2d/blueprints/{customCorners.d.ts → blueprintCustomCorners.d.ts} +1 -1
  4. package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +1 -0
  5. package/dist/2d/blueprints/blueprintFns.d.ts +17 -3
  6. package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
  7. package/dist/2d/blueprints/{offset.d.ts → blueprintOffset.d.ts} +1 -1
  8. package/dist/2d/blueprints/blueprintOffset.d.ts.map +1 -0
  9. package/dist/2d/blueprints/index.d.ts +4 -4
  10. package/dist/2d/blueprints/index.d.ts.map +1 -1
  11. package/dist/2d/lib/Curve2D.d.ts +1 -1
  12. package/dist/2d/lib/Curve2D.d.ts.map +1 -1
  13. package/dist/2d/lib/svgPath.d.ts.map +1 -1
  14. package/dist/2d/lib/vectorOperations.d.ts +4 -1
  15. package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
  16. package/dist/2d-CzEysb7A.js +108 -0
  17. package/dist/2d-DCxS_sb_.cjs +107 -0
  18. package/dist/2d.cjs +24 -88
  19. package/dist/2d.d.ts +1 -1
  20. package/dist/2d.js +34 -99
  21. package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-BoC0DsDm.cjs} +15 -45
  22. package/dist/{Blueprint-DbVaf6k7.js → Blueprint-CQNRtmYG.js} +33 -63
  23. package/dist/{boolean2D-y3E92F0u.js → boolean2D-DXAt4GAK.js} +132 -62
  24. package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-N9Pgumgg.cjs} +112 -42
  25. package/dist/{booleanFns-BCTjYZAg.js → booleanFns-BXV7Oh0h.js} +53 -50
  26. package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-CxArUj_q.cjs} +43 -40
  27. package/dist/brepjs.cjs +448 -379
  28. package/dist/brepjs.js +1634 -1563
  29. package/dist/core/dimensionTypes.d.ts +52 -0
  30. package/dist/core/dimensionTypes.d.ts.map +1 -0
  31. package/dist/core/disposal.d.ts +18 -0
  32. package/dist/core/disposal.d.ts.map +1 -1
  33. package/dist/core/errors.d.ts +7 -8
  34. package/dist/core/errors.d.ts.map +1 -1
  35. package/dist/core/kernelErrorTranslation.d.ts +15 -0
  36. package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
  37. package/dist/core/planeOps.d.ts +14 -0
  38. package/dist/core/planeOps.d.ts.map +1 -1
  39. package/dist/core/result.d.ts +4 -0
  40. package/dist/core/result.d.ts.map +1 -1
  41. package/dist/core/shapeTypes.d.ts +14 -146
  42. package/dist/core/shapeTypes.d.ts.map +1 -1
  43. package/dist/core/{definitionMaps.d.ts → typeDiscriminants.d.ts} +5 -1
  44. package/dist/core/typeDiscriminants.d.ts.map +1 -0
  45. package/dist/core/validityTypes.d.ts +100 -0
  46. package/dist/core/validityTypes.d.ts.map +1 -0
  47. package/dist/core.cjs +52 -11
  48. package/dist/core.d.ts +1 -1
  49. package/dist/core.d.ts.map +1 -1
  50. package/dist/core.js +119 -76
  51. package/dist/{curveFns-BZngcnQ1.cjs → curveFns-CWZRuXQ3.cjs} +2 -2
  52. package/dist/{curveFns-mROFhiuG.js → curveFns-OmbtFSG8.js} +14 -14
  53. package/dist/{drawFns-Bwakrq7w.js → drawFns-8S0ULGRj.js} +146 -118
  54. package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-voV2wEp8.cjs} +153 -125
  55. package/dist/{faceFns-B8GnxjdY.js → faceFns-Bn2seBfp.js} +16 -24
  56. package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-CmIrjdt1.cjs} +2 -10
  57. package/dist/{helpers-X0juxnwj.js → helpers-CEn618MW.js} +89 -21
  58. package/dist/{helpers-C8NoT0Wu.cjs → helpers-mipaxDTy.cjs} +77 -9
  59. package/dist/index.d.ts +20 -19
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/io/gltfImportFns.d.ts +18 -0
  62. package/dist/io/gltfImportFns.d.ts.map +1 -0
  63. package/dist/io/ioUtils.d.ts +16 -0
  64. package/dist/io/ioUtils.d.ts.map +1 -0
  65. package/dist/io/objImportFns.d.ts.map +1 -1
  66. package/dist/io/threemfImportFns.d.ts.map +1 -1
  67. package/dist/io.cjs +4 -4
  68. package/dist/io.js +4 -4
  69. package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
  70. package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
  71. package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
  72. package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
  73. package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
  74. package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
  75. package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
  76. package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
  77. package/dist/kernel/brepkit/helpers.d.ts +84 -0
  78. package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
  79. package/dist/kernel/brepkit/internalOps.d.ts +28 -0
  80. package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
  81. package/dist/kernel/brepkit/ioOps.d.ts +43 -0
  82. package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
  83. package/dist/kernel/brepkit/measureOps.d.ts +30 -0
  84. package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
  85. package/dist/kernel/brepkit/meshOps.d.ts +7 -0
  86. package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
  87. package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
  88. package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
  89. package/dist/kernel/brepkit/repairOps.d.ts +14 -0
  90. package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
  91. package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
  92. package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
  93. package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
  94. package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
  95. package/dist/kernel/brepkit/transformOps.d.ts +14 -0
  96. package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
  97. package/dist/kernel/brepkitAdapter.d.ts +1 -1
  98. package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
  99. package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
  100. package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
  101. package/dist/kernel/defaultAdapter.d.ts.map +1 -1
  102. package/dist/kernel/extendedConstructorOps.d.ts +9 -1
  103. package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
  104. package/dist/kernel/index.d.ts +1 -0
  105. package/dist/kernel/index.d.ts.map +1 -1
  106. package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
  107. package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
  108. package/dist/kernel/interfaces/builder-ops.d.ts +57 -0
  109. package/dist/kernel/interfaces/builder-ops.d.ts.map +1 -0
  110. package/dist/kernel/interfaces/core.d.ts +30 -0
  111. package/dist/kernel/interfaces/core.d.ts.map +1 -0
  112. package/dist/kernel/interfaces/curve-ops.d.ts +41 -0
  113. package/dist/kernel/interfaces/curve-ops.d.ts.map +1 -0
  114. package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
  115. package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
  116. package/dist/kernel/interfaces/index.d.ts +37 -0
  117. package/dist/kernel/interfaces/index.d.ts.map +1 -0
  118. package/dist/kernel/interfaces/io-ops.d.ts +66 -0
  119. package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
  120. package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
  121. package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
  122. package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
  123. package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
  124. package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
  125. package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
  126. package/dist/kernel/interfaces/primitive-ops.d.ts +13 -0
  127. package/dist/kernel/interfaces/primitive-ops.d.ts.map +1 -0
  128. package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
  129. package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
  130. package/dist/kernel/interfaces/surface-ops.d.ts +50 -0
  131. package/dist/kernel/interfaces/surface-ops.d.ts.map +1 -0
  132. package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
  133. package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
  134. package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
  135. package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
  136. package/dist/kernel/interfaces/transform-ops.d.ts +35 -0
  137. package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
  138. package/dist/kernel/modifierOps.d.ts +2 -2
  139. package/dist/kernel/modifierOps.d.ts.map +1 -1
  140. package/dist/kernel/types.d.ts +2 -446
  141. package/dist/kernel/types.d.ts.map +1 -1
  142. package/dist/measurement/measureCache.d.ts +11 -9
  143. package/dist/measurement/measureCache.d.ts.map +1 -1
  144. package/dist/measurement/measureFns.d.ts +24 -71
  145. package/dist/measurement/measureFns.d.ts.map +1 -1
  146. package/dist/measurement/measureTypes.d.ts +30 -0
  147. package/dist/measurement/measureTypes.d.ts.map +1 -0
  148. package/dist/{measurement-D8EJ694A.js → measurement-fJWDEpz0.js} +53 -34
  149. package/dist/measurement-ph-kanQ7.cjs +154 -0
  150. package/dist/measurement.cjs +2 -1
  151. package/dist/measurement.d.ts +1 -1
  152. package/dist/measurement.d.ts.map +1 -1
  153. package/dist/measurement.js +4 -3
  154. package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-B9p4EVV8.cjs} +4 -4
  155. package/dist/{meshFns-nQjK38EC.js → meshFns-D0qIoxm-.js} +3 -3
  156. package/dist/operations/compoundOpsFns.d.ts +38 -0
  157. package/dist/operations/compoundOpsFns.d.ts.map +1 -0
  158. package/dist/operations/convexHullFns.d.ts +21 -0
  159. package/dist/operations/convexHullFns.d.ts.map +1 -0
  160. package/dist/operations/extrudeFns.d.ts +2 -93
  161. package/dist/operations/extrudeFns.d.ts.map +1 -1
  162. package/dist/operations/guidedSweepFns.d.ts +3 -22
  163. package/dist/operations/guidedSweepFns.d.ts.map +1 -1
  164. package/dist/operations/multiSweepFns.d.ts +3 -29
  165. package/dist/operations/multiSweepFns.d.ts.map +1 -1
  166. package/dist/operations/roofFns.d.ts +2 -2
  167. package/dist/operations/roofFns.d.ts.map +1 -1
  168. package/dist/operations/straightSkeleton.d.ts.map +1 -1
  169. package/dist/operations/sweepFns.d.ts +121 -0
  170. package/dist/operations/sweepFns.d.ts.map +1 -0
  171. package/dist/{operations-BfbkK6DU.js → operations-DX_qy_TB.js} +29 -177
  172. package/dist/{operations-CYpmLSC4.cjs → operations-Ds4xoyxR.cjs} +6 -154
  173. package/dist/operations.cjs +6 -10
  174. package/dist/operations.d.ts +0 -2
  175. package/dist/operations.d.ts.map +1 -1
  176. package/dist/operations.js +26 -30
  177. package/dist/originTrackingFns-BOCAMfd0.js +137 -0
  178. package/dist/originTrackingFns-SPU7ly3_.cjs +136 -0
  179. package/dist/query/edgeFinder.d.ts +4 -14
  180. package/dist/query/edgeFinder.d.ts.map +1 -1
  181. package/dist/query/faceFinder.d.ts +4 -14
  182. package/dist/query/faceFinder.d.ts.map +1 -1
  183. package/dist/query/finderCore.d.ts +6 -0
  184. package/dist/query/finderCore.d.ts.map +1 -1
  185. package/dist/query/shapeFinders.d.ts +32 -0
  186. package/dist/query/shapeFinders.d.ts.map +1 -0
  187. package/dist/query/wireFinder.d.ts +4 -9
  188. package/dist/query/wireFinder.d.ts.map +1 -1
  189. package/dist/query.cjs +54 -32
  190. package/dist/query.js +56 -34
  191. package/dist/{result-BaSD1fqR.js → result-CoDaWsvc.js} +48 -90
  192. package/dist/{result-fAX0OZzI.cjs → result-DULetAht.cjs} +17 -59
  193. package/dist/result.cjs +1 -1
  194. package/dist/result.js +23 -23
  195. package/dist/shapeFns-BZ6zk7nd.js +34 -0
  196. package/dist/shapeFns-bRkrwI8R.cjs +33 -0
  197. package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-T0n6mRmt.cjs} +170 -137
  198. package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-dhhm-T5A.js} +205 -172
  199. package/dist/sketching/CompoundSketch.d.ts +4 -4
  200. package/dist/sketching/CompoundSketch.d.ts.map +1 -1
  201. package/dist/sketching/Sketch.d.ts +3 -3
  202. package/dist/sketching/Sketch.d.ts.map +1 -1
  203. package/dist/sketching/Sketcher.d.ts.map +1 -1
  204. package/dist/sketching/Sketches.d.ts +1 -1
  205. package/dist/sketching/Sketches.d.ts.map +1 -1
  206. package/dist/sketching/draw.d.ts +1 -20
  207. package/dist/sketching/draw.d.ts.map +1 -1
  208. package/dist/sketching/draw3d.d.ts +22 -0
  209. package/dist/sketching/draw3d.d.ts.map +1 -0
  210. package/dist/sketching/sketchFns.d.ts +3 -3
  211. package/dist/sketching/sketchFns.d.ts.map +1 -1
  212. package/dist/sketching/sketchLib.d.ts +2 -2
  213. package/dist/sketching/sketchLib.d.ts.map +1 -1
  214. package/dist/sketching.cjs +2 -2
  215. package/dist/sketching.d.ts +2 -1
  216. package/dist/sketching.d.ts.map +1 -1
  217. package/dist/sketching.js +2 -2
  218. package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BEAoLYvr.cjs} +3 -3
  219. package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-tVmD3R7Z.js} +12 -12
  220. package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-DYS8AMSS.cjs} +3 -3
  221. package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dl0ATFbO.js} +15 -15
  222. package/dist/sweepFns-BKnQs59A.js +215 -0
  223. package/dist/sweepFns-COqeYIUp.cjs +214 -0
  224. package/dist/text/textBlueprints.d.ts +4 -3
  225. package/dist/text/textBlueprints.d.ts.map +1 -1
  226. package/dist/topology/booleanFns.d.ts.map +1 -1
  227. package/dist/topology/cast.d.ts +1 -5
  228. package/dist/topology/cast.d.ts.map +1 -1
  229. package/dist/topology/compoundOpsFns.d.ts +3 -35
  230. package/dist/topology/compoundOpsFns.d.ts.map +1 -1
  231. package/dist/topology/curveFns.d.ts +1 -1
  232. package/dist/topology/curveFns.d.ts.map +1 -1
  233. package/dist/topology/index.d.ts +2 -3
  234. package/dist/topology/index.d.ts.map +1 -1
  235. package/dist/topology/{colorFns.d.ts → metadata/colorFns.d.ts} +2 -2
  236. package/dist/topology/metadata/colorFns.d.ts.map +1 -0
  237. package/dist/topology/{faceTagFns.d.ts → metadata/faceTagFns.d.ts} +2 -2
  238. package/dist/topology/metadata/faceTagFns.d.ts.map +1 -0
  239. package/dist/topology/metadata/metadataPropagation.d.ts +30 -0
  240. package/dist/topology/metadata/metadataPropagation.d.ts.map +1 -0
  241. package/dist/topology/metadata/originTrackingFns.d.ts +23 -0
  242. package/dist/topology/metadata/originTrackingFns.d.ts.map +1 -0
  243. package/dist/topology/modifierFns.d.ts.map +1 -1
  244. package/dist/topology/shapeFns.d.ts +6 -120
  245. package/dist/topology/shapeFns.d.ts.map +1 -1
  246. package/dist/topology/topologyQueryFns.d.ts +67 -0
  247. package/dist/topology/topologyQueryFns.d.ts.map +1 -0
  248. package/dist/topology/transformFns.d.ts +49 -0
  249. package/dist/topology/transformFns.d.ts.map +1 -0
  250. package/dist/topology/wrapperFns.d.ts.map +1 -1
  251. package/dist/{topology-C7x98OVn.js → topology-C1oUQXZS.js} +235 -50
  252. package/dist/{topology-ANwCzGL8.cjs → topology-xyDYbkHW.cjs} +205 -20
  253. package/dist/topology.cjs +18 -17
  254. package/dist/topology.js +97 -96
  255. package/dist/topologyQueryFns-0IptTUCo.cjs +118 -0
  256. package/dist/topologyQueryFns-Dj4Xd5kx.js +119 -0
  257. package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
  258. package/dist/utils/precisionRound.d.ts +4 -0
  259. package/dist/utils/precisionRound.d.ts.map +1 -1
  260. package/dist/utils/vec2d.d.ts +5 -0
  261. package/dist/utils/vec2d.d.ts.map +1 -1
  262. package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
  263. package/dist/{vectors-Bx8wkNui.js → vectors-B8juLsQB.js} +15 -7
  264. package/dist/{vectors-D_IiZx0q.cjs → vectors-I_0zdD3O.cjs} +9 -1
  265. package/dist/vectors.cjs +1 -1
  266. package/dist/vectors.js +23 -23
  267. package/package.json +9 -9
  268. package/dist/2d/blueprints/approximations.d.ts.map +0 -1
  269. package/dist/2d/blueprints/customCorners.d.ts.map +0 -1
  270. package/dist/2d/blueprints/offset.d.ts.map +0 -1
  271. package/dist/core/definitionMaps.d.ts.map +0 -1
  272. package/dist/core/geometryHelpers.d.ts +0 -30
  273. package/dist/core/geometryHelpers.d.ts.map +0 -1
  274. package/dist/core/memory.d.ts +0 -6
  275. package/dist/core/memory.d.ts.map +0 -1
  276. package/dist/core/typeErrors.d.ts +0 -17
  277. package/dist/core/typeErrors.d.ts.map +0 -1
  278. package/dist/cornerFinder-Ckz-mPHE.js +0 -59
  279. package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
  280. package/dist/loft-Bhw-FMoL.js +0 -228
  281. package/dist/loft-hp3pc1M7.cjs +0 -227
  282. package/dist/measurement-BoNTUBAp.cjs +0 -135
  283. package/dist/operations/extrude.d.ts +0 -72
  284. package/dist/operations/extrude.d.ts.map +0 -1
  285. package/dist/operations/loft.d.ts +0 -33
  286. package/dist/operations/loft.d.ts.map +0 -1
  287. package/dist/shapeFns-C2SnNvdH.cjs +0 -468
  288. package/dist/shapeFns-FDuKkrDR.js +0 -469
  289. package/dist/topology/colorFns.d.ts.map +0 -1
  290. package/dist/topology/faceTagFns.d.ts.map +0 -1
  291. package/dist/utils/round2.d.ts +0 -3
  292. package/dist/utils/round2.d.ts.map +0 -1
  293. package/dist/utils/round5.d.ts +0 -3
  294. package/dist/utils/round5.d.ts.map +0 -1
package/dist/brepjs.cjs CHANGED
@@ -45,31 +45,33 @@ var __callDispose = (stack, error, hasError) => {
45
45
  return next();
46
46
  };
47
47
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
48
- const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
49
- const result = require("./result-fAX0OZzI.cjs");
48
+ const shapeTypes = require("./shapeTypes-T0n6mRmt.cjs");
49
+ const result = require("./result-DULetAht.cjs");
50
50
  const vecOps = require("./vecOps-CjRL1jau.cjs");
51
- const Blueprint = require("./Blueprint-CQ28WJhz.cjs");
52
- const loft$2 = require("./loft-hp3pc1M7.cjs");
53
- const operations = require("./operations-CYpmLSC4.cjs");
54
- const boolean2D = require("./boolean2D-0blbVtJ8.cjs");
55
- const _2d = require("./2d.cjs");
56
- const helpers = require("./helpers-C8NoT0Wu.cjs");
51
+ const vectors = require("./vectors-I_0zdD3O.cjs");
52
+ const operations = require("./operations-Ds4xoyxR.cjs");
53
+ const Blueprint = require("./Blueprint-BoC0DsDm.cjs");
54
+ const boolean2D = require("./boolean2D-N9Pgumgg.cjs");
55
+ const _2d = require("./2d-DCxS_sb_.cjs");
56
+ const helpers = require("./helpers-mipaxDTy.cjs");
57
57
  const io = require("./io.cjs");
58
- const drawFns = require("./drawFns-CjRc1NfQ.cjs");
58
+ const drawFns = require("./drawFns-voV2wEp8.cjs");
59
59
  const types = require("./types-CA_xrgDq.cjs");
60
- const vectors = require("./vectors-D_IiZx0q.cjs");
61
- const shapeFns = require("./shapeFns-C2SnNvdH.cjs");
62
- const booleanFns = require("./booleanFns-gmsX3Cv2.cjs");
63
- const topology = require("./topology-ANwCzGL8.cjs");
64
- const curveFns = require("./curveFns-BZngcnQ1.cjs");
65
- const faceFns = require("./faceFns-DB1Fc5gy.cjs");
66
- const meshFns = require("./meshFns-BnV0ZR8w.cjs");
67
- const measurement = require("./measurement-BoNTUBAp.cjs");
68
- const surfaceBuilders = require("./surfaceBuilders-5VA34a3_.cjs");
60
+ const shapeFns = require("./shapeFns-bRkrwI8R.cjs");
61
+ const booleanFns = require("./booleanFns-CxArUj_q.cjs");
62
+ const topology = require("./topology-xyDYbkHW.cjs");
63
+ const curveFns = require("./curveFns-CWZRuXQ3.cjs");
64
+ const faceFns = require("./faceFns-CmIrjdt1.cjs");
65
+ const meshFns = require("./meshFns-B9p4EVV8.cjs");
66
+ const topologyQueryFns = require("./topologyQueryFns-0IptTUCo.cjs");
67
+ const measurement = require("./measurement-ph-kanQ7.cjs");
68
+ const surfaceBuilders = require("./surfaceBuilders-DYS8AMSS.cjs");
69
+ const solidBuilders = require("./solidBuilders-BEAoLYvr.cjs");
70
+ const sweepFns = require("./sweepFns-COqeYIUp.cjs");
71
+ const core = require("./core.cjs");
69
72
  const query = require("./query.cjs");
70
- const solidBuilders = require("./solidBuilders-994_MQwB.cjs");
71
- const cornerFinder = require("./cornerFinder-ZmOyOOsh.cjs");
72
73
  const worker = require("./worker.cjs");
74
+ const originTrackingFns = require("./originTrackingFns-SPU7ly3_.cjs");
73
75
  function supportsProjection(kernel) {
74
76
  return "projectShape" in kernel;
75
77
  }
@@ -850,6 +852,30 @@ function warnOnce(key, message) {
850
852
  _warned.add(key);
851
853
  console.warn(`brepkit: ${message}`);
852
854
  }
855
+ function mapNumericTransition(mode) {
856
+ switch (mode) {
857
+ case 0:
858
+ return "rmf";
859
+ case 1:
860
+ return "rightCorner";
861
+ case 2:
862
+ return "roundCorner";
863
+ default:
864
+ return void 0;
865
+ }
866
+ }
867
+ function mapStringTransition(mode) {
868
+ switch (mode) {
869
+ case "right":
870
+ return "rightCorner";
871
+ case "round":
872
+ return "roundCorner";
873
+ case "transformed":
874
+ return "rmf";
875
+ default:
876
+ return void 0;
877
+ }
878
+ }
853
879
  function hasBooleanOptions(opts) {
854
880
  return opts.optimisation !== void 0 || opts.simplify !== void 0 || opts.strategy !== void 0 || opts.fuzzyValue !== void 0;
855
881
  }
@@ -1412,19 +1438,33 @@ class BrepkitAdapter {
1412
1438
  const id = this.bk.loft(faceIds);
1413
1439
  return solidHandle(id);
1414
1440
  }
1415
- sweep(wire, spine, _options) {
1416
- if (_options?.transitionMode !== void 0) {
1417
- warnOnce("sweep-transition", "Sweep transition mode not supported; ignored.");
1418
- }
1441
+ sweep(wire, spine, options) {
1442
+ const contactMode = options?.transitionMode !== void 0 ? mapNumericTransition(options.transitionMode) : void 0;
1419
1443
  const profileHandle = wire;
1420
1444
  const faceId = profileHandle.type === "wire" ? this.bk.makeFaceFromWire(profileHandle.id) : unwrap(wire, "face");
1421
1445
  const spineHandle = spine;
1422
1446
  if (spineHandle.type === "wire") {
1423
1447
  const edges = this.iterShapes(spine, "edge");
1424
1448
  const edgeIds = edges.map((e) => unwrap(e, "edge"));
1449
+ if (contactMode && edgeIds.length === 1) {
1450
+ const edgeId = edgeIds[0];
1451
+ if (edgeId !== void 0) {
1452
+ return solidHandle(this.bk.sweepWithOptions(faceId, edgeId, contactMode, [], 0));
1453
+ }
1454
+ }
1455
+ if (contactMode && edgeIds.length > 1) {
1456
+ warnOnce(
1457
+ "sweep-transition-multi-edge",
1458
+ "Sweep transition mode not supported for multi-edge wires; ignored."
1459
+ );
1460
+ }
1425
1461
  const id2 = this.bk.sweepAlongEdges(faceId, edgeIds);
1426
1462
  return solidHandle(id2);
1427
1463
  }
1464
+ if (contactMode) {
1465
+ const edgeId = unwrap(spine, "edge");
1466
+ return solidHandle(this.bk.sweepWithOptions(faceId, edgeId, contactMode, [], 0));
1467
+ }
1428
1468
  const nurbsData = this.extractNurbsFromEdge(spine);
1429
1469
  if (!nurbsData) {
1430
1470
  throw new Error("brepkit: sweep spine must be an edge or wire");
@@ -1485,25 +1525,58 @@ class BrepkitAdapter {
1485
1525
  return solidHandle(this.bk.filletVariable(solidId, JSON.stringify(spec)));
1486
1526
  }
1487
1527
  chamfer(shape2, edges, distance) {
1488
- const d = typeof distance === "number" ? distance : Array.isArray(distance) ? distance[0] : 1;
1489
- if (typeof distance !== "number") {
1490
- warnOnce(
1491
- "chamfer-asymmetric",
1492
- typeof distance === "function" ? "Per-edge chamfer distance function not supported; falling back to distance=1." : "Asymmetric chamfer not supported; using first distance only."
1493
- );
1494
- }
1528
+ const solidId = unwrapSolidOrThrow(shape2, "chamfer");
1495
1529
  const edgeIds = edges.map((e) => unwrap(e, "edge"));
1496
- const id = this.bk.chamfer(unwrapSolidOrThrow(shape2, "chamfer"), edgeIds, d);
1497
- return solidHandle(id);
1530
+ if (typeof distance === "number") {
1531
+ return solidHandle(this.bk.chamfer(solidId, edgeIds, distance));
1532
+ }
1533
+ if (Array.isArray(distance)) {
1534
+ const [d1, d2] = distance;
1535
+ if (typeof this.bk.chamferAsymmetric === "function") {
1536
+ return solidHandle(this.bk.chamferAsymmetric(solidId, edgeIds, d1, d2));
1537
+ }
1538
+ warnOnce("chamfer-asymmetric", "chamferAsymmetric not available; using averaged distance.");
1539
+ return solidHandle(this.bk.chamfer(solidId, edgeIds, (d1 + d2) / 2));
1540
+ }
1541
+ const groups = /* @__PURE__ */ new Map();
1542
+ for (const [i, edge] of edges.entries()) {
1543
+ const r = distance(edge);
1544
+ const eid = edgeIds[i];
1545
+ if (eid === void 0) continue;
1546
+ const [d1, d2] = Array.isArray(r) ? r : [r, r];
1547
+ const key = `${d1},${d2}`;
1548
+ const group = groups.get(key);
1549
+ if (group) {
1550
+ group.ids.push(eid);
1551
+ } else {
1552
+ groups.set(key, { ids: [eid], d1, d2 });
1553
+ }
1554
+ }
1555
+ let result2 = solidId;
1556
+ for (const group of groups.values()) {
1557
+ if (group.d1 === group.d2) {
1558
+ result2 = this.bk.chamfer(result2, group.ids, group.d1);
1559
+ } else if (typeof this.bk.chamferAsymmetric === "function") {
1560
+ result2 = this.bk.chamferAsymmetric(result2, group.ids, group.d1, group.d2);
1561
+ } else {
1562
+ warnOnce(
1563
+ "chamfer-callback",
1564
+ "chamferAsymmetric not available; asymmetric edges use averaged distance."
1565
+ );
1566
+ result2 = this.bk.chamfer(result2, group.ids, (group.d1 + group.d2) / 2);
1567
+ }
1568
+ }
1569
+ return solidHandle(result2);
1498
1570
  }
1499
1571
  chamferDistAngle(shape2, edges, distance, angleDeg) {
1500
- warnOnce(
1501
- "chamfer-dist-angle",
1502
- "Distance-angle chamfer approximated as averaged two-distance chamfer."
1503
- );
1504
1572
  const d2 = distance * Math.tan(angleDeg * Math.PI / 180);
1505
- const avgDist = (distance + d2) / 2;
1506
- return this.chamfer(shape2, edges, avgDist);
1573
+ const solidId = unwrapSolidOrThrow(shape2, "chamferDistAngle");
1574
+ const edgeIds = edges.map((e) => unwrap(e, "edge"));
1575
+ if (typeof this.bk.chamferAsymmetric === "function") {
1576
+ return solidHandle(this.bk.chamferAsymmetric(solidId, edgeIds, distance, d2));
1577
+ }
1578
+ warnOnce("chamfer-dist-angle", "chamferAsymmetric not available; using averaged distance.");
1579
+ return solidHandle(this.bk.chamfer(solidId, edgeIds, (distance + d2) / 2));
1507
1580
  }
1508
1581
  shell(shape2, faces, thickness, tolerance) {
1509
1582
  if (tolerance !== void 0) {
@@ -1536,6 +1609,49 @@ class BrepkitAdapter {
1536
1609
  if (bestMatch >= 0 && bestDot > 0.99) return bestMatch;
1537
1610
  } catch {
1538
1611
  }
1612
+ try {
1613
+ const origVerts = toArray(this.bk.getFaceVertices(fid));
1614
+ if (origVerts.length >= 1) {
1615
+ let ox = 0, oy = 0, oz = 0;
1616
+ for (const vid of origVerts) {
1617
+ const pos = this.bk.getVertexPosition(vid);
1618
+ ox += pos[0];
1619
+ oy += pos[1];
1620
+ oz += pos[2];
1621
+ }
1622
+ const n = origVerts.length;
1623
+ ox /= n;
1624
+ oy /= n;
1625
+ oz /= n;
1626
+ let bestCentroidMatch = -1;
1627
+ let bestCentroidDist = Infinity;
1628
+ for (const sf of solidFaces) {
1629
+ try {
1630
+ const sv = toArray(this.bk.getFaceVertices(sf));
1631
+ if (sv.length < 1) continue;
1632
+ let sx = 0, sy = 0, sz = 0;
1633
+ for (const svid of sv) {
1634
+ const spos = this.bk.getVertexPosition(svid);
1635
+ sx += spos[0];
1636
+ sy += spos[1];
1637
+ sz += spos[2];
1638
+ }
1639
+ const sn = sv.length;
1640
+ sx /= sn;
1641
+ sy /= sn;
1642
+ sz /= sn;
1643
+ const dist = Math.sqrt((ox - sx) ** 2 + (oy - sy) ** 2 + (oz - sz) ** 2);
1644
+ if (dist < bestCentroidDist) {
1645
+ bestCentroidDist = dist;
1646
+ bestCentroidMatch = sf;
1647
+ }
1648
+ } catch {
1649
+ }
1650
+ }
1651
+ if (bestCentroidMatch >= 0 && bestCentroidDist < 1e-3) return bestCentroidMatch;
1652
+ }
1653
+ } catch {
1654
+ }
1539
1655
  return fid;
1540
1656
  });
1541
1657
  const id = this.bk.shell(solidId, thickness, resolvedFaceIds);
@@ -2836,20 +2952,22 @@ class BrepkitAdapter {
2836
2952
  // Serialization
2837
2953
  // ═══════════════════════════════════════════════════════════════════════
2838
2954
  toBREP(shape2) {
2839
- warnOnce(
2840
- "brep-format",
2841
- "toBREP/fromBREP uses STEP format (not OCCT BREP). Cross-kernel BREP round-trips are not supported."
2842
- );
2955
+ const h = shape2;
2956
+ if (h.type === "solid") {
2957
+ return this.bk.toBREP(h.id);
2958
+ }
2959
+ warnOnce("brep-non-solid", "toBREP for non-solid shapes uses STEP format.");
2843
2960
  return this.exportSTEP([shape2]);
2844
2961
  }
2845
2962
  fromBREP(data) {
2846
- warnOnce(
2847
- "brep-format",
2848
- "toBREP/fromBREP uses STEP format (not OCCT BREP). Cross-kernel BREP round-trips are not supported."
2849
- );
2963
+ if (typeof this.bk.fromBREP === "function" && data.trimStart().startsWith("{")) {
2964
+ const id = this.bk.fromBREP(data);
2965
+ return solidHandle(id);
2966
+ }
2850
2967
  const shapes = this.importSTEP(data);
2851
- if (shapes.length === 0) throw new Error("brepkit: fromBREP produced no shapes");
2852
- return shapes[0];
2968
+ const first = shapes[0];
2969
+ if (!first) throw new Error("brepkit: fromBREP produced no shapes");
2970
+ return first;
2853
2971
  }
2854
2972
  // ═══════════════════════════════════════════════════════════════════════
2855
2973
  // Mesh preparation
@@ -2882,6 +3000,49 @@ class BrepkitAdapter {
2882
3000
  const profileHandle = profile;
2883
3001
  const faceId = profileHandle.type === "wire" ? this.bk.makeFaceFromWire(profileHandle.id) : unwrap(profile, "face");
2884
3002
  const shellMode = !!(options && options["shellMode"]);
3003
+ const transitionMode = options?.["transitionMode"];
3004
+ const contactMode = transitionMode ? mapStringTransition(transitionMode) : void 0;
3005
+ if (contactMode) {
3006
+ const spineHandle = spine;
3007
+ if (spineHandle.type !== "wire") {
3008
+ try {
3009
+ const edgeId = unwrap(spine, "edge");
3010
+ const shape22 = solidHandle(this.bk.sweepWithOptions(faceId, edgeId, contactMode, [], 0));
3011
+ if (shellMode) return { shape: shape22, firstShape: profile, lastShape: profile };
3012
+ return shape22;
3013
+ } catch (e) {
3014
+ console.warn(
3015
+ "brepkit: sweepWithOptions failed, falling back to sweepSmooth/simplePipe:",
3016
+ e
3017
+ );
3018
+ }
3019
+ } else {
3020
+ const edges = this.iterShapes(spine, "edge");
3021
+ if (edges.length === 1) {
3022
+ const first = edges[0];
3023
+ if (first) {
3024
+ try {
3025
+ const edgeId = unwrap(first, "edge");
3026
+ const shape22 = solidHandle(
3027
+ this.bk.sweepWithOptions(faceId, edgeId, contactMode, [], 0)
3028
+ );
3029
+ if (shellMode) return { shape: shape22, firstShape: profile, lastShape: profile };
3030
+ return shape22;
3031
+ } catch (e) {
3032
+ console.warn(
3033
+ "brepkit: sweepWithOptions failed, falling back to sweepSmooth/simplePipe:",
3034
+ e
3035
+ );
3036
+ }
3037
+ }
3038
+ } else {
3039
+ warnOnce(
3040
+ "sweepPipeShell-transition-multi-edge",
3041
+ "sweepPipeShell transition mode not supported for multi-edge wires; ignored."
3042
+ );
3043
+ }
3044
+ }
3045
+ }
2885
3046
  const nurbsData = this.extractNurbsFromEdge(spine);
2886
3047
  if (nurbsData && nurbsData.degree > 1) {
2887
3048
  try {
@@ -4682,6 +4843,64 @@ function multiplyMatrices(a, b) {
4682
4843
  }
4683
4844
  return result2;
4684
4845
  }
4846
+ const kernel_ERROR_PATTERNS = [
4847
+ {
4848
+ pattern: /invalid edge configuration|edges?.*(not|fail|invalid)/i,
4849
+ translation: "The edges may not form a continuous loop. Check that edges connect end-to-end without gaps."
4850
+ },
4851
+ {
4852
+ pattern: /BRepAlgoAPI.*failed|boolean.*operation.*failed/i,
4853
+ translation: "Boolean operation failed. Common causes: overlapping faces, zero-thickness geometry, or degenerate shapes. Try healing input shapes first."
4854
+ },
4855
+ {
4856
+ pattern: /fillet.*radius.*too.*large|fillet.*failed/i,
4857
+ translation: "Fillet operation failed. The radius may be too large for the selected edges. Try reducing the radius or check that edges have enough room."
4858
+ },
4859
+ {
4860
+ pattern: /chamfer.*failed|chamfer.*distance.*too.*large/i,
4861
+ translation: "Chamfer operation failed. The distance may be too large for the selected edges. Try reducing the distance or check edge geometry."
4862
+ },
4863
+ {
4864
+ pattern: /shell.*failed|offset.*failed/i,
4865
+ translation: "Shell/offset operation failed. The thickness may be too large, or the shape may have complex geometry. Try reducing thickness."
4866
+ },
4867
+ {
4868
+ pattern: /sweep.*failed|pipe.*failed/i,
4869
+ translation: "Sweep operation failed. Check that the profile and spine are compatible, and that the spine has no sharp twists or self-intersections."
4870
+ },
4871
+ {
4872
+ pattern: /loft.*failed/i,
4873
+ translation: "Loft operation failed. Profiles may be incompatible or have different orientations. Ensure profiles are ordered consistently."
4874
+ },
4875
+ {
4876
+ pattern: /extrude.*failed|prism.*failed/i,
4877
+ translation: "Extrusion failed. The profile may be invalid or self-intersecting. Check that the profile forms a valid closed wire."
4878
+ },
4879
+ {
4880
+ pattern: /revolve.*failed|revolution.*failed/i,
4881
+ translation: "Revolution operation failed. The profile may intersect the axis of revolution, or the angle may be invalid."
4882
+ },
4883
+ {
4884
+ pattern: /self.*intersect|self-intersect/i,
4885
+ translation: "Shape has self-intersections. The operation resulted in overlapping geometry. Simplify the input or adjust parameters."
4886
+ },
4887
+ {
4888
+ pattern: /degener|degenerat/i,
4889
+ translation: "Degenerate geometry detected. The shape has edges or faces with zero length/area. Check input geometry for collapsed elements."
4890
+ },
4891
+ {
4892
+ pattern: /BRepCheck.*fail|shape.*invalid|shape.*not.*valid/i,
4893
+ translation: "Shape validation failed. The resulting shape has invalid topology. Try healing the shape or checking input geometry."
4894
+ }
4895
+ ];
4896
+ function translateKernelError(kernelMessage) {
4897
+ for (const { pattern, translation } of kernel_ERROR_PATTERNS) {
4898
+ if (pattern.test(kernelMessage)) {
4899
+ return `${translation} (kernel: ${kernelMessage})`;
4900
+ }
4901
+ }
4902
+ return kernelMessage;
4903
+ }
4685
4904
  const errorFactories = {
4686
4905
  KERNEL_OPERATION: (code, message, cause) => ({ kind: "KERNEL_OPERATION", code, message, cause }),
4687
4906
  VALIDATION: (code, message, cause) => ({ kind: "VALIDATION", code, message, cause }),
@@ -4700,7 +4919,7 @@ function kernelCall(fn, code, message, kind = "KERNEL_OPERATION") {
4700
4919
  return result.ok(shapeTypes.castShape(fn()));
4701
4920
  } catch (e) {
4702
4921
  const rawMessage = e instanceof Error ? e.message : String(e);
4703
- const translatedMessage = kind === "KERNEL_OPERATION" ? result.translateKernelError(rawMessage) : rawMessage;
4922
+ const translatedMessage = kind === "KERNEL_OPERATION" ? translateKernelError(rawMessage) : rawMessage;
4704
4923
  return result.err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e));
4705
4924
  }
4706
4925
  }
@@ -4709,7 +4928,7 @@ function kernelCallRaw(fn, code, message, kind = "KERNEL_OPERATION") {
4709
4928
  return result.ok(fn());
4710
4929
  } catch (e) {
4711
4930
  const rawMessage = e instanceof Error ? e.message : String(e);
4712
- const translatedMessage = kind === "KERNEL_OPERATION" ? result.translateKernelError(rawMessage) : rawMessage;
4931
+ const translatedMessage = kind === "KERNEL_OPERATION" ? translateKernelError(rawMessage) : rawMessage;
4713
4932
  return result.err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e));
4714
4933
  }
4715
4934
  }
@@ -4724,32 +4943,6 @@ function kernelCallScoped(fn, code, message, kind = "KERNEL_OPERATION") {
4724
4943
  __callDispose(_stack, _error, _hasError);
4725
4944
  }
4726
4945
  }
4727
- const CURVE_TYPE_BY_INT = [
4728
- "LINE",
4729
- // 0
4730
- "CIRCLE",
4731
- // 1
4732
- "ELLIPSE",
4733
- // 2
4734
- "HYPERBOLA",
4735
- // 3
4736
- "PARABOLA",
4737
- // 4
4738
- "BEZIER_CURVE",
4739
- // 5
4740
- "BSPLINE_CURVE",
4741
- // 6
4742
- "OFFSET_CURVE",
4743
- // 7
4744
- "OTHER_CURVE"
4745
- // 8
4746
- ];
4747
- const findCurveType = (type) => {
4748
- const idx = typeof type === "number" ? type : Number(type?.value ?? type);
4749
- const curveType = CURVE_TYPE_BY_INT[idx];
4750
- if (!curveType) return result.err(result.typeCastError("UNKNOWN_CURVE_TYPE", "Unknown curve type"));
4751
- return result.ok(curveType);
4752
- };
4753
4946
  const BOPAlgo_GlueShift = 1;
4754
4947
  const BOPAlgo_GlueFull = 2;
4755
4948
  function applyGlue(op, optimisation) {
@@ -4778,35 +4971,14 @@ function isFilletRadius(r) {
4778
4971
  }
4779
4972
  return false;
4780
4973
  }
4781
- function buildWireFinder(filters) {
4782
- return helpers.createTypedFinder(
4783
- "wire",
4784
- filters,
4785
- buildWireFinder,
4786
- (_base, withFilter) => ({
4787
- isClosed: () => withFilter((wire) => curveFns.curveIsClosed(wire)),
4788
- isOpen: () => withFilter((wire) => !curveFns.curveIsClosed(wire)),
4789
- ofEdgeCount: (count) => withFilter((wire) => {
4790
- let edgeCount = 0;
4791
- for (const _raw of faceFns.iterTopo(wire.wrapped, "edge")) {
4792
- edgeCount++;
4793
- }
4794
- return edgeCount === count;
4795
- })
4796
- })
4797
- );
4798
- }
4799
- function wireFinder() {
4800
- return buildWireFinder([]);
4801
- }
4802
4974
  function withNearestPostFilter(baseFinder, nearestPoint) {
4803
4975
  const findAllNearest = (shape2) => {
4804
4976
  const candidates = baseFinder.findAll(shape2);
4805
4977
  if (candidates.length === 0) return [];
4806
4978
  let bestIdx = 0;
4807
- let bestDist = vecOps.vecDistance(shapeFns.vertexPosition(candidates[0]), nearestPoint);
4979
+ let bestDist = vecOps.vecDistance(topologyQueryFns.vertexPosition(candidates[0]), nearestPoint);
4808
4980
  for (let i = 1; i < candidates.length; i++) {
4809
- const d = vecOps.vecDistance(shapeFns.vertexPosition(candidates[i]), nearestPoint);
4981
+ const d = vecOps.vecDistance(topologyQueryFns.vertexPosition(candidates[i]), nearestPoint);
4810
4982
  if (d < bestDist) {
4811
4983
  bestDist = d;
4812
4984
  bestIdx = i;
@@ -4836,13 +5008,13 @@ function buildVertexFinder(filters) {
4836
5008
  buildVertexFinder,
4837
5009
  (_base, withFilter) => ({
4838
5010
  nearestTo: (point) => withNearestPostFilter(buildVertexFinder(filters), point),
4839
- atPosition: (point, tolerance = 1e-4) => withFilter((vertex) => vecOps.vecDistance(shapeFns.vertexPosition(vertex), point) < tolerance),
5011
+ atPosition: (point, tolerance = 1e-4) => withFilter((vertex) => vecOps.vecDistance(topologyQueryFns.vertexPosition(vertex), point) < tolerance),
4840
5012
  withinBox: (min, max) => withFilter((vertex) => {
4841
- const pos = shapeFns.vertexPosition(vertex);
5013
+ const pos = topologyQueryFns.vertexPosition(vertex);
4842
5014
  return pos[0] >= min[0] - 1e-6 && pos[0] <= max[0] + 1e-6 && pos[1] >= min[1] - 1e-6 && pos[1] <= max[1] + 1e-6 && pos[2] >= min[2] - 1e-6 && pos[2] <= max[2] + 1e-6;
4843
5015
  }),
4844
5016
  atDistance: (distance, point = [0, 0, 0], tolerance = 1e-4) => withFilter((vertex) => {
4845
- const pos = shapeFns.vertexPosition(vertex);
5017
+ const pos = topologyQueryFns.vertexPosition(vertex);
4846
5018
  return Math.abs(vecOps.vecDistance(pos, point) - distance) < tolerance;
4847
5019
  })
4848
5020
  })
@@ -5111,8 +5283,42 @@ function hull(shapes, options = {}) {
5111
5283
  return result.err(result.kernelError(result.BrepErrorCode.HULL_FAILED, `Hull operation failed: ${raw}`, e));
5112
5284
  }
5113
5285
  }
5286
+ function convexHull(points) {
5287
+ if (points.length < 4) {
5288
+ return result.err(
5289
+ result.validationError(
5290
+ result.BrepErrorCode.HULL_EMPTY_INPUT,
5291
+ `convexHull: at least 4 points required, got ${points.length}`,
5292
+ void 0,
5293
+ void 0,
5294
+ "Provide 4 or more non-coplanar 3D points"
5295
+ )
5296
+ );
5297
+ }
5298
+ try {
5299
+ const kernel = shapeTypes.getKernel();
5300
+ const objPoints = points.map((p) => ({ x: p[0], y: p[1], z: p[2] }));
5301
+ const result$1 = kernel.hullFromPoints(objPoints, 0.1);
5302
+ const cast = shapeTypes.castShape(result$1);
5303
+ if (!shapeTypes.isSolid(cast)) {
5304
+ return result.err(
5305
+ result.kernelError(
5306
+ result.BrepErrorCode.HULL_NOT_3D,
5307
+ "convexHull result is not a solid; points may be coplanar"
5308
+ )
5309
+ );
5310
+ }
5311
+ return result.ok(cast);
5312
+ } catch (e) {
5313
+ const raw = e instanceof Error ? e.message : String(e);
5314
+ if (raw.includes("coplanar") || raw.includes("fewer than") || raw.includes("degenerate")) {
5315
+ return result.err(result.kernelError(result.BrepErrorCode.HULL_DEGENERATE, `convexHull degenerate: ${raw}`, e));
5316
+ }
5317
+ return result.err(result.kernelError(result.BrepErrorCode.HULL_FAILED, `convexHull failed: ${raw}`, e));
5318
+ }
5319
+ }
5114
5320
  function detectSphere(shape2) {
5115
- const faces = shapeFns.getFaces(shape2);
5321
+ const faces = topologyQueryFns.getFaces(shape2);
5116
5322
  if (faces.length !== 1) return null;
5117
5323
  const face = faces[0];
5118
5324
  const surfType = shapeTypes.getKernel().surfaceType(face.wrapped);
@@ -5148,8 +5354,8 @@ function minkowskiSphere(shape2, radius, tolerance) {
5148
5354
  function minkowskiGeneral(shape2, tool, tolerance) {
5149
5355
  const kernel = shapeTypes.getKernel();
5150
5356
  try {
5151
- const shapeVerts = shapeFns.getVertices(shape2);
5152
- const toolVerts = shapeFns.getVertices(tool);
5357
+ const shapeVerts = topologyQueryFns.getVertices(shape2);
5358
+ const toolVerts = topologyQueryFns.getVertices(tool);
5153
5359
  if (shapeVerts.length === 0 || toolVerts.length === 0) {
5154
5360
  return result.err(
5155
5361
  result.kernelError(
@@ -5262,95 +5468,6 @@ function polyhedron(points, faces, options = {}) {
5262
5468
  return result.err(result.kernelError(result.BrepErrorCode.POLYHEDRON_FAILED, `Polyhedron failed: ${raw}`, e));
5263
5469
  }
5264
5470
  }
5265
- function multiSectionSweep(sections, spine, options) {
5266
- if (sections.length < 2) {
5267
- return result.err(
5268
- result.validationError(
5269
- result.BrepErrorCode.MULTI_SWEEP_INSUFFICIENT_SECTIONS,
5270
- `Multi-section sweep requires at least 2 sections, got ${sections.length}`
5271
- )
5272
- );
5273
- }
5274
- const { solid = true, ruled = false, tolerance = 1e-6 } = options ?? {};
5275
- const explicitLocations = sections.map((s) => s.location);
5276
- for (let i = 0; i < explicitLocations.length; i++) {
5277
- const loc = explicitLocations[i];
5278
- if (loc !== void 0 && (loc < 0 || loc > 1)) {
5279
- return result.err(
5280
- result.validationError(
5281
- result.BrepErrorCode.MULTI_SWEEP_FAILED,
5282
- `Section ${i} location ${loc} is out of range [0, 1]`
5283
- )
5284
- );
5285
- }
5286
- }
5287
- const definedLocs = explicitLocations.filter((l) => l !== void 0);
5288
- for (let i = 1; i < definedLocs.length; i++) {
5289
- if ((definedLocs[i] ?? 0) <= (definedLocs[i - 1] ?? 0)) {
5290
- return result.err(
5291
- result.validationError(
5292
- result.BrepErrorCode.MULTI_SWEEP_FAILED,
5293
- "Section locations must be strictly increasing"
5294
- )
5295
- );
5296
- }
5297
- }
5298
- try {
5299
- const kernel = shapeTypes.getKernel();
5300
- const [uFirst, uLast] = kernel.curveParameters(spine.wrapped);
5301
- const uRange = uLast - uFirst;
5302
- const params = sections.map((s, i) => {
5303
- if (s.location !== void 0) {
5304
- return uFirst + s.location * uRange;
5305
- }
5306
- return uFirst + i / (sections.length - 1) * uRange;
5307
- });
5308
- const positionedWires = [];
5309
- for (let i = 0; i < sections.length; i++) {
5310
- const param = params[i];
5311
- const section2 = sections[i];
5312
- if (param === void 0 || section2 === void 0) continue;
5313
- const positioned = kernel.positionOnCurve(section2.wire.wrapped, spine.wrapped, param);
5314
- positionedWires.push(kernel.downcast(positioned, "wire"));
5315
- }
5316
- const loftResult = kernel.loftAdvanced(positionedWires, { solid, ruled, tolerance });
5317
- const result$1 = shapeTypes.castShape(loftResult);
5318
- if (!shapeTypes.isShape3D(result$1)) {
5319
- return result.err(
5320
- result.typeCastError("MULTI_SWEEP_NOT_3D", "Multi-section sweep did not produce a 3D shape")
5321
- );
5322
- }
5323
- return result.ok(result$1);
5324
- } catch (e) {
5325
- const raw = e instanceof Error ? e.message : String(e);
5326
- return result.err(
5327
- result.kernelError(result.BrepErrorCode.MULTI_SWEEP_FAILED, `Multi-section sweep failed: ${raw}`, e)
5328
- );
5329
- }
5330
- }
5331
- function guidedSweep(profile, spine, guides, options = {}) {
5332
- const { transition = "transformed", solid = true, tolerance } = options;
5333
- try {
5334
- const kernel = shapeTypes.getKernel();
5335
- const shellMode = !solid;
5336
- const auxiliary = guides.length > 0 ? guides[0]?.wrapped : void 0;
5337
- const sweepResult = kernel.sweepPipeShell(profile.wrapped, spine.wrapped, {
5338
- transitionMode: transition,
5339
- ...auxiliary ? { auxiliary } : {},
5340
- shellMode,
5341
- ...tolerance !== void 0 ? { tolerance, boundTolerance: tolerance } : {}
5342
- });
5343
- const ocShape = typeof sweepResult === "object" && "shape" in sweepResult ? sweepResult.shape : sweepResult;
5344
- const result$1 = shapeTypes.castShape(ocShape);
5345
- if (!shapeTypes.isShape3D(result$1)) {
5346
- return result.err(result.typeCastError("GUIDED_SWEEP_NOT_3D", "Guided sweep did not produce a 3D shape"));
5347
- }
5348
- return result.ok(result$1);
5349
- } catch (e) {
5350
- const raw = e instanceof Error ? e.message : String(e);
5351
- return result.err(result.kernelError(result.BrepErrorCode.GUIDED_SWEEP_FAILED, `Guided sweep failed: ${raw}`, e));
5352
- }
5353
- }
5354
5471
  const EPS = 1e-10;
5355
5472
  function cross2(ax, ay, bx, by) {
5356
5473
  return ax * by - ay * bx;
@@ -5404,9 +5521,8 @@ function bisector(poly, i) {
5404
5521
  return { dx: bx * speed, dy: by * speed };
5405
5522
  }
5406
5523
  function isLavNodeReflex(node) {
5407
- const prev = node.prev;
5408
- const next = node.next;
5409
- return cross2(node.x - prev.x, node.y - prev.y, next.x - node.x, next.y - node.y) < -EPS;
5524
+ if (!node.prev || !node.next) return false;
5525
+ return cross2(node.x - node.prev.x, node.y - node.prev.y, node.next.x - node.x, node.next.y - node.y) < -EPS;
5410
5526
  }
5411
5527
  function createLav(poly) {
5412
5528
  const nodes = poly.map((p, i) => {
@@ -5495,7 +5611,7 @@ function raySplitTime(node, eA, eB) {
5495
5611
  function computeEvents(lavNodes) {
5496
5612
  const events = [];
5497
5613
  for (const node of lavNodes) {
5498
- if (!node.active) continue;
5614
+ if (!node.active || !node.next) continue;
5499
5615
  const t = bisectorIntersectTime(node, node.next);
5500
5616
  if (t !== null && t > EPS) {
5501
5617
  const x = node.x + t * node.bx;
@@ -5559,6 +5675,7 @@ function computeStraightSkeleton(polygon) {
5559
5675
  } else {
5560
5676
  let cur = activeStart;
5561
5677
  for (let i = 0; i < sz; i++) {
5678
+ if (!cur) break;
5562
5679
  cur.active = false;
5563
5680
  cur = cur.next;
5564
5681
  }
@@ -5698,7 +5815,7 @@ function computeStraightSkeleton(polygon) {
5698
5815
  return { nodes: uniqueNodes, faces };
5699
5816
  }
5700
5817
  function extractPolygon(w) {
5701
- const edges = shapeFns.getEdges(w);
5818
+ const edges = topologyQueryFns.getEdges(w);
5702
5819
  const pts = edges.map((e) => {
5703
5820
  const pt = curveFns.curveStartPoint(e);
5704
5821
  return { x: pt[0], y: pt[1] };
@@ -6030,7 +6147,7 @@ function checkInterference(shape1, shape2, tolerance = 1e-6) {
6030
6147
  }
6031
6148
  function checkAllInterferences(shapes, tolerance = 1e-6) {
6032
6149
  const pairs = [];
6033
- const boxes = shapes.map((s) => shapeFns.getBounds(s));
6150
+ const boxes = shapes.map((s) => topologyQueryFns.getBounds(s));
6034
6151
  shapes.forEach((si, i) => {
6035
6152
  for (let j = i + 1; j < shapes.length; j++) {
6036
6153
  if (aabbDisjoint(boxes[i], boxes[j], tolerance)) continue;
@@ -6151,6 +6268,28 @@ async function importDXF(blob, options) {
6151
6268
  }
6152
6269
  }
6153
6270
  }
6271
+ function sewMeshToSolid(triangles, errorCode, tolerance = 1e-6) {
6272
+ const kernel = shapeTypes.getKernel();
6273
+ const triFaces = [];
6274
+ for (const [va, vb, vc] of triangles) {
6275
+ const triFace = kernel.buildTriFace(va, vb, vc);
6276
+ if (triFace !== null) {
6277
+ triFaces.push(triFace);
6278
+ }
6279
+ }
6280
+ if (triFaces.length === 0) {
6281
+ return result.err(result.ioError(errorCode, "No valid triangular faces could be built"));
6282
+ }
6283
+ try {
6284
+ return result.ok(shapeTypes.castShape(kernel.sewAndSolidify(triFaces, tolerance)));
6285
+ } catch {
6286
+ try {
6287
+ return result.ok(shapeTypes.castShape(kernel.sew(triFaces, tolerance)));
6288
+ } catch {
6289
+ return result.err(result.ioError(errorCode, "Failed to sew triangular faces"));
6290
+ }
6291
+ }
6292
+ }
6154
6293
  async function importOBJ(blob) {
6155
6294
  const text = await blob.text();
6156
6295
  const lines = text.split("\n");
@@ -6186,8 +6325,7 @@ async function importOBJ(blob) {
6186
6325
  }
6187
6326
  }
6188
6327
  function buildSolidFromMesh$1(vertices, faces) {
6189
- const kernel = shapeTypes.getKernel();
6190
- const triFaces = [];
6328
+ const triangles = [];
6191
6329
  for (const face of faces) {
6192
6330
  for (let i = 1; i < face.length - 1; i++) {
6193
6331
  const rawA = face[0] ?? 0;
@@ -6200,26 +6338,10 @@ function buildSolidFromMesh$1(vertices, faces) {
6200
6338
  const vb = vertices[bi];
6201
6339
  const vc = vertices[ci];
6202
6340
  if (!va || !vb || !vc) continue;
6203
- const triFace = kernel.buildTriFace(va, vb, vc);
6204
- if (triFace !== null) {
6205
- triFaces.push(triFace);
6206
- }
6207
- }
6208
- }
6209
- if (triFaces.length === 0) {
6210
- return result.err(
6211
- result.ioError(result.BrepErrorCode.OBJ_IMPORT_FAILED, "No valid triangular faces could be built")
6212
- );
6213
- }
6214
- try {
6215
- return result.ok(shapeTypes.castShape(kernel.sewAndSolidify(triFaces, 1e-6)));
6216
- } catch {
6217
- try {
6218
- return result.ok(shapeTypes.castShape(kernel.sew(triFaces, 1e-6)));
6219
- } catch {
6220
- return result.err(result.ioError(result.BrepErrorCode.OBJ_IMPORT_FAILED, "Failed to sew triangular faces"));
6341
+ triangles.push([va, vb, vc]);
6221
6342
  }
6222
6343
  }
6344
+ return sewMeshToSolid(triangles, result.BrepErrorCode.OBJ_IMPORT_FAILED);
6223
6345
  }
6224
6346
  function extractFromZip(data, target) {
6225
6347
  let eocdOffset = -1;
@@ -6325,31 +6447,15 @@ function buildSolidFromMesh(mesh2) {
6325
6447
  const solid = kernel.buildSolidFromFaces(points, faces, 1e-6);
6326
6448
  return result.ok(shapeTypes.castShape(solid));
6327
6449
  } catch {
6328
- const triFaces = [];
6450
+ const triangles = [];
6329
6451
  for (const [v1, v2, v3] of mesh2.triangles) {
6330
6452
  const va = mesh2.vertices[v1];
6331
6453
  const vb = mesh2.vertices[v2];
6332
6454
  const vc = mesh2.vertices[v3];
6333
6455
  if (!va || !vb || !vc) continue;
6334
- const triFace = kernel.buildTriFace(va, vb, vc);
6335
- if (triFace !== null) {
6336
- triFaces.push(triFace);
6337
- }
6338
- }
6339
- if (triFaces.length === 0) {
6340
- return result.err(
6341
- result.ioError(result.BrepErrorCode.THREEMF_IMPORT_FAILED, "No valid triangular faces could be built")
6342
- );
6343
- }
6344
- try {
6345
- return result.ok(shapeTypes.castShape(kernel.sewAndSolidify(triFaces, 1e-6)));
6346
- } catch {
6347
- try {
6348
- return result.ok(shapeTypes.castShape(kernel.sew(triFaces, 1e-6)));
6349
- } catch {
6350
- return result.err(result.ioError(result.BrepErrorCode.THREEMF_IMPORT_FAILED, "Failed to sew triangular faces"));
6351
- }
6456
+ triangles.push([va, vb, vc]);
6352
6457
  }
6458
+ return sewMeshToSolid(triangles, result.BrepErrorCode.THREEMF_IMPORT_FAILED);
6353
6459
  }
6354
6460
  }
6355
6461
  async function importThreeMF(blob) {
@@ -6378,6 +6484,16 @@ async function importThreeMF(blob) {
6378
6484
  return result.err(result.ioError(result.BrepErrorCode.THREEMF_IMPORT_FAILED, `3MF import failed: ${msg}`, e));
6379
6485
  }
6380
6486
  }
6487
+ async function importGLB(blob) {
6488
+ try {
6489
+ const data = await blob.arrayBuffer();
6490
+ const shape2 = shapeTypes.getKernel().importGLB(data);
6491
+ return result.ok(shapeTypes.castShape(shape2));
6492
+ } catch (e) {
6493
+ const msg = e instanceof Error ? e.message : String(e);
6494
+ return result.err(result.ioError(result.BrepErrorCode.GLB_IMPORT_FAILED, `Failed to import GLB: ${msg}`, e));
6495
+ }
6496
+ }
6381
6497
  function resolve(s) {
6382
6498
  if ("__wrapped" in s) {
6383
6499
  return s.val;
@@ -6393,25 +6509,11 @@ function validateNotNull(shape2, label) {
6393
6509
  }
6394
6510
  return result.ok(void 0);
6395
6511
  }
6396
- function collectInputFaceHashes(inputs) {
6397
- const hasMetadata = inputs.some((s) => {
6398
- return shapeFns.getFaceOrigins(s) !== void 0 || booleanFns.hasFaceTags(s) || booleanFns.hasColorMetadata(s);
6399
- });
6400
- if (!hasMetadata) return [];
6401
- const hashes = [];
6402
- for (const input of inputs) {
6403
- const faces = shapeTypes.getKernel().iterShapes(input.wrapped, "face");
6404
- for (const face of faces) {
6405
- hashes.push(face.HashCode(vecOps.HASH_CODE_MAX));
6406
- }
6407
- }
6408
- return hashes;
6409
- }
6410
6512
  function thicken$1(shape2, thickness) {
6411
6513
  const check = validateNotNull(shape2, "thicken: shape");
6412
6514
  if (result.isErr(check)) return check;
6413
6515
  try {
6414
- const inputFaceHashes = collectInputFaceHashes([shape2]);
6516
+ const inputFaceHashes = booleanFns.collectInputFaceHashes([shape2]);
6415
6517
  const { shape: resultShape, evolution } = shapeTypes.getKernel().thickenWithHistory(
6416
6518
  shape2.wrapped,
6417
6519
  thickness,
@@ -6419,9 +6521,7 @@ function thicken$1(shape2, thickness) {
6419
6521
  vecOps.HASH_CODE_MAX
6420
6522
  );
6421
6523
  const cast = shapeTypes.castShape(resultShape);
6422
- shapeFns.propagateOriginsFromEvolution(evolution, [shape2], cast);
6423
- booleanFns.propagateFaceTagsFromEvolution(evolution, [shape2], cast);
6424
- booleanFns.propagateColorsFromEvolution(evolution, [shape2], cast);
6524
+ booleanFns.propagateAllMetadata(evolution, [shape2], cast);
6425
6525
  return result.ok(cast);
6426
6526
  } catch (e) {
6427
6527
  const raw = e instanceof Error ? e.message : String(e);
@@ -6453,7 +6553,7 @@ function fillet$1(shape2, edges, radius) {
6453
6553
  )
6454
6554
  );
6455
6555
  }
6456
- const selectedEdges = edges ?? shapeFns.getEdges(shape2);
6556
+ const selectedEdges = edges ?? topologyQueryFns.getEdges(shape2);
6457
6557
  if (selectedEdges.length === 0) {
6458
6558
  return result.err(
6459
6559
  result.validationError(
@@ -6501,7 +6601,7 @@ function fillet$1(shape2, edges, radius) {
6501
6601
  )
6502
6602
  );
6503
6603
  }
6504
- const inputFaceHashes = collectInputFaceHashes([shape2]);
6604
+ const inputFaceHashes = booleanFns.collectInputFaceHashes([shape2]);
6505
6605
  const { shape: resultShape, evolution } = shapeTypes.getKernel().filletWithHistory(
6506
6606
  shape2.wrapped,
6507
6607
  filteredEdges.map((e) => e.wrapped),
@@ -6513,9 +6613,7 @@ function fillet$1(shape2, edges, radius) {
6513
6613
  if (!shapeTypes.isShape3D(cast)) {
6514
6614
  return result.err(result.kernelError(result.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
6515
6615
  }
6516
- shapeFns.propagateOriginsFromEvolution(evolution, [shape2], cast);
6517
- booleanFns.propagateFaceTagsFromEvolution(evolution, [shape2], cast);
6518
- booleanFns.propagateColorsFromEvolution(evolution, [shape2], cast);
6616
+ booleanFns.propagateAllMetadata(evolution, [shape2], cast);
6519
6617
  return result.ok(cast);
6520
6618
  } catch (e) {
6521
6619
  const raw = e instanceof Error ? e.message : String(e);
@@ -6553,7 +6651,7 @@ function chamfer$1(shape2, edges, distance) {
6553
6651
  )
6554
6652
  );
6555
6653
  }
6556
- const selectedEdges = edges ?? shapeFns.getEdges(shape2);
6654
+ const selectedEdges = edges ?? topologyQueryFns.getEdges(shape2);
6557
6655
  if (selectedEdges.length === 0) {
6558
6656
  return result.err(result.validationError(result.BrepErrorCode.CHAMFER_NO_EDGES, "No edges found for chamfer"));
6559
6657
  }
@@ -6590,7 +6688,7 @@ function chamfer$1(shape2, edges, distance) {
6590
6688
  )
6591
6689
  );
6592
6690
  }
6593
- const inputFaceHashes = collectInputFaceHashes([shape2]);
6691
+ const inputFaceHashes = booleanFns.collectInputFaceHashes([shape2]);
6594
6692
  const { shape: resultShape, evolution } = shapeTypes.getKernel().chamferWithHistory(
6595
6693
  shape2.wrapped,
6596
6694
  filteredEdges.map((e) => e.wrapped),
@@ -6602,9 +6700,7 @@ function chamfer$1(shape2, edges, distance) {
6602
6700
  if (!shapeTypes.isShape3D(cast)) {
6603
6701
  return result.err(result.kernelError(result.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape"));
6604
6702
  }
6605
- shapeFns.propagateOriginsFromEvolution(evolution, [shape2], cast);
6606
- booleanFns.propagateFaceTagsFromEvolution(evolution, [shape2], cast);
6607
- booleanFns.propagateColorsFromEvolution(evolution, [shape2], cast);
6703
+ booleanFns.propagateAllMetadata(evolution, [shape2], cast);
6608
6704
  return result.ok(cast);
6609
6705
  } catch (e) {
6610
6706
  const raw = e instanceof Error ? e.message : String(e);
@@ -6627,7 +6723,7 @@ function shell$1(shape2, faces, thickness, tolerance = 1e-3) {
6627
6723
  return result.err(result.validationError("NO_FACES", "At least one face must be specified for shell"));
6628
6724
  }
6629
6725
  try {
6630
- const inputFaceHashes = collectInputFaceHashes([shape2]);
6726
+ const inputFaceHashes = booleanFns.collectInputFaceHashes([shape2]);
6631
6727
  const { shape: resultShape, evolution } = shapeTypes.getKernel().shellWithHistory(
6632
6728
  shape2.wrapped,
6633
6729
  faces.map((f) => f.wrapped),
@@ -6640,9 +6736,7 @@ function shell$1(shape2, faces, thickness, tolerance = 1e-3) {
6640
6736
  if (!shapeTypes.isShape3D(cast)) {
6641
6737
  return result.err(result.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
6642
6738
  }
6643
- shapeFns.propagateOriginsFromEvolution(evolution, [shape2], cast);
6644
- booleanFns.propagateFaceTagsFromEvolution(evolution, [shape2], cast);
6645
- booleanFns.propagateColorsFromEvolution(evolution, [shape2], cast);
6739
+ booleanFns.propagateAllMetadata(evolution, [shape2], cast);
6646
6740
  return result.ok(cast);
6647
6741
  } catch (e) {
6648
6742
  const raw = e instanceof Error ? e.message : String(e);
@@ -6662,7 +6756,7 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
6662
6756
  return result.err(result.validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
6663
6757
  }
6664
6758
  try {
6665
- const inputFaceHashes = collectInputFaceHashes([shape2]);
6759
+ const inputFaceHashes = booleanFns.collectInputFaceHashes([shape2]);
6666
6760
  const { shape: resultShape, evolution } = shapeTypes.getKernel().offsetWithHistory(
6667
6761
  shape2.wrapped,
6668
6762
  distance,
@@ -6674,9 +6768,7 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
6674
6768
  if (!shapeTypes.isShape3D(cast)) {
6675
6769
  return result.err(result.kernelError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
6676
6770
  }
6677
- shapeFns.propagateOriginsFromEvolution(evolution, [shape2], cast);
6678
- booleanFns.propagateFaceTagsFromEvolution(evolution, [shape2], cast);
6679
- booleanFns.propagateColorsFromEvolution(evolution, [shape2], cast);
6771
+ booleanFns.propagateAllMetadata(evolution, [shape2], cast);
6680
6772
  return result.ok(cast);
6681
6773
  } catch (e) {
6682
6774
  const raw = e instanceof Error ? e.message : String(e);
@@ -6684,27 +6776,27 @@ function offset$1(shape2, distance, tolerance = 1e-6) {
6684
6776
  }
6685
6777
  }
6686
6778
  function translate(shape2, v) {
6687
- return shapeFns.translate(resolve(shape2), v);
6779
+ return topology.translate(resolve(shape2), v);
6688
6780
  }
6689
6781
  function rotate(shape2, angle, options) {
6690
6782
  const pivotPoint = options?.at;
6691
- return shapeFns.rotate(resolve(shape2), angle, pivotPoint, options?.axis);
6783
+ return topology.rotate(resolve(shape2), angle, pivotPoint, options?.axis);
6692
6784
  }
6693
6785
  function mirror(shape2, options) {
6694
6786
  const planeOrigin = options?.at;
6695
- return shapeFns.mirror(resolve(shape2), options?.normal ?? [1, 0, 0], planeOrigin);
6787
+ return topology.mirror(resolve(shape2), options?.normal ?? [1, 0, 0], planeOrigin);
6696
6788
  }
6697
6789
  function scale(shape2, factor, options) {
6698
- return shapeFns.scale(resolve(shape2), factor, options?.center);
6790
+ return topology.scale(resolve(shape2), factor, options?.center);
6699
6791
  }
6700
6792
  function clone(shape2) {
6701
6793
  return shapeFns.clone(resolve(shape2));
6702
6794
  }
6703
6795
  function applyMatrix(shape2, matrix) {
6704
- return shapeFns.applyMatrix(resolve(shape2), matrix);
6796
+ return topology.applyMatrix(resolve(shape2), matrix);
6705
6797
  }
6706
6798
  function transformCopy(shape2, composed) {
6707
- return shapeFns.transformCopy(resolve(shape2), composed);
6799
+ return topology.transformCopy(resolve(shape2), composed);
6708
6800
  }
6709
6801
  function fuse(a, b, options) {
6710
6802
  return booleanFns.fuse(resolve(a), resolve(b), options);
@@ -6733,7 +6825,7 @@ function resolveEdges(edgesOrFn, shape2) {
6733
6825
  if (typeof edgesOrFn === "object" && "findAll" in edgesOrFn) {
6734
6826
  return edgesOrFn.findAll(shape2);
6735
6827
  }
6736
- const finder = edgesOrFn(query.edgeFinder());
6828
+ const finder = edgesOrFn(helpers.edgeFinder());
6737
6829
  return finder.findAll(shape2);
6738
6830
  }
6739
6831
  function resolveFaces(facesOrFn, shape2) {
@@ -6787,7 +6879,7 @@ function chamfer(shape2, edgesOrDistance, maybeDistance) {
6787
6879
  }
6788
6880
  const normalized = normalizeChamferDistance(distance);
6789
6881
  if (normalized.mode === "distAngle") {
6790
- const selectedEdges = edges ?? shapeFns.getEdges(s);
6882
+ const selectedEdges = edges ?? topologyQueryFns.getEdges(s);
6791
6883
  return topology.chamferDistAngle(
6792
6884
  s,
6793
6885
  [...selectedEdges],
@@ -6821,7 +6913,7 @@ function meshEdges(shape2, options) {
6821
6913
  return meshFns.meshEdges(resolve(shape2), options);
6822
6914
  }
6823
6915
  function describe(shape2) {
6824
- return shapeFns.describe(resolve(shape2));
6916
+ return topologyQueryFns.describe(resolve(shape2));
6825
6917
  }
6826
6918
  function toBREP(shape2) {
6827
6919
  return shapeFns.toBREP(resolve(shape2));
@@ -6835,41 +6927,14 @@ function isValid(shape2) {
6835
6927
  function isEmpty(shape2) {
6836
6928
  return shapeFns.isEmpty(resolve(shape2));
6837
6929
  }
6838
- function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
6839
- if (wires.length === 0 && !startPoint && !endPoint) {
6840
- return result.err(result.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
6841
- }
6842
- const kernel = shapeTypes.getKernel();
6843
- const startVertex = startPoint ? kernel.makeVertex(...types.toVec3(startPoint)) : void 0;
6844
- const endVertex = endPoint ? kernel.makeVertex(...types.toVec3(endPoint)) : void 0;
6845
- try {
6846
- const shape2 = kernel.loftAdvanced(
6847
- wires.map((w) => w.wrapped),
6848
- {
6849
- solid: !returnShell,
6850
- ruled,
6851
- tolerance,
6852
- ...startVertex ? { startVertex } : {},
6853
- ...endVertex ? { endVertex } : {}
6854
- }
6855
- );
6856
- const result$1 = shapeTypes.castShape(shape2);
6857
- if (!shapeTypes.isShape3D(result$1)) {
6858
- return result.err(result.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
6859
- }
6860
- return result.ok(result$1);
6861
- } catch {
6862
- return result.err(result.kernelError("LOFT_FAILED", "Loft operation failed"));
6863
- }
6864
- }
6865
6930
  function extrude(face, height) {
6866
6931
  const f = resolve(face);
6867
6932
  const vec = typeof height === "number" ? [0, 0, height] : height;
6868
- return operations.extrude(f, vec);
6933
+ return boolean2D.extrude(f, vec);
6869
6934
  }
6870
6935
  function revolve(face, options) {
6871
6936
  const pivotPoint = options?.at ?? [0, 0, 0];
6872
- return operations.revolve(
6937
+ return boolean2D.revolve(
6873
6938
  resolve(face),
6874
6939
  pivotPoint,
6875
6940
  options?.axis ?? [0, 0, 1],
@@ -6878,11 +6943,11 @@ function revolve(face, options) {
6878
6943
  }
6879
6944
  function loft(wires, options) {
6880
6945
  const resolvedWires = wires.map((w) => resolve(w));
6881
- return loft$1(resolvedWires, options);
6946
+ return boolean2D.loft(resolvedWires, options);
6882
6947
  }
6883
6948
  function resolveTargetFace(shape2, faceSpec) {
6884
6949
  if (faceSpec === void 0) {
6885
- const faces = shapeFns.getFaces(shape2);
6950
+ const faces = topologyQueryFns.getFaces(shape2);
6886
6951
  if (faces.length === 0) {
6887
6952
  return result.err(
6888
6953
  result.validationError(result.BrepErrorCode.COMPOUND_NO_FACES, "compoundOps: shape has no faces")
@@ -6937,7 +7002,7 @@ function drill(shape2, options) {
6937
7002
  if (options.depth !== void 0) {
6938
7003
  tool = solidBuilders.makeCylinder(radius, options.depth, pos, dir);
6939
7004
  } else {
6940
- const b = shapeFns.getBounds(s);
7005
+ const b = topologyQueryFns.getBounds(s);
6941
7006
  const corners = [
6942
7007
  [b.xMin, b.yMin, b.zMin],
6943
7008
  [b.xMax, b.yMin, b.zMin],
@@ -6978,7 +7043,7 @@ function pocket(shape2, options) {
6978
7043
  const faceResult = surfaceBuilders.makeFace(w);
6979
7044
  if (result.isErr(faceResult)) return faceResult;
6980
7045
  const extDir = vecOps.vecScale(vecOps.vecNormalize(normal), -depth);
6981
- const toolResult = operations.extrude(faceResult.value, extDir);
7046
+ const toolResult = boolean2D.extrude(faceResult.value, extDir);
6982
7047
  if (result.isErr(toolResult)) return toolResult;
6983
7048
  return booleanFns.cut(s, toolResult.value);
6984
7049
  }
@@ -6996,7 +7061,7 @@ function boss(shape2, options) {
6996
7061
  const faceResult = surfaceBuilders.makeFace(w);
6997
7062
  if (result.isErr(faceResult)) return faceResult;
6998
7063
  const extDir = vecOps.vecScale(vecOps.vecNormalize(normal), height);
6999
- const toolResult = operations.extrude(faceResult.value, extDir);
7064
+ const toolResult = boolean2D.extrude(faceResult.value, extDir);
7000
7065
  if (result.isErr(toolResult)) return toolResult;
7001
7066
  return booleanFns.fuse(s, toolResult.value);
7002
7067
  }
@@ -7004,7 +7069,7 @@ function mirrorJoin(shape2, options) {
7004
7069
  const s = resolve(shape2);
7005
7070
  const normal = options?.normal ?? [1, 0, 0];
7006
7071
  const planeOrigin = options?.at;
7007
- const mirrored = shapeFns.mirror(s, normal, planeOrigin);
7072
+ const mirrored = topology.mirror(s, normal, planeOrigin);
7008
7073
  return booleanFns.fuse(s, mirrored);
7009
7074
  }
7010
7075
  function rectangularPattern(shape2, options) {
@@ -7031,7 +7096,7 @@ function rectangularPattern(shape2, options) {
7031
7096
  xNorm[1] * xSpacing * xi + yNorm[1] * ySpacing * yi,
7032
7097
  xNorm[2] * xSpacing * xi + yNorm[2] * ySpacing * yi
7033
7098
  ];
7034
- copies.push(shapeFns.translate(s, offset2));
7099
+ copies.push(topology.translate(s, offset2));
7035
7100
  }
7036
7101
  }
7037
7102
  return booleanFns.fuseAll(copies);
@@ -7078,7 +7143,7 @@ function createWrappedBase(val) {
7078
7143
  rotateX: (a) => wrapAny(rotate(val, a, { axis: [1, 0, 0] })),
7079
7144
  rotateY: (a) => wrapAny(rotate(val, a, { axis: [0, 1, 0] })),
7080
7145
  rotateZ: (a) => wrapAny(rotate(val, a, { axis: [0, 0, 1] })),
7081
- bounds: () => shapeFns.getBounds(val),
7146
+ bounds: () => topologyQueryFns.getBounds(val),
7082
7147
  describe: () => describe(val),
7083
7148
  clone: () => wrapAny(clone(val)),
7084
7149
  // Meshing & Rendering
@@ -7134,15 +7199,15 @@ function createWrapped3D(val) {
7134
7199
  mirrorJoin: (opts) => wrap3D(unwrapOrThrow(mirrorJoin(val, opts))),
7135
7200
  rectangularPattern: (opts) => wrap3D(unwrapOrThrow(rectangularPattern(val, opts))),
7136
7201
  // Measurement
7137
- volume: () => measurement.measureVolume(val),
7138
- area: () => measurement.measureArea(val),
7139
- volumeProps: () => measurement.measureVolumeProps(val),
7140
- surfaceProps: () => measurement.measureSurfaceProps(val),
7202
+ volume: () => unwrapOrThrow(measurement.measureVolume(val)),
7203
+ area: () => unwrapOrThrow(measurement.measureArea(val)),
7204
+ volumeProps: () => unwrapOrThrow(measurement.measureVolumeProps(val)),
7205
+ surfaceProps: () => unwrapOrThrow(measurement.measureSurfaceProps(val)),
7141
7206
  // Queries
7142
- edges: () => shapeFns.getEdges(val),
7143
- faces: () => shapeFns.getFaces(val),
7144
- wires: () => shapeFns.getWires(val),
7145
- vertices: () => shapeFns.getVertices(val),
7207
+ edges: () => topologyQueryFns.getEdges(val),
7208
+ faces: () => topologyQueryFns.getFaces(val),
7209
+ wires: () => topologyQueryFns.getWires(val),
7210
+ vertices: () => topologyQueryFns.getVertices(val),
7146
7211
  // Patterns
7147
7212
  linearPattern: (dir, count, spacing) => wrap3D(unwrapOrThrow(operations.linearPattern(val, dir, count, spacing))),
7148
7213
  circularPattern: (axis, count, angle) => wrap3D(unwrapOrThrow(operations.circularPattern(val, axis, count, angle)))
@@ -7162,7 +7227,7 @@ function createWrappedCurve(val) {
7162
7227
  sweep(spine, opts) {
7163
7228
  if (!shapeTypes.isWire(val)) throw new Error("sweep requires a Wire");
7164
7229
  const w = val;
7165
- const result2 = unwrapOrThrow(operations.sweep(w, resolve(spine), opts));
7230
+ const result2 = unwrapOrThrow(sweepFns.sweep(w, resolve(spine), opts));
7166
7231
  const shape3D = Array.isArray(result2) ? result2[0] : result2;
7167
7232
  return wrap3D(shape3D);
7168
7233
  }
@@ -7172,7 +7237,7 @@ function createWrappedFace(val) {
7172
7237
  const base = createWrappedBase(val);
7173
7238
  return {
7174
7239
  ...base,
7175
- area: () => measurement.measureArea(val),
7240
+ area: () => unwrapOrThrow(measurement.measureArea(val)),
7176
7241
  normalAt: (point) => faceFns.normalAt(val, point),
7177
7242
  center: () => faceFns.faceCenter(val),
7178
7243
  surfaceType: () => unwrapOrThrow(faceFns.getSurfaceType(val)),
@@ -7209,7 +7274,6 @@ exports.as2D = shapeTypes.as2D;
7209
7274
  exports.as3D = shapeTypes.as3D;
7210
7275
  exports.castShape = shapeTypes.castShape;
7211
7276
  exports.castShape3D = shapeTypes.castShape3D;
7212
- exports.closedWire = shapeTypes.closedWire;
7213
7277
  exports.createCompound = shapeTypes.createCompound;
7214
7278
  exports.createEdge = shapeTypes.createEdge;
7215
7279
  exports.createFace = shapeTypes.createFace;
@@ -7219,29 +7283,24 @@ exports.createShell = shapeTypes.createShell;
7219
7283
  exports.createSolid = shapeTypes.createSolid;
7220
7284
  exports.createVertex = shapeTypes.createVertex;
7221
7285
  exports.createWire = shapeTypes.createWire;
7286
+ exports.getDisposalStats = shapeTypes.getDisposalStats;
7222
7287
  exports.getKernel = shapeTypes.getKernel;
7223
7288
  exports.getShapeKind = shapeTypes.getShapeKind;
7224
7289
  exports.initFromOC = shapeTypes.initFromOC;
7225
7290
  exports.is2D = shapeTypes.is2D;
7226
7291
  exports.is3D = shapeTypes.is3D;
7227
- exports.isClosedWire = shapeTypes.isClosedWire;
7228
7292
  exports.isCompound = shapeTypes.isCompound;
7229
7293
  exports.isEdge = shapeTypes.isEdge;
7230
7294
  exports.isFace = shapeTypes.isFace;
7231
7295
  exports.isLive = shapeTypes.isLive;
7232
- exports.isManifoldShell = shapeTypes.isManifoldShell;
7233
- exports.isOrientedFace = shapeTypes.isOrientedFace;
7234
7296
  exports.isShape1D = shapeTypes.isShape1D;
7235
7297
  exports.isShape3D = shapeTypes.isShape3D;
7236
7298
  exports.isShell = shapeTypes.isShell;
7237
7299
  exports.isSolid = shapeTypes.isSolid;
7238
- exports.isValidSolid = shapeTypes.isValidSolid;
7239
7300
  exports.isVertex = shapeTypes.isVertex;
7240
7301
  exports.isWire = shapeTypes.isWire;
7241
- exports.manifoldShell = shapeTypes.manifoldShell;
7242
- exports.orientedFace = shapeTypes.orientedFace;
7243
7302
  exports.registerKernel = shapeTypes.registerKernel;
7244
- exports.validSolid = shapeTypes.validSolid;
7303
+ exports.resetDisposalStats = shapeTypes.resetDisposalStats;
7245
7304
  exports.withKernel = shapeTypes.withKernel;
7246
7305
  exports.withScope = shapeTypes.withScope;
7247
7306
  exports.withScopeResult = shapeTypes.withScopeResult;
@@ -7256,12 +7315,14 @@ exports.collect = result.collect;
7256
7315
  exports.computationError = result.computationError;
7257
7316
  exports.err = result.err;
7258
7317
  exports.flatMap = result.flatMap;
7318
+ exports.flatten = result.flatten;
7259
7319
  exports.fromNullable = result.fromNullable;
7260
7320
  exports.ioError = result.ioError;
7261
7321
  exports.isErr = result.isErr;
7262
7322
  exports.isOk = result.isOk;
7263
7323
  exports.kernelError = result.kernelError;
7264
7324
  exports.map = result.map;
7325
+ exports.mapBoth = result.mapBoth;
7265
7326
  exports.mapErr = result.mapErr;
7266
7327
  exports.match = result.match;
7267
7328
  exports.moduleInitError = result.moduleInitError;
@@ -7302,18 +7363,16 @@ exports.vecRepr = vecOps.vecRepr;
7302
7363
  exports.vecRotate = vecOps.vecRotate;
7303
7364
  exports.vecScale = vecOps.vecScale;
7304
7365
  exports.vecSub = vecOps.vecSub;
7305
- exports.Blueprint = Blueprint.Blueprint;
7306
- exports.BoundingBox2d = Blueprint.BoundingBox2d;
7307
- exports.Curve2D = Blueprint.Curve2D;
7308
- exports.makePlane = Blueprint.makePlane;
7309
- exports.basicFaceExtrusion = loft$2.basicFaceExtrusion;
7310
- exports.genericSweep = loft$2.genericSweep;
7311
- exports.revolution = loft$2.revolution;
7366
+ exports.createNamedPlane = vectors.createNamedPlane;
7367
+ exports.createPlane = vectors.createPlane;
7368
+ exports.makePlane = vectors.makePlane;
7369
+ exports.pivotPlane = vectors.pivotPlane;
7370
+ exports.resolvePlane = vectors.resolvePlane;
7371
+ exports.translatePlane = vectors.translatePlane;
7312
7372
  exports.addChild = operations.addChild;
7313
7373
  exports.addStep = operations.addStep;
7314
7374
  exports.circularPattern = operations.circularPattern;
7315
7375
  exports.collectShapes = operations.collectShapes;
7316
- exports.complexExtrude = operations.complexExtrude;
7317
7376
  exports.countNodes = operations.countNodes;
7318
7377
  exports.createAssembly = operations.createAssembly;
7319
7378
  exports.createAssemblyNode = operations.createAssemblyNode;
@@ -7334,12 +7393,12 @@ exports.replayHistory = operations.replayHistory;
7334
7393
  exports.serializeHistory = operations.serializeHistory;
7335
7394
  exports.stepCount = operations.stepCount;
7336
7395
  exports.stepsFrom = operations.stepsFrom;
7337
- exports.supportExtrude = operations.supportExtrude;
7338
- exports.sweep = operations.sweep;
7339
- exports.twistExtrude = operations.twistExtrude;
7340
7396
  exports.undoLast = operations.undoLast;
7341
7397
  exports.updateNode = operations.updateNode;
7342
7398
  exports.walkAssembly = operations.walkAssembly;
7399
+ exports.Blueprint = Blueprint.Blueprint;
7400
+ exports.BoundingBox2d = Blueprint.BoundingBox2d;
7401
+ exports.Curve2D = Blueprint.Curve2D;
7343
7402
  exports.BaseSketcher2d = boolean2D.BaseSketcher2d;
7344
7403
  exports.BlueprintSketcher = boolean2D.BlueprintSketcher;
7345
7404
  exports.Blueprints = boolean2D.Blueprints;
@@ -7356,6 +7415,7 @@ exports.organiseBlueprints = boolean2D.organiseBlueprints;
7356
7415
  exports.polysidesBlueprint = boolean2D.polysidesBlueprint;
7357
7416
  exports.roundedRectangleBlueprint = boolean2D.roundedRectangleBlueprint;
7358
7417
  exports.createBlueprint = _2d.createBlueprint;
7418
+ exports.createCompoundBlueprint = _2d.createCompoundBlueprint;
7359
7419
  exports.curve2dBoundingBox = _2d.curve2dBoundingBox;
7360
7420
  exports.curve2dDistanceFrom = _2d.curve2dDistanceFrom;
7361
7421
  exports.curve2dFirstPoint = _2d.curve2dFirstPoint;
@@ -7371,13 +7431,15 @@ exports.mirror2D = _2d.mirror2D;
7371
7431
  exports.reverseCurve = _2d.reverseCurve;
7372
7432
  exports.rotate2D = _2d.rotate2D;
7373
7433
  exports.scale2D = _2d.scale2D;
7374
- exports.sketch2DOnFace = _2d.sketch2DOnFace;
7375
- exports.sketch2DOnPlane = _2d.sketch2DOnPlane;
7434
+ exports.sketchOnFace2D = _2d.sketchOnFace2D;
7435
+ exports.sketchOnPlane2D = _2d.sketchOnPlane2D;
7376
7436
  exports.stretch2D = _2d.stretch2D;
7377
7437
  exports.toSVGPathD = _2d.toSVGPathD;
7378
7438
  exports.translate2D = _2d.translate2D;
7439
+ exports.edgeFinder = helpers.edgeFinder;
7379
7440
  exports.faceFinder = helpers.faceFinder;
7380
7441
  exports.getSingleFace = helpers.getSingleFace;
7442
+ exports.wireFinder = helpers.wireFinder;
7381
7443
  exports.blueprintToDXF = io.blueprintToDXF;
7382
7444
  exports.exportDXF = io.exportDXF;
7383
7445
  exports.exportGlb = io.exportGlb;
@@ -7453,29 +7515,9 @@ exports.translateDrawing = drawFns.translateDrawing;
7453
7515
  exports.resolveDirection = types.resolveDirection;
7454
7516
  exports.toVec2 = types.toVec2;
7455
7517
  exports.toVec3 = types.toVec3;
7456
- exports.createNamedPlane = vectors.createNamedPlane;
7457
- exports.createPlane = vectors.createPlane;
7458
- exports.pivotPlane = vectors.pivotPlane;
7459
- exports.resolvePlane = vectors.resolvePlane;
7460
- exports.translatePlane = vectors.translatePlane;
7461
- exports.composeTransforms = shapeFns.composeTransforms;
7462
- exports.getBounds = shapeFns.getBounds;
7463
- exports.getEdges = shapeFns.getEdges;
7464
- exports.getFaceOrigins = shapeFns.getFaceOrigins;
7465
- exports.getFaces = shapeFns.getFaces;
7466
7518
  exports.getHashCode = shapeFns.getHashCode;
7467
- exports.getVertices = shapeFns.getVertices;
7468
- exports.getWires = shapeFns.getWires;
7469
- exports.invalidateShapeCache = shapeFns.invalidateShapeCache;
7470
7519
  exports.isEqualShape = shapeFns.isEqualShape;
7471
7520
  exports.isSameShape = shapeFns.isSameShape;
7472
- exports.iterEdges = shapeFns.iterEdges;
7473
- exports.iterFaces = shapeFns.iterFaces;
7474
- exports.iterVertices = shapeFns.iterVertices;
7475
- exports.iterWires = shapeFns.iterWires;
7476
- exports.resize = shapeFns.resize;
7477
- exports.setShapeOrigin = shapeFns.setShapeOrigin;
7478
- exports.vertexPosition = shapeFns.vertexPosition;
7479
7521
  exports.colorFaces = booleanFns.colorFaces;
7480
7522
  exports.colorShape = booleanFns.colorShape;
7481
7523
  exports.cutAll = booleanFns.cutAll;
@@ -7495,6 +7537,7 @@ exports.box = topology.box;
7495
7537
  exports.bsplineApprox = topology.bsplineApprox;
7496
7538
  exports.chamferDistAngleShape = topology.chamferDistAngle;
7497
7539
  exports.circle = topology.circle;
7540
+ exports.composeTransforms = topology.composeTransforms;
7498
7541
  exports.compound = topology.compound;
7499
7542
  exports.cone = topology.cone;
7500
7543
  exports.cylinder = topology.cylinder;
@@ -7512,6 +7555,7 @@ exports.helix = topology.helix;
7512
7555
  exports.line = topology.line;
7513
7556
  exports.offsetFace = topology.offsetFace;
7514
7557
  exports.polygon = topology.polygon;
7558
+ exports.resize = topology.resize;
7515
7559
  exports.sewShells = topology.sewShells;
7516
7560
  exports.sharedEdges = topology.sharedEdges;
7517
7561
  exports.solid = topology.solid;
@@ -7568,19 +7612,44 @@ exports.createMeshCache = meshFns.createMeshCache;
7568
7612
  exports.exportIGES = meshFns.exportIGES;
7569
7613
  exports.exportSTEP = meshFns.exportSTEP;
7570
7614
  exports.exportSTL = meshFns.exportSTL;
7615
+ exports.getBounds = topologyQueryFns.getBounds;
7616
+ exports.getEdges = topologyQueryFns.getEdges;
7617
+ exports.getFaces = topologyQueryFns.getFaces;
7618
+ exports.getVertices = topologyQueryFns.getVertices;
7619
+ exports.getWires = topologyQueryFns.getWires;
7620
+ exports.invalidateShapeCache = topologyQueryFns.invalidateShapeCache;
7621
+ exports.iterEdges = topologyQueryFns.iterEdges;
7622
+ exports.iterFaces = topologyQueryFns.iterFaces;
7623
+ exports.iterVertices = topologyQueryFns.iterVertices;
7624
+ exports.iterWires = topologyQueryFns.iterWires;
7625
+ exports.vertexPosition = topologyQueryFns.vertexPosition;
7571
7626
  exports.createDistanceQuery = measurement.createDistanceQuery;
7572
7627
  exports.measureArea = measurement.measureArea;
7573
7628
  exports.measureCurvatureAt = measurement.measureCurvatureAt;
7574
7629
  exports.measureCurvatureAtMid = measurement.measureCurvatureAtMid;
7575
7630
  exports.measureDistance = measurement.measureDistance;
7631
+ exports.measureDistanceProps = measurement.measureDistanceProps;
7576
7632
  exports.measureLength = measurement.measureLength;
7577
7633
  exports.measureLinearProps = measurement.measureLinearProps;
7578
7634
  exports.measureSurfaceProps = measurement.measureSurfaceProps;
7579
7635
  exports.measureVolume = measurement.measureVolume;
7580
7636
  exports.measureVolumeProps = measurement.measureVolumeProps;
7581
7637
  exports.fill = surfaceBuilders.fill;
7582
- exports.edgeFinder = query.edgeFinder;
7583
- exports.cornerFinder = cornerFinder.cornerFinder;
7638
+ exports.complexExtrude = sweepFns.complexExtrude;
7639
+ exports.guidedSweep = sweepFns.guidedSweep;
7640
+ exports.multiSectionSweep = sweepFns.multiSectionSweep;
7641
+ exports.supportExtrude = sweepFns.supportExtrude;
7642
+ exports.sweep = sweepFns.sweep;
7643
+ exports.twistExtrude = sweepFns.twistExtrude;
7644
+ exports.closedWire = core.closedWire;
7645
+ exports.isClosedWire = core.isClosedWire;
7646
+ exports.isManifoldShell = core.isManifoldShell;
7647
+ exports.isOrientedFace = core.isOrientedFace;
7648
+ exports.isValidSolid = core.isValidSolid;
7649
+ exports.manifoldShell = core.manifoldShell;
7650
+ exports.orientedFace = core.orientedFace;
7651
+ exports.validSolid = core.validSolid;
7652
+ exports.cornerFinder = query.cornerFinder;
7584
7653
  exports.createOperationRegistry = worker.createOperationRegistry;
7585
7654
  exports.createTaskQueue = worker.createTaskQueue;
7586
7655
  exports.createWorkerClient = worker.createWorkerClient;
@@ -7596,6 +7665,8 @@ exports.isSuccessResponse = worker.isSuccessResponse;
7596
7665
  exports.pendingCount = worker.pendingCount;
7597
7666
  exports.registerHandler = worker.registerHandler;
7598
7667
  exports.rejectAll = worker.rejectAll;
7668
+ exports.getFaceOrigins = originTrackingFns.getFaceOrigins;
7669
+ exports.setShapeOrigin = originTrackingFns.setShapeOrigin;
7599
7670
  exports.BrepWrapperError = BrepWrapperError;
7600
7671
  exports.BrepkitAdapter = BrepkitAdapter;
7601
7672
  exports.addMate = addMate;
@@ -7607,21 +7678,21 @@ exports.checkAllInterferences = checkAllInterferences;
7607
7678
  exports.checkInterference = checkInterference;
7608
7679
  exports.clone = clone;
7609
7680
  exports.computeStraightSkeleton = computeStraightSkeleton;
7681
+ exports.convexHull = convexHull;
7610
7682
  exports.cut = cut;
7611
7683
  exports.describe = describe;
7612
7684
  exports.drill = drill;
7613
7685
  exports.extrude = extrude;
7614
7686
  exports.fillet = fillet;
7615
- exports.findCurveType = findCurveType;
7616
7687
  exports.fromBREP = fromBREP;
7617
7688
  exports.fromKernelDir = fromKernelDir;
7618
7689
  exports.fromKernelPnt = fromKernelPnt;
7619
7690
  exports.fromKernelVec = fromKernelVec;
7620
7691
  exports.fuse = fuse;
7621
- exports.guidedSweep = guidedSweep;
7622
7692
  exports.heal = heal;
7623
7693
  exports.hull = hull;
7624
7694
  exports.importDXF = importDXF;
7695
+ exports.importGLB = importGLB;
7625
7696
  exports.importOBJ = importOBJ;
7626
7697
  exports.importThreeMF = importThreeMF;
7627
7698
  exports.intersect = intersect;
@@ -7639,7 +7710,6 @@ exports.meshEdges = meshEdges;
7639
7710
  exports.minkowski = minkowski;
7640
7711
  exports.mirror = mirror;
7641
7712
  exports.mirrorJoin = mirrorJoin;
7642
- exports.multiSectionSweep = multiSectionSweep;
7643
7713
  exports.offset = offset;
7644
7714
  exports.pocket = pocket;
7645
7715
  exports.polyhedron = polyhedron;
@@ -7668,7 +7738,6 @@ exports.toKernelVec = toKernelVec;
7668
7738
  exports.transformCopy = transformCopy;
7669
7739
  exports.translate = translate;
7670
7740
  exports.vertexFinder = vertexFinder;
7671
- exports.wireFinder = wireFinder;
7672
7741
  exports.withKernelDir = withKernelDir;
7673
7742
  exports.withKernelPnt = withKernelPnt;
7674
7743
  exports.withKernelVec = withKernelVec;