@faicad/faijs 0.16.0 → 0.17.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 (490) hide show
  1. package/LICENSE +4 -5
  2. package/NOTICE +5 -6
  3. package/dist/api/api-namespace.d.ts.map +1 -1
  4. package/dist/api/api-namespace.js +19 -1
  5. package/dist/api/api-namespace.js.map +1 -1
  6. package/dist/api/assembly/entities.d.ts +1 -1
  7. package/dist/api/assembly/entities.d.ts.map +1 -1
  8. package/dist/api/assembly/entities.js.map +1 -1
  9. package/dist/api/assembly/joints.d.ts +2 -2
  10. package/dist/api/assembly/joints.d.ts.map +1 -1
  11. package/dist/api/assembly/joints.js +2 -2
  12. package/dist/api/assembly/joints.js.map +1 -1
  13. package/dist/api/assembly/lower.d.ts +1 -1
  14. package/dist/api/assembly/lower.d.ts.map +1 -1
  15. package/dist/api/assembly/lower.js.map +1 -1
  16. package/dist/api/assembly/pose.d.ts +3 -3
  17. package/dist/api/assembly/pose.d.ts.map +1 -1
  18. package/dist/api/assembly/pose.js +1 -1
  19. package/dist/api/assembly/pose.js.map +1 -1
  20. package/dist/api/assembly/preview.d.ts +1 -1
  21. package/dist/api/assembly/preview.d.ts.map +1 -1
  22. package/dist/api/assembly/preview.js +1 -1
  23. package/dist/api/assembly/preview.js.map +1 -1
  24. package/dist/api/assembly/solve.d.ts.map +1 -1
  25. package/dist/api/assembly/solve.js +3 -3
  26. package/dist/api/assembly/solve.js.map +1 -1
  27. package/dist/api/assembly/solvers/assembly-tree.d.ts +98 -0
  28. package/dist/api/assembly/solvers/assembly-tree.d.ts.map +1 -0
  29. package/dist/api/assembly/solvers/assembly-tree.js +130 -0
  30. package/dist/api/assembly/solvers/assembly-tree.js.map +1 -0
  31. package/dist/api/assembly/solvers/chain-solver.d.ts +27 -0
  32. package/dist/api/assembly/solvers/chain-solver.d.ts.map +1 -0
  33. package/dist/api/assembly/solvers/chain-solver.js +330 -0
  34. package/dist/api/assembly/solvers/chain-solver.js.map +1 -0
  35. package/dist/api/assembly/solvers/global-solver.js +2 -2
  36. package/dist/api/assembly/solvers/global-solver.js.map +1 -1
  37. package/dist/api/assembly/solvers/joints-kinematics.d.ts +308 -0
  38. package/dist/api/assembly/solvers/joints-kinematics.d.ts.map +1 -0
  39. package/dist/api/assembly/solvers/joints-kinematics.js +643 -0
  40. package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -0
  41. package/dist/api/assembly/solvers/quat.d.ts +35 -0
  42. package/dist/api/assembly/solvers/quat.d.ts.map +1 -0
  43. package/dist/api/assembly/solvers/quat.js +84 -0
  44. package/dist/api/assembly/solvers/quat.js.map +1 -0
  45. package/dist/api/assembly/solvers/types.d.ts +33 -0
  46. package/dist/api/assembly/solvers/types.d.ts.map +1 -1
  47. package/dist/api/assembly/solvers/types.js.map +1 -1
  48. package/dist/api/boolean.d.ts.map +1 -1
  49. package/dist/api/boolean.js +3 -4
  50. package/dist/api/boolean.js.map +1 -1
  51. package/dist/api/brep-mirror/booleanFns.d.ts +40 -0
  52. package/dist/api/brep-mirror/booleanFns.d.ts.map +1 -0
  53. package/dist/api/brep-mirror/booleanFns.js +99 -0
  54. package/dist/api/brep-mirror/booleanFns.js.map +1 -0
  55. package/dist/api/brep-mirror/brepHelpers.d.ts +55 -0
  56. package/dist/api/brep-mirror/brepHelpers.d.ts.map +1 -0
  57. package/dist/api/brep-mirror/brepHelpers.js +131 -0
  58. package/dist/api/brep-mirror/brepHelpers.js.map +1 -0
  59. package/dist/api/brep-mirror/compoundFns.d.ts +47 -0
  60. package/dist/api/brep-mirror/compoundFns.d.ts.map +1 -0
  61. package/dist/api/brep-mirror/compoundFns.js +300 -0
  62. package/dist/api/brep-mirror/compoundFns.js.map +1 -0
  63. package/dist/api/brep-mirror/healingFns.d.ts +78 -0
  64. package/dist/api/brep-mirror/healingFns.d.ts.map +1 -0
  65. package/dist/api/brep-mirror/healingFns.js +294 -0
  66. package/dist/api/brep-mirror/healingFns.js.map +1 -0
  67. package/dist/api/brep-mirror/hullFns.d.ts +20 -0
  68. package/dist/api/brep-mirror/hullFns.d.ts.map +1 -0
  69. package/dist/api/brep-mirror/hullFns.js +46 -0
  70. package/dist/api/brep-mirror/hullFns.js.map +1 -0
  71. package/dist/api/brep-mirror/patternFns.d.ts +43 -0
  72. package/dist/api/brep-mirror/patternFns.d.ts.map +1 -0
  73. package/dist/api/brep-mirror/patternFns.js +178 -0
  74. package/dist/api/brep-mirror/patternFns.js.map +1 -0
  75. package/dist/api/brep-mirror/primitiveFns.d.ts +42 -0
  76. package/dist/api/brep-mirror/primitiveFns.d.ts.map +1 -0
  77. package/dist/api/brep-mirror/primitiveFns.js +104 -0
  78. package/dist/api/brep-mirror/primitiveFns.js.map +1 -0
  79. package/dist/api/brep-mirror/roofFns.d.ts +24 -0
  80. package/dist/api/brep-mirror/roofFns.d.ts.map +1 -0
  81. package/dist/api/brep-mirror/roofFns.js +229 -0
  82. package/dist/api/brep-mirror/roofFns.js.map +1 -0
  83. package/dist/api/brep-mirror/straightSkeleton.d.ts +36 -0
  84. package/dist/api/brep-mirror/straightSkeleton.d.ts.map +1 -0
  85. package/dist/api/brep-mirror/straightSkeleton.js +443 -0
  86. package/dist/api/brep-mirror/straightSkeleton.js.map +1 -0
  87. package/dist/api/brep-mirror/sweepFns.d.ts +55 -0
  88. package/dist/api/brep-mirror/sweepFns.d.ts.map +1 -0
  89. package/dist/api/brep-mirror/sweepFns.js +200 -0
  90. package/dist/api/brep-mirror/sweepFns.js.map +1 -0
  91. package/dist/api/brep-mirror/threadFns.d.ts +15 -0
  92. package/dist/api/brep-mirror/threadFns.d.ts.map +1 -1
  93. package/dist/api/brep-mirror/threadFns.js +37 -2
  94. package/dist/api/brep-mirror/threadFns.js.map +1 -1
  95. package/dist/api/brep-mirror/topologyFns.d.ts +74 -0
  96. package/dist/api/brep-mirror/topologyFns.d.ts.map +1 -0
  97. package/dist/api/brep-mirror/topologyFns.js +273 -0
  98. package/dist/api/brep-mirror/topologyFns.js.map +1 -0
  99. package/dist/api/brep-topology.d.ts +190 -0
  100. package/dist/api/brep-topology.d.ts.map +1 -0
  101. package/dist/api/brep-topology.js +337 -0
  102. package/dist/api/brep-topology.js.map +1 -0
  103. package/dist/api/brepjs-compat/constants.d.ts +11 -0
  104. package/dist/api/brepjs-compat/constants.d.ts.map +1 -0
  105. package/dist/api/brepjs-compat/constants.js +11 -0
  106. package/dist/api/brepjs-compat/constants.js.map +1 -0
  107. package/dist/api/brepjs-compat/index.d.ts +19 -232
  108. package/dist/api/brepjs-compat/index.d.ts.map +1 -1
  109. package/dist/api/brepjs-compat/index.js +19 -286
  110. package/dist/api/brepjs-compat/index.js.map +1 -1
  111. package/dist/api/brepjs-compat/planeOps.d.ts +98 -0
  112. package/dist/api/brepjs-compat/planeOps.d.ts.map +1 -0
  113. package/dist/api/brepjs-compat/planeOps.js +170 -0
  114. package/dist/api/brepjs-compat/planeOps.js.map +1 -0
  115. package/dist/api/brepjs-compat/planeTypes.d.ts +24 -0
  116. package/dist/api/brepjs-compat/planeTypes.d.ts.map +1 -0
  117. package/dist/api/brepjs-compat/planeTypes.js +8 -0
  118. package/dist/api/brepjs-compat/planeTypes.js.map +1 -0
  119. package/dist/api/brepjs-compat/types.d.ts +64 -0
  120. package/dist/api/brepjs-compat/types.d.ts.map +1 -0
  121. package/dist/api/brepjs-compat/types.js +48 -0
  122. package/dist/api/brepjs-compat/types.js.map +1 -0
  123. package/dist/api/brepjs-compat/vecOps.d.ts +124 -0
  124. package/dist/api/brepjs-compat/vecOps.d.ts.map +1 -0
  125. package/dist/api/brepjs-compat/vecOps.js +202 -0
  126. package/dist/api/brepjs-compat/vecOps.js.map +1 -0
  127. package/dist/api/chamfer.d.ts +5 -0
  128. package/dist/api/chamfer.d.ts.map +1 -1
  129. package/dist/api/chamfer.js +13 -8
  130. package/dist/api/chamfer.js.map +1 -1
  131. package/dist/api/compound-geom.d.ts.map +1 -1
  132. package/dist/api/compound-geom.js +8 -2
  133. package/dist/api/compound-geom.js.map +1 -1
  134. package/dist/api/draft.d.ts +69 -0
  135. package/dist/api/draft.d.ts.map +1 -0
  136. package/dist/api/draft.js +109 -0
  137. package/dist/api/draft.js.map +1 -0
  138. package/dist/api/edge-ref.d.ts.map +1 -1
  139. package/dist/api/edge-ref.js +2 -2
  140. package/dist/api/edge-ref.js.map +1 -1
  141. package/dist/api/engrave.d.ts.map +1 -1
  142. package/dist/api/engrave.js +2 -3
  143. package/dist/api/engrave.js.map +1 -1
  144. package/dist/api/extrude.d.ts.map +1 -1
  145. package/dist/api/extrude.js +28 -13
  146. package/dist/api/extrude.js.map +1 -1
  147. package/dist/api/face-ref.d.ts.map +1 -1
  148. package/dist/api/face-ref.js +2 -2
  149. package/dist/api/face-ref.js.map +1 -1
  150. package/dist/api/feature-repair.d.ts +137 -0
  151. package/dist/api/feature-repair.d.ts.map +1 -0
  152. package/dist/api/feature-repair.js +221 -0
  153. package/dist/api/feature-repair.js.map +1 -0
  154. package/dist/api/fillet-variable.d.ts +35 -0
  155. package/dist/api/fillet-variable.d.ts.map +1 -0
  156. package/dist/api/fillet-variable.js +71 -0
  157. package/dist/api/fillet-variable.js.map +1 -0
  158. package/dist/api/fillet.d.ts +3 -0
  159. package/dist/api/fillet.d.ts.map +1 -1
  160. package/dist/api/fillet.js +7 -4
  161. package/dist/api/fillet.js.map +1 -1
  162. package/dist/api/generated/2d.d.ts +1 -13
  163. package/dist/api/generated/2d.d.ts.map +1 -1
  164. package/dist/api/generated/2d.js +6 -1
  165. package/dist/api/generated/2d.js.map +1 -1
  166. package/dist/api/generated/brepjs/index.d.ts +298 -298
  167. package/dist/api/generated/brepjs/index.d.ts.map +1 -1
  168. package/dist/api/generated/brepjs/index.js +183 -183
  169. package/dist/api/generated/brepjs/index.js.map +1 -1
  170. package/dist/api/generated/core.d.ts +3 -123
  171. package/dist/api/generated/core.d.ts.map +1 -1
  172. package/dist/api/generated/core.js +2 -81
  173. package/dist/api/generated/core.js.map +1 -1
  174. package/dist/api/generated/gear.d.ts +1 -15
  175. package/dist/api/generated/gear.d.ts.map +1 -1
  176. package/dist/api/generated/gear.js +6 -3
  177. package/dist/api/generated/gear.js.map +1 -1
  178. package/dist/api/generated/io.d.ts +1 -13
  179. package/dist/api/generated/io.d.ts.map +1 -1
  180. package/dist/api/generated/io.js +6 -1
  181. package/dist/api/generated/io.js.map +1 -1
  182. package/dist/api/generated/kernel.d.ts +1 -39
  183. package/dist/api/generated/kernel.d.ts.map +1 -1
  184. package/dist/api/generated/kernel.js +6 -4
  185. package/dist/api/generated/kernel.js.map +1 -1
  186. package/dist/api/generated/measurement.d.ts +53 -97
  187. package/dist/api/generated/measurement.d.ts.map +1 -1
  188. package/dist/api/generated/measurement.js +48 -143
  189. package/dist/api/generated/measurement.js.map +1 -1
  190. package/dist/api/generated/ns.d.ts +1 -10
  191. package/dist/api/generated/ns.d.ts.map +1 -1
  192. package/dist/api/generated/ns.js +2 -10
  193. package/dist/api/generated/ns.js.map +1 -1
  194. package/dist/api/generated/operations.d.ts +65 -110
  195. package/dist/api/generated/operations.d.ts.map +1 -1
  196. package/dist/api/generated/operations.js +132 -80
  197. package/dist/api/generated/operations.js.map +1 -1
  198. package/dist/api/generated/projection.d.ts +1 -8
  199. package/dist/api/generated/projection.d.ts.map +1 -1
  200. package/dist/api/generated/projection.js +6 -4
  201. package/dist/api/generated/projection.js.map +1 -1
  202. package/dist/api/generated/query.d.ts +1 -9
  203. package/dist/api/generated/query.d.ts.map +1 -1
  204. package/dist/api/generated/query.js +6 -1
  205. package/dist/api/generated/query.js.map +1 -1
  206. package/dist/api/generated/script-face-manifest.d.ts +2 -0
  207. package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
  208. package/dist/api/generated/script-face-manifest.js +34 -22
  209. package/dist/api/generated/script-face-manifest.js.map +1 -1
  210. package/dist/api/generated/script-face.d.ts +52 -27
  211. package/dist/api/generated/script-face.d.ts.map +1 -1
  212. package/dist/api/generated/script-face.js +18 -4
  213. package/dist/api/generated/script-face.js.map +1 -1
  214. package/dist/api/generated/sketching.d.ts +4 -7
  215. package/dist/api/generated/sketching.d.ts.map +1 -1
  216. package/dist/api/generated/sketching.js +10 -8
  217. package/dist/api/generated/sketching.js.map +1 -1
  218. package/dist/api/generated/text.d.ts +1 -6
  219. package/dist/api/generated/text.d.ts.map +1 -1
  220. package/dist/api/generated/text.js +6 -3
  221. package/dist/api/generated/text.js.map +1 -1
  222. package/dist/api/generated/topology.d.ts +77 -175
  223. package/dist/api/generated/topology.d.ts.map +1 -1
  224. package/dist/api/generated/topology.js +172 -131
  225. package/dist/api/generated/topology.js.map +1 -1
  226. package/dist/api/geom.d.ts.map +1 -1
  227. package/dist/api/geom.js +2 -2
  228. package/dist/api/geom.js.map +1 -1
  229. package/dist/api/helix.d.ts +51 -0
  230. package/dist/api/helix.d.ts.map +1 -0
  231. package/dist/api/helix.js +63 -0
  232. package/dist/api/helix.js.map +1 -0
  233. package/dist/api/import-step.d.ts.map +1 -1
  234. package/dist/api/import-step.js +6 -2
  235. package/dist/api/import-step.js.map +1 -1
  236. package/dist/api/index.d.ts +18 -5
  237. package/dist/api/index.d.ts.map +1 -1
  238. package/dist/api/index.js +29 -12
  239. package/dist/api/index.js.map +1 -1
  240. package/dist/api/internal/compat-op.d.ts +10 -0
  241. package/dist/api/internal/compat-op.d.ts.map +1 -1
  242. package/dist/api/internal/compat-op.js +9 -3
  243. package/dist/api/internal/compat-op.js.map +1 -1
  244. package/dist/api/internal/compat-projection.d.ts +4 -4
  245. package/dist/api/internal/compat-projection.js +7 -7
  246. package/dist/api/internal/compat-projection.js.map +1 -1
  247. package/dist/api/internal/l3-bridge.d.ts +75 -42
  248. package/dist/api/internal/l3-bridge.d.ts.map +1 -1
  249. package/dist/api/internal/l3-bridge.js +105 -50
  250. package/dist/api/internal/l3-bridge.js.map +1 -1
  251. package/dist/api/internal/profile-wire.d.ts +31 -0
  252. package/dist/api/internal/profile-wire.d.ts.map +1 -0
  253. package/dist/api/internal/profile-wire.js +37 -0
  254. package/dist/api/internal/profile-wire.js.map +1 -0
  255. package/dist/api/internal/replica-role-table.js +2 -2
  256. package/dist/api/internal/replica-role-table.js.map +1 -1
  257. package/dist/api/loft.d.ts +66 -0
  258. package/dist/api/loft.d.ts.map +1 -0
  259. package/dist/api/loft.js +111 -0
  260. package/dist/api/loft.js.map +1 -0
  261. package/dist/api/measurement/index.d.ts +51 -0
  262. package/dist/api/measurement/index.d.ts.map +1 -0
  263. package/dist/api/measurement/index.js +71 -0
  264. package/dist/api/measurement/index.js.map +1 -0
  265. package/dist/api/occt-kernel-bridge.d.ts +5 -8
  266. package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
  267. package/dist/api/occt-kernel-bridge.js +18 -14
  268. package/dist/api/occt-kernel-bridge.js.map +1 -1
  269. package/dist/api/pattern.d.ts.map +1 -1
  270. package/dist/api/pattern.js +3 -4
  271. package/dist/api/pattern.js.map +1 -1
  272. package/dist/api/place.d.ts.map +1 -1
  273. package/dist/api/place.js +2 -4
  274. package/dist/api/place.js.map +1 -1
  275. package/dist/api/primitives.d.ts.map +1 -1
  276. package/dist/api/primitives.js +3 -4
  277. package/dist/api/primitives.js.map +1 -1
  278. package/dist/api/replicate.d.ts +28 -1
  279. package/dist/api/replicate.d.ts.map +1 -1
  280. package/dist/api/replicate.js +29 -19
  281. package/dist/api/replicate.js.map +1 -1
  282. package/dist/api/result.d.ts +6 -11
  283. package/dist/api/result.d.ts.map +1 -1
  284. package/dist/api/result.js +6 -11
  285. package/dist/api/result.js.map +1 -1
  286. package/dist/api/revolve.d.ts.map +1 -1
  287. package/dist/api/revolve.js +15 -14
  288. package/dist/api/revolve.js.map +1 -1
  289. package/dist/api/screw.d.ts +3 -0
  290. package/dist/api/screw.d.ts.map +1 -1
  291. package/dist/api/screw.js +9 -4
  292. package/dist/api/screw.js.map +1 -1
  293. package/dist/api/sdf.d.ts +1 -1
  294. package/dist/api/section-by-plane.d.ts +42 -0
  295. package/dist/api/section-by-plane.d.ts.map +1 -0
  296. package/dist/api/section-by-plane.js +61 -0
  297. package/dist/api/section-by-plane.js.map +1 -0
  298. package/dist/api/shell.d.ts +45 -0
  299. package/dist/api/shell.d.ts.map +1 -0
  300. package/dist/api/shell.js +73 -0
  301. package/dist/api/shell.js.map +1 -0
  302. package/dist/api/sketch.d.ts +8 -1
  303. package/dist/api/sketch.d.ts.map +1 -1
  304. package/dist/api/sketch.js +12 -7
  305. package/dist/api/sketch.js.map +1 -1
  306. package/dist/api/split-by-plane.d.ts +41 -0
  307. package/dist/api/split-by-plane.d.ts.map +1 -0
  308. package/dist/api/split-by-plane.js +60 -0
  309. package/dist/api/split-by-plane.js.map +1 -0
  310. package/dist/api/split.d.ts +6 -1
  311. package/dist/api/split.d.ts.map +1 -1
  312. package/dist/api/split.js +23 -9
  313. package/dist/api/split.js.map +1 -1
  314. package/dist/api/surface/arg-spec.d.ts +22 -0
  315. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  316. package/dist/api/surface/arg-spec.js +723 -476
  317. package/dist/api/surface/arg-spec.js.map +1 -1
  318. package/dist/api/sweep.d.ts +55 -0
  319. package/dist/api/sweep.d.ts.map +1 -0
  320. package/dist/api/sweep.js +86 -0
  321. package/dist/api/sweep.js.map +1 -0
  322. package/dist/api/thicken.d.ts +36 -0
  323. package/dist/api/thicken.d.ts.map +1 -0
  324. package/dist/api/thicken.js +55 -0
  325. package/dist/api/thicken.js.map +1 -0
  326. package/dist/api/transform.d.ts +8 -0
  327. package/dist/api/transform.d.ts.map +1 -1
  328. package/dist/api/transform.js +15 -4
  329. package/dist/api/transform.js.map +1 -1
  330. package/dist/api/view/cameraFns.d.ts +48 -0
  331. package/dist/api/view/cameraFns.d.ts.map +1 -0
  332. package/dist/api/view/cameraFns.js +75 -0
  333. package/dist/api/view/cameraFns.js.map +1 -0
  334. package/dist/api/view/projectionPlanes.d.ts +25 -0
  335. package/dist/api/view/projectionPlanes.d.ts.map +1 -0
  336. package/dist/api/view/projectionPlanes.js +30 -0
  337. package/dist/api/view/projectionPlanes.js.map +1 -0
  338. package/dist/api/view/view-camera.d.ts +2 -2
  339. package/dist/api/view/view-camera.d.ts.map +1 -1
  340. package/dist/api/view/view-camera.js +3 -3
  341. package/dist/api/view/view-camera.js.map +1 -1
  342. package/dist/api/view/view-projection.d.ts +9 -6
  343. package/dist/api/view/view-projection.d.ts.map +1 -1
  344. package/dist/api/view/view-projection.js +132 -65
  345. package/dist/api/view/view-projection.js.map +1 -1
  346. package/dist/api/wire.d.ts +45 -0
  347. package/dist/api/wire.d.ts.map +1 -0
  348. package/dist/api/wire.js +96 -0
  349. package/dist/api/wire.js.map +1 -0
  350. package/dist/boolean/creased-normals.d.ts +50 -0
  351. package/dist/boolean/creased-normals.d.ts.map +1 -0
  352. package/dist/boolean/creased-normals.js +114 -0
  353. package/dist/boolean/creased-normals.js.map +1 -0
  354. package/dist/boolean/deriveNormals.d.ts +4 -1
  355. package/dist/boolean/deriveNormals.d.ts.map +1 -1
  356. package/dist/boolean/deriveNormals.js +5 -2
  357. package/dist/boolean/deriveNormals.js.map +1 -1
  358. package/dist/brep/brep-ops.d.ts +6 -0
  359. package/dist/brep/brep-ops.d.ts.map +1 -1
  360. package/dist/brep/brep-ops.js +11 -2
  361. package/dist/brep/brep-ops.js.map +1 -1
  362. package/dist/brep/brep-topology.d.ts +4 -0
  363. package/dist/brep/brep-topology.d.ts.map +1 -1
  364. package/dist/brep/brep-topology.js +4 -0
  365. package/dist/brep/brep-topology.js.map +1 -1
  366. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  367. package/dist/brep/engine/adapters/brep-mock.js +79 -59
  368. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  369. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  370. package/dist/brep/engine/adapters/brepkit.js +7 -1
  371. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  372. package/dist/brep/engine/adapters/occt.d.ts +15 -7
  373. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  374. package/dist/brep/engine/adapters/occt.js +52 -167
  375. package/dist/brep/engine/adapters/occt.js.map +1 -1
  376. package/dist/brep/engine/primitives.d.ts +93 -130
  377. package/dist/brep/engine/primitives.d.ts.map +1 -1
  378. package/dist/brep/engine/primitives.js +9 -7
  379. package/dist/brep/engine/primitives.js.map +1 -1
  380. package/dist/brep/engine/types.d.ts +14 -1
  381. package/dist/brep/engine/types.d.ts.map +1 -1
  382. package/dist/brep/engine/types.js +11 -1
  383. package/dist/brep/engine/types.js.map +1 -1
  384. package/dist/brep/export/step.d.ts +3 -0
  385. package/dist/brep/export/step.d.ts.map +1 -1
  386. package/dist/brep/export/step.js +7 -1
  387. package/dist/brep/export/step.js.map +1 -1
  388. package/dist/brep/face-evolution.d.ts +8 -0
  389. package/dist/brep/face-evolution.d.ts.map +1 -1
  390. package/dist/brep/face-evolution.js +15 -3
  391. package/dist/brep/face-evolution.js.map +1 -1
  392. package/dist/brep/handle-bridge.d.ts +20 -2
  393. package/dist/brep/handle-bridge.d.ts.map +1 -1
  394. package/dist/brep/handle-bridge.js +25 -2
  395. package/dist/brep/handle-bridge.js.map +1 -1
  396. package/dist/brepkit-kernel/brepkitKernel.d.ts +25 -5
  397. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  398. package/dist/brepkit-kernel/brepkitKernel.js +336 -144
  399. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  400. package/dist/cad-runtime/admit-compat-lib.d.ts +6 -1
  401. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  402. package/dist/cad-runtime/admit-compat-lib.js +5 -1
  403. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  404. package/dist/cad-runtime/backend-dispatch.d.ts +9 -3
  405. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  406. package/dist/cad-runtime/backend-dispatch.js +32 -2
  407. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  408. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  409. package/dist/cad-runtime/direct-executor.js +8 -2
  410. package/dist/cad-runtime/direct-executor.js.map +1 -1
  411. package/dist/cad-runtime/runtime.d.ts +3 -0
  412. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  413. package/dist/cad-runtime/runtime.js +3 -1
  414. package/dist/cad-runtime/runtime.js.map +1 -1
  415. package/dist/define-op.d.ts +18 -2
  416. package/dist/define-op.d.ts.map +1 -1
  417. package/dist/define-op.js +29 -1
  418. package/dist/define-op.js.map +1 -1
  419. package/dist/env-agnostic.d.ts +3 -0
  420. package/dist/env-agnostic.d.ts.map +1 -1
  421. package/dist/env-agnostic.js +7 -0
  422. package/dist/env-agnostic.js.map +1 -1
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +3 -4
  425. package/dist/index.js.map +1 -1
  426. package/dist/lang/symbol-table.generated.d.ts +28 -0
  427. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  428. package/dist/lang/symbol-table.generated.js +29 -1
  429. package/dist/lang/symbol-table.generated.js.map +1 -1
  430. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  431. package/dist/occt-kernel/highLevelApi.js +6 -3
  432. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  433. package/dist/occt-kernel/hullGeometry.d.ts +31 -0
  434. package/dist/occt-kernel/hullGeometry.d.ts.map +1 -0
  435. package/dist/occt-kernel/hullGeometry.js +319 -0
  436. package/dist/occt-kernel/hullGeometry.js.map +1 -0
  437. package/dist/occt-kernel/hullOps.d.ts +24 -0
  438. package/dist/occt-kernel/hullOps.d.ts.map +1 -0
  439. package/dist/occt-kernel/hullOps.js +52 -0
  440. package/dist/occt-kernel/hullOps.js.map +1 -0
  441. package/dist/occt-kernel/occt-primitives.d.ts +14 -0
  442. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -0
  443. package/dist/occt-kernel/occt-primitives.js +351 -0
  444. package/dist/occt-kernel/occt-primitives.js.map +1 -0
  445. package/dist/occt-kernel/occtKernel.d.ts +14 -6
  446. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  447. package/dist/occt-kernel/occtKernel.js +11 -3
  448. package/dist/occt-kernel/occtKernel.js.map +1 -1
  449. package/dist/occt-kernel/topologyExt.js +2 -2
  450. package/dist/occt-kernel/topologyExt.js.map +1 -1
  451. package/dist/primitives/brep-primitives.d.ts +4 -0
  452. package/dist/primitives/brep-primitives.d.ts.map +1 -1
  453. package/dist/primitives/brep-primitives.js +4 -0
  454. package/dist/primitives/brep-primitives.js.map +1 -1
  455. package/dist/result/bug.d.ts +22 -0
  456. package/dist/result/bug.d.ts.map +1 -0
  457. package/dist/result/bug.js +28 -0
  458. package/dist/result/bug.js.map +1 -0
  459. package/dist/result/errors.d.ts +270 -0
  460. package/dist/result/errors.d.ts.map +1 -0
  461. package/dist/result/errors.js +317 -0
  462. package/dist/result/errors.js.map +1 -0
  463. package/dist/result/kernelErrorTranslation.d.ts +21 -0
  464. package/dist/result/kernelErrorTranslation.d.ts.map +1 -0
  465. package/dist/result/kernelErrorTranslation.js +102 -0
  466. package/dist/result/kernelErrorTranslation.js.map +1 -0
  467. package/dist/result/result.d.ts +213 -0
  468. package/dist/result/result.d.ts.map +1 -0
  469. package/dist/result/result.js +336 -0
  470. package/dist/result/result.js.map +1 -0
  471. package/dist/result/vec3.d.ts +12 -0
  472. package/dist/result/vec3.d.ts.map +1 -0
  473. package/dist/result/vec3.js +14 -0
  474. package/dist/result/vec3.js.map +1 -0
  475. package/dist/runtime-state.d.ts +9 -0
  476. package/dist/runtime-state.d.ts.map +1 -1
  477. package/dist/runtime-state.js.map +1 -1
  478. package/dist/sdk.d.ts +3 -1
  479. package/dist/sdk.d.ts.map +1 -1
  480. package/dist/sdk.js +2 -1
  481. package/dist/sdk.js.map +1 -1
  482. package/dist/shape.d.ts +43 -1
  483. package/dist/shape.d.ts.map +1 -1
  484. package/dist/shape.js +57 -1
  485. package/dist/shape.js.map +1 -1
  486. package/dist/topology/naming/geom-hint.js +1 -1
  487. package/dist/topology/naming/geom-hint.js.map +1 -1
  488. package/dist/topology/naming/score.js +1 -1
  489. package/dist/topology/naming/score.js.map +1 -1
  490. package/package.json +6 -16
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — shape healing family
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Brep-shaped implementations for `heal`, `healSolid`, `fixShape`, `autoHeal`,
8
+ * `fixSelfIntersection`, `simplify`. Semantics mirror vendored
9
+ * `topology/healingFns.ts` / `topology/shapeFns.ts` (error codes preserved),
10
+ * with the brepjs object model (castResultShape / cache invalidation) dropped:
11
+ * occt-wasm handles only. Platform-native methods (`healFace`, `healWire`,
12
+ * `simplify`, `fixSelfIntersection`) go through `getOcctKernel()` (D3).
13
+ */
14
+ import type { BrepHandle } from '../../brep/engine/types.js';
15
+ import { type Result } from '../../result/result.js';
16
+ /** Heal a solid (`ShapeFix_Solid`); error codes match vendored `healSolid`.
17
+ *
18
+ * @param args - Resolved arguments (solid shape).
19
+ * @returns The healed solid as a `BrepHandle`.
20
+ */
21
+ export declare function healSolidBrep(...args: unknown[]): Result<BrepHandle>;
22
+ /**
23
+ * Dispatch healing by shape type (solid/face/wire); other types pass through
24
+ * unchanged (vendored `heal`).
25
+ *
26
+ * @param args - Resolved arguments (shape).
27
+ * @returns The healed shape as a `BrepHandle`.
28
+ */
29
+ export declare function healBrep(...args: unknown[]): Result<BrepHandle>;
30
+ /** General-purpose repair (`ShapeFix_Shape`).
31
+ *
32
+ * @param args - Resolved arguments (shape).
33
+ * @returns The repaired shape as a `BrepHandle`.
34
+ */
35
+ export declare function fixShapeBrep(...args: unknown[]): Result<BrepHandle>;
36
+ /** Fix wire self-intersection (occt platform method).
37
+ *
38
+ * @param args - Resolved arguments (wire shape).
39
+ * @returns The fixed wire as a `BrepHandle`.
40
+ */
41
+ export declare function fixSelfIntersectionBrep(...args: unknown[]): Result<BrepHandle>;
42
+ /** Simplify a shape (occt platform method).
43
+ *
44
+ * @param args - Resolved arguments (shape).
45
+ * @returns The simplified shape as a `BrepHandle`.
46
+ */
47
+ export declare function simplifyBrep(...args: unknown[]): Result<BrepHandle>;
48
+ interface HealingStepDiagnostic {
49
+ readonly name: string;
50
+ readonly attempted: boolean;
51
+ readonly succeeded: boolean;
52
+ readonly detail?: string;
53
+ }
54
+ interface HealingReport {
55
+ readonly isValid: boolean;
56
+ readonly alreadyValid: boolean;
57
+ readonly wiresHealed: number;
58
+ readonly facesHealed: number;
59
+ readonly solidHealed: boolean;
60
+ readonly steps: ReadonlyArray<string>;
61
+ readonly diagnostics: ReadonlyArray<HealingStepDiagnostic>;
62
+ }
63
+ /**
64
+ * Auto-heal pipeline (vendored `autoHeal`): short-circuit on valid, optional
65
+ * sew / wire self-intersection pass, shape-level heal, sub-shape delta report.
66
+ *
67
+ * The returned record carries the healed shape as a raw BREP handle; the
68
+ * projection wraps it via `fromHandle` so callers receive a faijs Shape.
69
+ *
70
+ * @param args - Resolved arguments (shape, auto-heal options).
71
+ * @returns The healed shape with a diagnostic healing report.
72
+ */
73
+ export declare function autoHealBrep(...args: unknown[]): Result<{
74
+ shape: BrepHandle;
75
+ report: HealingReport;
76
+ }>;
77
+ export {};
78
+ //# sourceMappingURL=healingFns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healingFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/healingFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAqB1D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAoBpE;AA4BD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UA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for `heal`, `healSolid`, `fixShape`, `autoHeal`,
8
+ * `fixSelfIntersection`, `simplify`. Semantics mirror vendored
9
+ * `topology/healingFns.ts` / `topology/shapeFns.ts` (error codes preserved),
10
+ * with the brepjs object model (castResultShape / cache invalidation) dropped:
11
+ * occt-wasm handles only. Platform-native methods (`healFace`, `healWire`,
12
+ * `simplify`, `fixSelfIntersection`) go through `getOcctKernel()` (D3).
13
+ */
14
+ import { getBrepApi } from '../../brep/handle-bridge.js';
15
+ import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
16
+ import { ok, err } from '../../result/result.js';
17
+ import { kernelError, validationError } from '../../result/errors.js';
18
+ import { resolveArgs } from '../internal/dual-form-args.js';
19
+ import { brepHandleOf } from './brepHelpers.js';
20
+ const HEAL_PARAMS = { name: 'heal', params: ['shape'], formClass: 'A' };
21
+ const HEAL_SOLID_PARAMS = { name: 'healSolid', params: ['solid'], formClass: 'A' };
22
+ const FIX_SHAPE_PARAMS = { name: 'fixShape', params: ['shape'], formClass: 'A' };
23
+ const AUTO_HEAL_PARAMS = { name: 'autoHeal', params: ['shape', 'options'], formClass: 'A' };
24
+ const FIX_SELF_INTERSECTION_PARAMS = {
25
+ name: 'fixSelfIntersection',
26
+ params: ['shape'],
27
+ formClass: 'A',
28
+ };
29
+ const SIMPLIFY_PARAMS = { name: 'simplify', params: ['shape'], formClass: 'A' };
30
+ // ---------------------------------------------------------------------------
31
+ // heal (type-dispatching)
32
+ // ---------------------------------------------------------------------------
33
+ /** Heal a solid (`ShapeFix_Solid`); error codes match vendored `healSolid`.
34
+ *
35
+ * @param args - Resolved arguments (solid shape).
36
+ * @returns The healed solid as a `BrepHandle`.
37
+ */
38
+ export function healSolidBrep(...args) {
39
+ const [solid] = resolveArgs(args, HEAL_SOLID_PARAMS);
40
+ const kernel = getBrepApi();
41
+ const h = brepHandleOf(solid);
42
+ if (!kernel.isSolid(h))
43
+ return err(validationError('NOT_A_SOLID', 'Input shape is not a solid'));
44
+ const alreadyValid = kernel.isValid(h);
45
+ try {
46
+ const result = kernel.healSolid(h);
47
+ if (result == null || result === h) {
48
+ if (alreadyValid)
49
+ return ok(h);
50
+ return err(kernelError('HEAL_NO_EFFECT', 'Solid healing had no effect — shape is still invalid'));
51
+ }
52
+ if (!kernel.isSolid(result))
53
+ return err(kernelError('HEAL_RESULT_NOT_SOLID', 'Healed result is not a solid'));
54
+ if (!kernel.isValid(result)) {
55
+ return err(kernelError('HEAL_SOLID_INCOMPLETE', 'Healed result is still invalid after ShapeFix_Solid'));
56
+ }
57
+ return ok(result);
58
+ }
59
+ catch (e) {
60
+ return err(kernelError('HEAL_SOLID_FAILED', 'Solid healing failed', e));
61
+ }
62
+ }
63
+ /** Heal a face (`ShapeFix_Face`, occt platform method). */
64
+ function healFaceBrep(handle) {
65
+ try {
66
+ const result = getOcctKernel().healFace(handle, 1e-6);
67
+ if (getOcctKernel().getShapeType(result) !== 'face') {
68
+ return err(kernelError('HEAL_RESULT_NOT_FACE', 'Healed result is not a face'));
69
+ }
70
+ return ok(result);
71
+ }
72
+ catch (e) {
73
+ return err(kernelError('HEAL_FACE_FAILED', 'Face healing failed', e));
74
+ }
75
+ }
76
+ /** Heal a wire (`ShapeFix_Wire`, occt platform method). */
77
+ function healWireBrep(handle) {
78
+ try {
79
+ const result = getOcctKernel().healWire(handle, 1e-6);
80
+ if (getOcctKernel().getShapeType(result) !== 'wire') {
81
+ return err(kernelError('HEAL_RESULT_NOT_WIRE', 'Healed result is not a wire'));
82
+ }
83
+ return ok(result);
84
+ }
85
+ catch (e) {
86
+ return err(kernelError('HEAL_WIRE_FAILED', 'Wire healing failed', e));
87
+ }
88
+ }
89
+ /**
90
+ * Dispatch healing by shape type (solid/face/wire); other types pass through
91
+ * unchanged (vendored `heal`).
92
+ *
93
+ * @param args - Resolved arguments (shape).
94
+ * @returns The healed shape as a `BrepHandle`.
95
+ */
96
+ export function healBrep(...args) {
97
+ const [shape] = resolveArgs(args, HEAL_PARAMS);
98
+ const h = brepHandleOf(shape);
99
+ const type = getOcctKernel().getShapeType(h);
100
+ if (type === 'solid')
101
+ return healSolidBrep(shape);
102
+ if (type === 'face')
103
+ return healFaceBrep(h);
104
+ if (type === 'wire')
105
+ return healWireBrep(h);
106
+ return ok(h);
107
+ }
108
+ // ---------------------------------------------------------------------------
109
+ // fixShape / fixSelfIntersection / simplify
110
+ // ---------------------------------------------------------------------------
111
+ /** General-purpose repair (`ShapeFix_Shape`).
112
+ *
113
+ * @param args - Resolved arguments (shape).
114
+ * @returns The repaired shape as a `BrepHandle`.
115
+ */
116
+ export function fixShapeBrep(...args) {
117
+ const [shape] = resolveArgs(args, FIX_SHAPE_PARAMS);
118
+ const kernel = getBrepApi();
119
+ try {
120
+ return ok(kernel.fixShape(brepHandleOf(shape)));
121
+ }
122
+ catch (e) {
123
+ return err(kernelError('FIX_SHAPE_FAILED', 'ShapeFix_Shape failed', e));
124
+ }
125
+ }
126
+ /** Fix wire self-intersection (occt platform method).
127
+ *
128
+ * @param args - Resolved arguments (wire shape).
129
+ * @returns The fixed wire as a `BrepHandle`.
130
+ */
131
+ export function fixSelfIntersectionBrep(...args) {
132
+ const [shape] = resolveArgs(args, FIX_SELF_INTERSECTION_PARAMS);
133
+ try {
134
+ const result = getOcctKernel().healWire(brepHandleOf(shape), 1e-6);
135
+ if (getOcctKernel().getShapeType(result) !== 'wire') {
136
+ return err(kernelError('FIX_SELF_INTERSECTION_FAILED', 'Result is not a wire'));
137
+ }
138
+ return ok(result);
139
+ }
140
+ catch (e) {
141
+ return err(kernelError('FIX_SELF_INTERSECTION_FAILED', 'Failed to fix wire self-intersection', e));
142
+ }
143
+ }
144
+ /** Simplify a shape (occt platform method).
145
+ *
146
+ * @param args - Resolved arguments (shape).
147
+ * @returns The simplified shape as a `BrepHandle`.
148
+ */
149
+ export function simplifyBrep(...args) {
150
+ const [shape] = resolveArgs(args, SIMPLIFY_PARAMS);
151
+ try {
152
+ return ok(getOcctKernel().simplify(brepHandleOf(shape)));
153
+ }
154
+ catch (e) {
155
+ return err(kernelError('SIMPLIFY_FAILED', 'Kernel simplify failed', e));
156
+ }
157
+ }
158
+ /** Shape-kind check on a raw handle (occt `shapeType`). */
159
+ function kindOf(h) {
160
+ return getOcctKernel().getShapeType(h);
161
+ }
162
+ /**
163
+ * Auto-heal pipeline (vendored `autoHeal`): short-circuit on valid, optional
164
+ * sew / wire self-intersection pass, shape-level heal, sub-shape delta report.
165
+ *
166
+ * The returned record carries the healed shape as a raw BREP handle; the
167
+ * projection wraps it via `fromHandle` so callers receive a faijs Shape.
168
+ *
169
+ * @param args - Resolved arguments (shape, auto-heal options).
170
+ * @returns The healed shape with a diagnostic healing report.
171
+ */
172
+ export function autoHealBrep(...args) {
173
+ const [shape, options] = resolveArgs(args, AUTO_HEAL_PARAMS);
174
+ const opts = (options ?? {});
175
+ const fixWires = opts.fixWires !== false;
176
+ const fixFaces = opts.fixFaces !== false;
177
+ const fixSolids = opts.fixSolids !== false;
178
+ const fixSelfIntersectionOpt = opts.fixSelfIntersection === true;
179
+ const sewTolerance = opts.sewTolerance;
180
+ const steps = [];
181
+ const diagnostics = [];
182
+ const kernel = getBrepApi();
183
+ const input = brepHandleOf(shape);
184
+ const valid = kernel.isValid(input);
185
+ if (valid) {
186
+ return ok({
187
+ shape: input,
188
+ report: {
189
+ isValid: true,
190
+ alreadyValid: true,
191
+ wiresHealed: 0,
192
+ facesHealed: 0,
193
+ solidHealed: false,
194
+ steps: ['Shape already valid'],
195
+ diagnostics: [{ name: 'validation', attempted: true, succeeded: true }],
196
+ },
197
+ });
198
+ }
199
+ steps.push('Shape invalid — applying shape-level healing');
200
+ const wiresBefore = kernel.getSubShapes(input, 'wire').length;
201
+ const facesBefore = kernel.getSubShapes(input, 'face').length;
202
+ let current = input;
203
+ let solidHealed = false;
204
+ const setCurrent = (next) => {
205
+ const prev = current;
206
+ current = next;
207
+ if (prev !== input && prev !== next)
208
+ kernel.release(prev);
209
+ };
210
+ if (sewTolerance !== undefined) {
211
+ try {
212
+ setCurrent(kernel.sew([current], sewTolerance));
213
+ steps.push(`Applied sewing with tolerance ${sewTolerance}`);
214
+ diagnostics.push({ name: 'sew', attempted: true, succeeded: true, detail: `tolerance=${sewTolerance}` });
215
+ }
216
+ catch (e) {
217
+ const detail = e instanceof Error ? e.message : String(e);
218
+ steps.push(`Sewing failed: ${detail}`);
219
+ diagnostics.push({ name: 'sew', attempted: true, succeeded: false, detail });
220
+ }
221
+ }
222
+ if (fixSelfIntersectionOpt && fixWires) {
223
+ const wires = kernel.getSubShapes(current, 'wire');
224
+ let fixCount = 0;
225
+ for (const wire of wires) {
226
+ try {
227
+ getOcctKernel().healWire(wire, 1e-6);
228
+ fixCount++;
229
+ }
230
+ catch {
231
+ // Ignore individual wire failures
232
+ }
233
+ }
234
+ steps.push(`Self-intersection fix: ${fixCount}/${wires.length} wires`);
235
+ diagnostics.push({
236
+ name: 'fixSelfIntersection',
237
+ attempted: true,
238
+ succeeded: fixCount > 0,
239
+ detail: `${fixCount}/${wires.length} wires fixed`,
240
+ });
241
+ }
242
+ const kind = kindOf(current);
243
+ const shouldHealShape = (kind === 'solid' && fixSolids) || (kind === 'face' && fixFaces) || (kind === 'wire' && fixWires);
244
+ if (shouldHealShape) {
245
+ const healResult = kind === 'solid' ? healSolidBrep(current) : kind === 'face' ? healFaceBrep(current) : healWireBrep(current);
246
+ if (healResult.ok) {
247
+ setCurrent(healResult.value);
248
+ if (kind === 'solid') {
249
+ solidHealed = true;
250
+ steps.push('Applied ShapeFix_Solid');
251
+ diagnostics.push({ name: 'healSolid', attempted: true, succeeded: true });
252
+ }
253
+ else if (kind === 'face') {
254
+ steps.push('Applied ShapeFix_Face');
255
+ diagnostics.push({ name: 'healFace', attempted: true, succeeded: true });
256
+ }
257
+ else {
258
+ steps.push('Applied ShapeFix_Wire');
259
+ diagnostics.push({ name: 'healWire', attempted: true, succeeded: true });
260
+ }
261
+ }
262
+ else {
263
+ steps.push('Shape-level healing failed');
264
+ diagnostics.push({ name: 'healShape', attempted: true, succeeded: false });
265
+ }
266
+ }
267
+ else {
268
+ diagnostics.push({ name: 'healShape', attempted: false, succeeded: false, detail: 'skipped by options' });
269
+ }
270
+ const wiresAfter = kernel.getSubShapes(current, 'wire').length;
271
+ const facesAfter = kernel.getSubShapes(current, 'face').length;
272
+ const wiresHealed = Math.abs(wiresAfter - wiresBefore);
273
+ const facesHealed = Math.abs(facesAfter - facesBefore);
274
+ if (wiresHealed > 0)
275
+ steps.push(`Wire count changed by ${wiresHealed}`);
276
+ if (facesHealed > 0)
277
+ steps.push(`Face count changed by ${facesHealed}`);
278
+ const finalValid = kernel.isValid(current);
279
+ steps.push(finalValid ? 'Final validation: valid' : 'Final validation: still invalid');
280
+ diagnostics.push({ name: 'finalValidation', attempted: true, succeeded: finalValid });
281
+ return ok({
282
+ shape: current,
283
+ report: {
284
+ isValid: finalValid,
285
+ alreadyValid: false,
286
+ wiresHealed,
287
+ facesHealed,
288
+ solidHealed,
289
+ steps,
290
+ diagnostics,
291
+ },
292
+ });
293
+ }
294
+ //# sourceMappingURL=healingFns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"healingFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/healingFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAA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AAE,CAAC,CAAA;IAC3G,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAA;IAC9D,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAA;IAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,CAAA;IACtD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,CAAA;IAEtD,IAAI,WAAW,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAA;IACvE,IAAI,WAAW,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAA;IAEvE,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAA;IACtF,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAA;IAErF,OAAO,EAAE,CAAC;QACR,KAAK,EAAE,OAAO;QACd,MAAM,EAAE;YACN,OAAO,EAAE,UAAU;YACnB,YAAY,EAAE,KAAK;YACnB,WAAW;YACX,WAAW;YACX,WAAW;YACX,KAAK;YACL,WAAW;SACZ;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — shape healing family\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Brep-shaped implementations for `heal`, `healSolid`, `fixShape`, `autoHeal`,\n * `fixSelfIntersection`, `simplify`. Semantics mirror vendored\n * `topology/healingFns.ts` / `topology/shapeFns.ts` (error codes preserved),\n * with the brepjs object model (castResultShape / cache invalidation) dropped:\n * occt-wasm handles only. Platform-native methods (`healFace`, `healWire`,\n * `simplify`, `fixSelfIntersection`) go through `getOcctKernel()` (D3).\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { getOcctKernel } from '../../occt-kernel/occtKernel'\nimport { ok, err, type Result } from '../../result/result'\nimport { kernelError, validationError } from '../../result/errors'\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport { brepHandleOf } from './brepHelpers'\n\nconst HEAL_PARAMS = { name: 'heal', params: ['shape'], formClass: 'A' as FormClass }\nconst HEAL_SOLID_PARAMS = { name: 'healSolid', params: ['solid'], formClass: 'A' as FormClass }\nconst FIX_SHAPE_PARAMS = { name: 'fixShape', params: ['shape'], formClass: 'A' as FormClass }\nconst AUTO_HEAL_PARAMS = { name: 'autoHeal', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst FIX_SELF_INTERSECTION_PARAMS = {\n name: 'fixSelfIntersection',\n params: ['shape'],\n formClass: 'A' as FormClass,\n}\nconst SIMPLIFY_PARAMS = { name: 'simplify', params: ['shape'], formClass: 'A' as FormClass }\n\n// ---------------------------------------------------------------------------\n// heal (type-dispatching)\n// ---------------------------------------------------------------------------\n\n/** Heal a solid (`ShapeFix_Solid`); error codes match vendored `healSolid`.\n *\n * @param args - Resolved arguments (solid shape).\n * @returns The healed solid as a `BrepHandle`.\n */\nexport function healSolidBrep(...args: unknown[]): Result<BrepHandle> {\n const [solid] = resolveArgs(args, HEAL_SOLID_PARAMS)\n const kernel = getBrepApi()\n const h = brepHandleOf(solid)\n if (!kernel.isSolid(h)) return err(validationError('NOT_A_SOLID', 'Input shape is not a solid'))\n const alreadyValid = kernel.isValid(h)\n try {\n const result = kernel.healSolid(h)\n if (result == null || result === h) {\n if (alreadyValid) return ok(h)\n return err(kernelError('HEAL_NO_EFFECT', 'Solid healing had no effect — shape is still invalid'))\n }\n if (!kernel.isSolid(result)) return err(kernelError('HEAL_RESULT_NOT_SOLID', 'Healed result is not a solid'))\n if (!kernel.isValid(result)) {\n return err(kernelError('HEAL_SOLID_INCOMPLETE', 'Healed result is still invalid after ShapeFix_Solid'))\n }\n return ok(result)\n } catch (e) {\n return err(kernelError('HEAL_SOLID_FAILED', 'Solid healing failed', e))\n }\n}\n\n/** Heal a face (`ShapeFix_Face`, occt platform method). */\nfunction healFaceBrep(handle: BrepHandle): Result<BrepHandle> {\n try {\n const result = getOcctKernel().healFace(handle as never, 1e-6)\n if (getOcctKernel().getShapeType(result as never) !== 'face') {\n return err(kernelError('HEAL_RESULT_NOT_FACE', 'Healed result is not a face'))\n }\n return ok(result as never as BrepHandle)\n } catch (e) {\n return err(kernelError('HEAL_FACE_FAILED', 'Face healing failed', e))\n }\n}\n\n/** Heal a wire (`ShapeFix_Wire`, occt platform method). */\nfunction healWireBrep(handle: BrepHandle): Result<BrepHandle> {\n try {\n const result = getOcctKernel().healWire(handle as never, 1e-6)\n if (getOcctKernel().getShapeType(result as never) !== 'wire') {\n return err(kernelError('HEAL_RESULT_NOT_WIRE', 'Healed result is not a wire'))\n }\n return ok(result as never as BrepHandle)\n } catch (e) {\n return err(kernelError('HEAL_WIRE_FAILED', 'Wire healing failed', e))\n }\n}\n\n/**\n * Dispatch healing by shape type (solid/face/wire); other types pass through\n * unchanged (vendored `heal`).\n *\n * @param args - Resolved arguments (shape).\n * @returns The healed shape as a `BrepHandle`.\n */\nexport function healBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, HEAL_PARAMS)\n const h = brepHandleOf(shape)\n const type = getOcctKernel().getShapeType(h as never)\n if (type === 'solid') return healSolidBrep(shape)\n if (type === 'face') return healFaceBrep(h)\n if (type === 'wire') return healWireBrep(h)\n return ok(h)\n}\n\n// ---------------------------------------------------------------------------\n// fixShape / fixSelfIntersection / simplify\n// ---------------------------------------------------------------------------\n\n/** General-purpose repair (`ShapeFix_Shape`).\n *\n * @param args - Resolved arguments (shape).\n * @returns The repaired shape as a `BrepHandle`.\n */\nexport function fixShapeBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, FIX_SHAPE_PARAMS)\n const kernel = getBrepApi()\n try {\n return ok(kernel.fixShape(brepHandleOf(shape)))\n } catch (e) {\n return err(kernelError('FIX_SHAPE_FAILED', 'ShapeFix_Shape failed', e))\n }\n}\n\n/** Fix wire self-intersection (occt platform method).\n *\n * @param args - Resolved arguments (wire shape).\n * @returns The fixed wire as a `BrepHandle`.\n */\nexport function fixSelfIntersectionBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, FIX_SELF_INTERSECTION_PARAMS)\n try {\n const result = getOcctKernel().healWire(brepHandleOf(shape) as never, 1e-6)\n if (getOcctKernel().getShapeType(result as never) !== 'wire') {\n return err(kernelError('FIX_SELF_INTERSECTION_FAILED', 'Result is not a wire'))\n }\n return ok(result as never as BrepHandle)\n } catch (e) {\n return err(kernelError('FIX_SELF_INTERSECTION_FAILED', 'Failed to fix wire self-intersection', e))\n }\n}\n\n/** Simplify a shape (occt platform method).\n *\n * @param args - Resolved arguments (shape).\n * @returns The simplified shape as a `BrepHandle`.\n */\nexport function simplifyBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, SIMPLIFY_PARAMS)\n try {\n return ok(getOcctKernel().simplify(brepHandleOf(shape) as never) as never as BrepHandle)\n } catch (e) {\n return err(kernelError('SIMPLIFY_FAILED', 'Kernel simplify failed', e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// autoHeal pipeline\n// ---------------------------------------------------------------------------\n\ninterface HealingStepDiagnostic {\n readonly name: string\n readonly attempted: boolean\n readonly succeeded: boolean\n readonly detail?: string\n}\n\ninterface AutoHealOptions {\n fixWires?: boolean\n fixFaces?: boolean\n fixSolids?: boolean\n sewTolerance?: number\n fixSelfIntersection?: boolean\n}\n\ninterface HealingReport {\n readonly isValid: boolean\n readonly alreadyValid: boolean\n readonly wiresHealed: number\n readonly facesHealed: number\n readonly solidHealed: boolean\n readonly steps: ReadonlyArray<string>\n readonly diagnostics: ReadonlyArray<HealingStepDiagnostic>\n}\n\n/** Shape-kind check on a raw handle (occt `shapeType`). */\nfunction kindOf(h: BrepHandle): string {\n return getOcctKernel().getShapeType(h as never)\n}\n\n/**\n * Auto-heal pipeline (vendored `autoHeal`): short-circuit on valid, optional\n * sew / wire self-intersection pass, shape-level heal, sub-shape delta report.\n *\n * The returned record carries the healed shape as a raw BREP handle; the\n * projection wraps it via `fromHandle` so callers receive a faijs Shape.\n *\n * @param args - Resolved arguments (shape, auto-heal options).\n * @returns The healed shape with a diagnostic healing report.\n */\nexport function autoHealBrep(...args: unknown[]): Result<{ shape: BrepHandle; report: HealingReport }> {\n const [shape, options] = resolveArgs(args, AUTO_HEAL_PARAMS)\n const opts = (options ?? {}) as AutoHealOptions\n const fixWires = opts.fixWires !== false\n const fixFaces = opts.fixFaces !== false\n const fixSolids = opts.fixSolids !== false\n const fixSelfIntersectionOpt = opts.fixSelfIntersection === true\n const sewTolerance = opts.sewTolerance\n\n const steps: string[] = []\n const diagnostics: HealingStepDiagnostic[] = []\n const kernel = getBrepApi()\n const input = brepHandleOf(shape)\n\n const valid = kernel.isValid(input)\n if (valid) {\n return ok({\n shape: input,\n report: {\n isValid: true,\n alreadyValid: true,\n wiresHealed: 0,\n facesHealed: 0,\n solidHealed: false,\n steps: ['Shape already valid'],\n diagnostics: [{ name: 'validation', attempted: true, succeeded: true }],\n },\n })\n }\n\n steps.push('Shape invalid — applying shape-level healing')\n\n const wiresBefore = kernel.getSubShapes(input, 'wire').length\n const facesBefore = kernel.getSubShapes(input, 'face').length\n\n let current = input\n let solidHealed = false\n const setCurrent = (next: BrepHandle): void => {\n const prev = current\n current = next\n if (prev !== input && prev !== next) kernel.release(prev)\n }\n\n if (sewTolerance !== undefined) {\n try {\n setCurrent(kernel.sew([current], sewTolerance))\n steps.push(`Applied sewing with tolerance ${sewTolerance}`)\n diagnostics.push({ name: 'sew', attempted: true, succeeded: true, detail: `tolerance=${sewTolerance}` })\n } catch (e) {\n const detail = e instanceof Error ? e.message : String(e)\n steps.push(`Sewing failed: ${detail}`)\n diagnostics.push({ name: 'sew', attempted: true, succeeded: false, detail })\n }\n }\n\n if (fixSelfIntersectionOpt && fixWires) {\n const wires = kernel.getSubShapes(current, 'wire')\n let fixCount = 0\n for (const wire of wires) {\n try {\n getOcctKernel().healWire(wire as never, 1e-6)\n fixCount++\n } catch {\n // Ignore individual wire failures\n }\n }\n steps.push(`Self-intersection fix: ${fixCount}/${wires.length} wires`)\n diagnostics.push({\n name: 'fixSelfIntersection',\n attempted: true,\n succeeded: fixCount > 0,\n detail: `${fixCount}/${wires.length} wires fixed`,\n })\n }\n\n const kind = kindOf(current)\n const shouldHealShape =\n (kind === 'solid' && fixSolids) || (kind === 'face' && fixFaces) || (kind === 'wire' && fixWires)\n\n if (shouldHealShape) {\n const healResult = kind === 'solid' ? healSolidBrep(current) : kind === 'face' ? healFaceBrep(current) : healWireBrep(current)\n if (healResult.ok) {\n setCurrent(healResult.value)\n if (kind === 'solid') {\n solidHealed = true\n steps.push('Applied ShapeFix_Solid')\n diagnostics.push({ name: 'healSolid', attempted: true, succeeded: true })\n } else if (kind === 'face') {\n steps.push('Applied ShapeFix_Face')\n diagnostics.push({ name: 'healFace', attempted: true, succeeded: true })\n } else {\n steps.push('Applied ShapeFix_Wire')\n diagnostics.push({ name: 'healWire', attempted: true, succeeded: true })\n }\n } else {\n steps.push('Shape-level healing failed')\n diagnostics.push({ name: 'healShape', attempted: true, succeeded: false })\n }\n } else {\n diagnostics.push({ name: 'healShape', attempted: false, succeeded: false, detail: 'skipped by options' })\n }\n\n const wiresAfter = kernel.getSubShapes(current, 'wire').length\n const facesAfter = kernel.getSubShapes(current, 'face').length\n const wiresHealed = Math.abs(wiresAfter - wiresBefore)\n const facesHealed = Math.abs(facesAfter - facesBefore)\n\n if (wiresHealed > 0) steps.push(`Wire count changed by ${wiresHealed}`)\n if (facesHealed > 0) steps.push(`Face count changed by ${facesHealed}`)\n\n const finalValid = kernel.isValid(current)\n steps.push(finalValid ? 'Final validation: valid' : 'Final validation: still invalid')\n diagnostics.push({ name: 'finalValidation', attempted: true, succeeded: finalValid })\n\n return ok({\n shape: current,\n report: {\n isValid: finalValid,\n alreadyValid: false,\n wiresHealed,\n facesHealed,\n solidHealed,\n steps,\n diagnostics,\n },\n })\n}\n"]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Self-hosted compat-op implementation — convexHull
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Semantics mirror vendored `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
8
+ * HULL_NOT_3D / HULL_DEGENERATE guards) on the L1 `hullFromPoints` (core's own
9
+ * hull closure, §5.1) with tolerance 0.1 (vendored default).
10
+ */
11
+ import type { BrepHandle } from '../../brep/engine/types.js';
12
+ import { type Result } from '../../result/result.js';
13
+ /**
14
+ * Compute the convex hull of a point set.
15
+ *
16
+ * @param args - Resolved arguments (point list).
17
+ * @returns The hull solid as a `BrepHandle`.
18
+ */
19
+ export declare function convexHullBrep(...args: unknown[]): Result<BrepHandle>;
20
+ //# sourceMappingURL=hullFns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hullFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/hullFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAQ1D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CA6BrE"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Self-hosted compat-op implementation — convexHull
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Semantics mirror vendored `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
8
+ * HULL_NOT_3D / HULL_DEGENERATE guards) on the L1 `hullFromPoints` (core's own
9
+ * hull closure, §5.1) with tolerance 0.1 (vendored default).
10
+ */
11
+ import { getBrepApi } from '../../brep/handle-bridge.js';
12
+ import { ok, err } from '../../result/result.js';
13
+ import { kernelError, validationError } from '../../result/errors.js';
14
+ import { resolveArgs } from '../internal/dual-form-args.js';
15
+ const CONVEX_HULL_PARAMS = { name: 'convexHull', params: ['points'], formClass: 'A' };
16
+ /**
17
+ * Compute the convex hull of a point set.
18
+ *
19
+ * @param args - Resolved arguments (point list).
20
+ * @returns The hull solid as a `BrepHandle`.
21
+ */
22
+ export function convexHullBrep(...args) {
23
+ const [pointsRaw] = resolveArgs(args, CONVEX_HULL_PARAMS);
24
+ const kernel = getBrepApi();
25
+ const points = (pointsRaw ?? []);
26
+ if (points.length < 4) {
27
+ return err(validationError('HULL_EMPTY_INPUT', `convexHull: at least 4 points required, got ${points.length}`));
28
+ }
29
+ try {
30
+ const objPoints = points.map((p) => ({ x: p[0], y: p[1], z: p[2] }));
31
+ const h = kernel.hullFromPoints(objPoints, 0.1);
32
+ if (!kernel.isSolid(h)) {
33
+ kernel.release(h);
34
+ return err(kernelError('HULL_NOT_3D', 'convexHull result is not a solid; points may be coplanar'));
35
+ }
36
+ return ok(h);
37
+ }
38
+ catch (e) {
39
+ const raw = e instanceof Error ? e.message : String(e);
40
+ if (raw.includes('coplanar') || raw.includes('fewer than') || raw.includes('degenerate')) {
41
+ return err(kernelError('HULL_DEGENERATE', `convexHull degenerate: ${raw}`, e));
42
+ }
43
+ return err(kernelError('HULL_FAILED', `convexHull failed: ${raw}`, e));
44
+ }
45
+ }
46
+ //# sourceMappingURL=hullFns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hullFns.js","sourceRoot":"","sources":["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AAC,OAAO,CAAC,CAAC,CAAC,CAAA;YACjB,OAAO,GAAG,CAAC,WAAW,CAAC,aAAa,EAAE,0DAA0D,CAAC,CAAC,CAAA;QACpG,CAAC;QACD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtD,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACzF,OAAO,GAAG,CAAC,WAAW,CAAC,iBAAiB,EAAE,0BAA0B,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QAChF,CAAC;QACD,OAAO,GAAG,CAAC,WAAW,CAAC,aAAa,EAAE,sBAAsB,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IACxE,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementation — convexHull\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Semantics mirror vendored `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /\n * HULL_NOT_3D / HULL_DEGENERATE guards) on the L1 `hullFromPoints` (core's own\n * hull closure, §5.1) with tolerance 0.1 (vendored default).\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { ok, err, type Result } from '../../result/result'\nimport { kernelError, validationError } from '../../result/errors'\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport type { Vec3 } from '../brepjs-compat/types'\n\nconst CONVEX_HULL_PARAMS = { name: 'convexHull', params: ['points'], formClass: 'A' as FormClass }\n\n/**\n * Compute the convex hull of a point set.\n *\n * @param args - Resolved arguments (point list).\n * @returns The hull solid as a `BrepHandle`.\n */\nexport function convexHullBrep(...args: unknown[]): Result<BrepHandle> {\n const [pointsRaw] = resolveArgs(args, CONVEX_HULL_PARAMS)\n const kernel = getBrepApi()\n const points = (pointsRaw ?? []) as Vec3[]\n\n if (points.length < 4) {\n return err(\n validationError(\n 'HULL_EMPTY_INPUT',\n `convexHull: at least 4 points required, got ${points.length}`,\n ),\n )\n }\n\n try {\n const objPoints = points.map((p) => ({ x: p[0], y: p[1], z: p[2] }))\n const h = kernel.hullFromPoints(objPoints, 0.1)\n if (!kernel.isSolid(h)) {\n kernel.release(h)\n return err(kernelError('HULL_NOT_3D', 'convexHull result is not a solid; points may be coplanar'))\n }\n return ok(h)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n if (raw.includes('coplanar') || raw.includes('fewer than') || raw.includes('degenerate')) {\n return err(kernelError('HULL_DEGENERATE', `convexHull degenerate: ${raw}`, e))\n }\n return err(kernelError('HULL_FAILED', `convexHull failed: ${raw}`, e))\n }\n}\n"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — pattern family
3
+ * (core-decouple Phase 3, §5.4; G4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Semantics mirror vendored `operations/patternFns.ts` + `compoundOpsFns.ts`
8
+ * rectangularPattern, on the L1 pattern primitives (occt-primitives:
9
+ * native compound split per replica; gridPattern pre-fused compound).
10
+ * Guards: PATTERN_INVALID_COUNT / PATTERN_ZERO_DIRECTION / PATTERN_ZERO_AXIS.
11
+ */
12
+ import type { BrepHandle } from '../../brep/engine/types.js';
13
+ import { type Result } from '../../result/result.js';
14
+ /**
15
+ * Linear pattern — copy a shape along a direction (vendored patternFns.ts#linearPattern).
16
+ *
17
+ * @param args - Resolved arguments (shape, direction, count, spacing).
18
+ * @returns The fused pattern copies as a `BrepHandle`.
19
+ */
20
+ export declare function linearPatternBrep(...args: unknown[]): Result<BrepHandle>;
21
+ /**
22
+ * Circular pattern — copy a shape around an axis (vendored patternFns.ts#circularPattern).
23
+ *
24
+ * @param args - Resolved arguments (shape, axis, count, fullAngle, center).
25
+ * @returns The fused pattern copies as a `BrepHandle`.
26
+ */
27
+ export declare function circularPatternBrep(...args: unknown[]): Result<BrepHandle>;
28
+ /**
29
+ * Grid pattern — 2D grid copies of a shape (vendored patternFns.ts#gridPattern).
30
+ *
31
+ * @param args - Resolved arguments (shape, directions, counts, spacings).
32
+ * @returns The fused pattern copies as a `BrepHandle`.
33
+ */
34
+ export declare function gridPatternBrep(...args: unknown[]): Result<BrepHandle>;
35
+ /**
36
+ * Rectangular pattern — two-direction rectangular array
37
+ * (vendored compoundOpsFns.ts#rectangularPattern).
38
+ *
39
+ * @param args - Resolved arguments (shape, rectangular pattern options).
40
+ * @returns The fused pattern copies as a `BrepHandle`.
41
+ */
42
+ export declare function rectangularPatternBrep(...args: unknown[]): Result<BrepHandle>;
43
+ //# sourceMappingURL=patternFns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patternFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-mirror/patternFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAgC1D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAqBxE;AAMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAuB1E;AAMD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAgCtE;AAMD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAgD7E"}