@faicad/faijs 0.16.1 → 0.18.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 (498) 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 +20 -2
  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 +66 -29
  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 +104 -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 +276 -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 +12 -3
  128. package/dist/api/chamfer.d.ts.map +1 -1
  129. package/dist/api/chamfer.js +54 -20
  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 +44 -14
  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 +22 -10
  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 +20 -6
  237. package/dist/api/index.d.ts.map +1 -1
  238. package/dist/api/index.js +30 -13
  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/profile.d.ts +89 -0
  279. package/dist/api/profile.d.ts.map +1 -0
  280. package/dist/api/profile.js +194 -0
  281. package/dist/api/profile.js.map +1 -0
  282. package/dist/api/replicate.d.ts +28 -1
  283. package/dist/api/replicate.d.ts.map +1 -1
  284. package/dist/api/replicate.js +34 -23
  285. package/dist/api/replicate.js.map +1 -1
  286. package/dist/api/result.d.ts +6 -11
  287. package/dist/api/result.d.ts.map +1 -1
  288. package/dist/api/result.js +6 -11
  289. package/dist/api/result.js.map +1 -1
  290. package/dist/api/revolve.d.ts.map +1 -1
  291. package/dist/api/revolve.js +15 -14
  292. package/dist/api/revolve.js.map +1 -1
  293. package/dist/api/screw.d.ts +3 -0
  294. package/dist/api/screw.d.ts.map +1 -1
  295. package/dist/api/screw.js +9 -4
  296. package/dist/api/screw.js.map +1 -1
  297. package/dist/api/sdf.d.ts +1 -1
  298. package/dist/api/section-by-plane.d.ts +42 -0
  299. package/dist/api/section-by-plane.d.ts.map +1 -0
  300. package/dist/api/section-by-plane.js +61 -0
  301. package/dist/api/section-by-plane.js.map +1 -0
  302. package/dist/api/shell.d.ts +45 -0
  303. package/dist/api/shell.d.ts.map +1 -0
  304. package/dist/api/shell.js +73 -0
  305. package/dist/api/shell.js.map +1 -0
  306. package/dist/api/sketch.d.ts +8 -1
  307. package/dist/api/sketch.d.ts.map +1 -1
  308. package/dist/api/sketch.js +12 -7
  309. package/dist/api/sketch.js.map +1 -1
  310. package/dist/api/split-by-plane.d.ts +41 -0
  311. package/dist/api/split-by-plane.d.ts.map +1 -0
  312. package/dist/api/split-by-plane.js +60 -0
  313. package/dist/api/split-by-plane.js.map +1 -0
  314. package/dist/api/split.d.ts +6 -1
  315. package/dist/api/split.d.ts.map +1 -1
  316. package/dist/api/split.js +23 -9
  317. package/dist/api/split.js.map +1 -1
  318. package/dist/api/surface/arg-spec.d.ts +22 -0
  319. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  320. package/dist/api/surface/arg-spec.js +729 -477
  321. package/dist/api/surface/arg-spec.js.map +1 -1
  322. package/dist/api/sweep.d.ts +55 -0
  323. package/dist/api/sweep.d.ts.map +1 -0
  324. package/dist/api/sweep.js +86 -0
  325. package/dist/api/sweep.js.map +1 -0
  326. package/dist/api/thicken.d.ts +36 -0
  327. package/dist/api/thicken.d.ts.map +1 -0
  328. package/dist/api/thicken.js +55 -0
  329. package/dist/api/thicken.js.map +1 -0
  330. package/dist/api/transform.d.ts +8 -0
  331. package/dist/api/transform.d.ts.map +1 -1
  332. package/dist/api/transform.js +15 -4
  333. package/dist/api/transform.js.map +1 -1
  334. package/dist/api/view/cameraFns.d.ts +48 -0
  335. package/dist/api/view/cameraFns.d.ts.map +1 -0
  336. package/dist/api/view/cameraFns.js +75 -0
  337. package/dist/api/view/cameraFns.js.map +1 -0
  338. package/dist/api/view/projectionPlanes.d.ts +25 -0
  339. package/dist/api/view/projectionPlanes.d.ts.map +1 -0
  340. package/dist/api/view/projectionPlanes.js +30 -0
  341. package/dist/api/view/projectionPlanes.js.map +1 -0
  342. package/dist/api/view/view-camera.d.ts +2 -2
  343. package/dist/api/view/view-camera.d.ts.map +1 -1
  344. package/dist/api/view/view-camera.js +3 -3
  345. package/dist/api/view/view-camera.js.map +1 -1
  346. package/dist/api/view/view-projection.d.ts +9 -6
  347. package/dist/api/view/view-projection.d.ts.map +1 -1
  348. package/dist/api/view/view-projection.js +132 -65
  349. package/dist/api/view/view-projection.js.map +1 -1
  350. package/dist/api/wire.d.ts +45 -0
  351. package/dist/api/wire.d.ts.map +1 -0
  352. package/dist/api/wire.js +96 -0
  353. package/dist/api/wire.js.map +1 -0
  354. package/dist/boolean/creased-normals.d.ts +50 -0
  355. package/dist/boolean/creased-normals.d.ts.map +1 -0
  356. package/dist/boolean/creased-normals.js +114 -0
  357. package/dist/boolean/creased-normals.js.map +1 -0
  358. package/dist/boolean/deriveNormals.d.ts +4 -1
  359. package/dist/boolean/deriveNormals.d.ts.map +1 -1
  360. package/dist/boolean/deriveNormals.js +5 -2
  361. package/dist/boolean/deriveNormals.js.map +1 -1
  362. package/dist/brep/brep-ops.d.ts +6 -0
  363. package/dist/brep/brep-ops.d.ts.map +1 -1
  364. package/dist/brep/brep-ops.js +11 -2
  365. package/dist/brep/brep-ops.js.map +1 -1
  366. package/dist/brep/brep-topology.d.ts +4 -0
  367. package/dist/brep/brep-topology.d.ts.map +1 -1
  368. package/dist/brep/brep-topology.js +4 -0
  369. package/dist/brep/brep-topology.js.map +1 -1
  370. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  371. package/dist/brep/engine/adapters/brep-mock.js +79 -59
  372. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  373. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  374. package/dist/brep/engine/adapters/brepkit.js +35 -2
  375. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  376. package/dist/brep/engine/adapters/occt.d.ts +15 -7
  377. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  378. package/dist/brep/engine/adapters/occt.js +64 -167
  379. package/dist/brep/engine/adapters/occt.js.map +1 -1
  380. package/dist/brep/engine/primitives.d.ts +93 -130
  381. package/dist/brep/engine/primitives.d.ts.map +1 -1
  382. package/dist/brep/engine/primitives.js +9 -7
  383. package/dist/brep/engine/primitives.js.map +1 -1
  384. package/dist/brep/engine/types.d.ts +14 -1
  385. package/dist/brep/engine/types.d.ts.map +1 -1
  386. package/dist/brep/engine/types.js +11 -1
  387. package/dist/brep/engine/types.js.map +1 -1
  388. package/dist/brep/export/step.d.ts +3 -0
  389. package/dist/brep/export/step.d.ts.map +1 -1
  390. package/dist/brep/export/step.js +7 -1
  391. package/dist/brep/export/step.js.map +1 -1
  392. package/dist/brep/face-evolution.d.ts +8 -0
  393. package/dist/brep/face-evolution.d.ts.map +1 -1
  394. package/dist/brep/face-evolution.js +15 -3
  395. package/dist/brep/face-evolution.js.map +1 -1
  396. package/dist/brep/handle-bridge.d.ts +20 -2
  397. package/dist/brep/handle-bridge.d.ts.map +1 -1
  398. package/dist/brep/handle-bridge.js +25 -2
  399. package/dist/brep/handle-bridge.js.map +1 -1
  400. package/dist/brepkit-kernel/brepkitKernel.d.ts +25 -5
  401. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  402. package/dist/brepkit-kernel/brepkitKernel.js +782 -218
  403. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  404. package/dist/brepkit-kernel/multi-version-test.d.ts +40 -0
  405. package/dist/brepkit-kernel/multi-version-test.d.ts.map +1 -0
  406. package/dist/brepkit-kernel/multi-version-test.js +89 -0
  407. package/dist/brepkit-kernel/multi-version-test.js.map +1 -0
  408. package/dist/cad-runtime/admit-compat-lib.d.ts +6 -1
  409. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  410. package/dist/cad-runtime/admit-compat-lib.js +5 -1
  411. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  412. package/dist/cad-runtime/backend-dispatch.d.ts +9 -3
  413. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  414. package/dist/cad-runtime/backend-dispatch.js +32 -2
  415. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  416. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  417. package/dist/cad-runtime/direct-executor.js +8 -2
  418. package/dist/cad-runtime/direct-executor.js.map +1 -1
  419. package/dist/cad-runtime/runtime.d.ts +3 -0
  420. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  421. package/dist/cad-runtime/runtime.js +3 -1
  422. package/dist/cad-runtime/runtime.js.map +1 -1
  423. package/dist/define-op.d.ts +18 -2
  424. package/dist/define-op.d.ts.map +1 -1
  425. package/dist/define-op.js +29 -1
  426. package/dist/define-op.js.map +1 -1
  427. package/dist/env-agnostic.d.ts +3 -0
  428. package/dist/env-agnostic.d.ts.map +1 -1
  429. package/dist/env-agnostic.js +7 -0
  430. package/dist/env-agnostic.js.map +1 -1
  431. package/dist/index.d.ts.map +1 -1
  432. package/dist/index.js +3 -4
  433. package/dist/index.js.map +1 -1
  434. package/dist/lang/symbol-table.generated.d.ts +29 -1
  435. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  436. package/dist/lang/symbol-table.generated.js +30 -2
  437. package/dist/lang/symbol-table.generated.js.map +1 -1
  438. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  439. package/dist/occt-kernel/highLevelApi.js +6 -3
  440. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  441. package/dist/occt-kernel/hullGeometry.d.ts +31 -0
  442. package/dist/occt-kernel/hullGeometry.d.ts.map +1 -0
  443. package/dist/occt-kernel/hullGeometry.js +319 -0
  444. package/dist/occt-kernel/hullGeometry.js.map +1 -0
  445. package/dist/occt-kernel/hullOps.d.ts +24 -0
  446. package/dist/occt-kernel/hullOps.d.ts.map +1 -0
  447. package/dist/occt-kernel/hullOps.js +52 -0
  448. package/dist/occt-kernel/hullOps.js.map +1 -0
  449. package/dist/occt-kernel/occt-primitives.d.ts +14 -0
  450. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -0
  451. package/dist/occt-kernel/occt-primitives.js +351 -0
  452. package/dist/occt-kernel/occt-primitives.js.map +1 -0
  453. package/dist/occt-kernel/occtKernel.d.ts +14 -6
  454. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  455. package/dist/occt-kernel/occtKernel.js +11 -3
  456. package/dist/occt-kernel/occtKernel.js.map +1 -1
  457. package/dist/occt-kernel/topologyExt.js +2 -2
  458. package/dist/occt-kernel/topologyExt.js.map +1 -1
  459. package/dist/primitives/brep-primitives.d.ts +4 -0
  460. package/dist/primitives/brep-primitives.d.ts.map +1 -1
  461. package/dist/primitives/brep-primitives.js +4 -0
  462. package/dist/primitives/brep-primitives.js.map +1 -1
  463. package/dist/result/bug.d.ts +22 -0
  464. package/dist/result/bug.d.ts.map +1 -0
  465. package/dist/result/bug.js +28 -0
  466. package/dist/result/bug.js.map +1 -0
  467. package/dist/result/errors.d.ts +270 -0
  468. package/dist/result/errors.d.ts.map +1 -0
  469. package/dist/result/errors.js +317 -0
  470. package/dist/result/errors.js.map +1 -0
  471. package/dist/result/kernelErrorTranslation.d.ts +21 -0
  472. package/dist/result/kernelErrorTranslation.d.ts.map +1 -0
  473. package/dist/result/kernelErrorTranslation.js +102 -0
  474. package/dist/result/kernelErrorTranslation.js.map +1 -0
  475. package/dist/result/result.d.ts +213 -0
  476. package/dist/result/result.d.ts.map +1 -0
  477. package/dist/result/result.js +336 -0
  478. package/dist/result/result.js.map +1 -0
  479. package/dist/result/vec3.d.ts +12 -0
  480. package/dist/result/vec3.d.ts.map +1 -0
  481. package/dist/result/vec3.js +14 -0
  482. package/dist/result/vec3.js.map +1 -0
  483. package/dist/runtime-state.d.ts +9 -0
  484. package/dist/runtime-state.d.ts.map +1 -1
  485. package/dist/runtime-state.js.map +1 -1
  486. package/dist/sdk.d.ts +3 -1
  487. package/dist/sdk.d.ts.map +1 -1
  488. package/dist/sdk.js +2 -1
  489. package/dist/sdk.js.map +1 -1
  490. package/dist/shape.d.ts +43 -1
  491. package/dist/shape.d.ts.map +1 -1
  492. package/dist/shape.js +57 -1
  493. package/dist/shape.js.map +1 -1
  494. package/dist/topology/naming/geom-hint.js +1 -1
  495. package/dist/topology/naming/geom-hint.js.map +1 -1
  496. package/dist/topology/naming/score.js +1 -1
  497. package/dist/topology/naming/score.js.map +1 -1
  498. package/package.json +6 -16
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — compound feature family
3
+ * (core-decouple Phase 3, §5.4; drill / pocket / boss / mirrorJoin).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Semantics mirror vendored `operations/compoundOpsFns.ts` with the brepjs
8
+ * object model dropped:
9
+ * - `options.face` supports an omitted default (highest-Z face) or an already
10
+ * constructed brepjs Face (`{ wrapped }`); FinderFn (brepjs finder DSL) is
11
+ * not supported after selfhosting.
12
+ * - `options.profile` must be an already constructed brepjs Wire (`{ wrapped }`);
13
+ * DrawingLike (sketchOnPlane) is not supported (sketch DSL is the brepjs
14
+ * compat surface, not a core data type).
15
+ * Intermediates (tool/profile face/positioned face) are released after use.
16
+ */
17
+ import { getBrepApi } from '../../brep/handle-bridge.js';
18
+ import { ok, err, isErr } from '../../result/result.js';
19
+ import { kernelError, validationError } from '../../result/errors.js';
20
+ import { resolveArgs } from '../internal/dual-form-args.js';
21
+ import { brepHandleOf, composeAffine, rotationZTo, translationMatrix } from './brepHelpers.js';
22
+ const DRILL_PARAMS = { name: 'drill', params: ['shape', 'options'], formClass: 'A' };
23
+ const POCKET_PARAMS = { name: 'pocket', params: ['shape', 'options'], formClass: 'A' };
24
+ const BOSS_PARAMS = { name: 'boss', params: ['shape', 'options'], formClass: 'A' };
25
+ const MIRROR_JOIN_PARAMS = { name: 'mirrorJoin', params: ['shape', 'options'], formClass: 'A' };
26
+ // ---------------------------------------------------------------------------
27
+ // Vec helpers (vendored vecOps)
28
+ // ---------------------------------------------------------------------------
29
+ function vecIsZero(v) {
30
+ return v[0] === 0 && v[1] === 0 && v[2] === 0;
31
+ }
32
+ function vecNormalize(v) {
33
+ const len = Math.hypot(v[0], v[1], v[2]);
34
+ return [v[0] / len, v[1] / len, v[2] / len];
35
+ }
36
+ function vecScale(v, k) {
37
+ return [v[0] * k, v[1] * k, v[2] * k];
38
+ }
39
+ // ---------------------------------------------------------------------------
40
+ // Face/profile helpers
41
+ // ---------------------------------------------------------------------------
42
+ /** 构造位于 pos、沿 dir 轴的 cylinder(radius × height),返回句柄(调用方负责释放/消费)。 */
43
+ function cylinderAt(kernel, radius, height, pos, dir) {
44
+ const base = kernel.makeCylinder(radius, height);
45
+ const m = composeAffine(rotationZTo(dir), translationMatrix(pos));
46
+ const placed = kernel.located(base, m);
47
+ kernel.release(base);
48
+ return placed;
49
+ }
50
+ /** 解析目标面:省略 → 最高 Z 面(faceCenter 最大);Face({wrapped})→ 直取。 */
51
+ function resolveTargetFace(kernel, shape, faceSpec) {
52
+ if (faceSpec === undefined || faceSpec === null) {
53
+ const faces = kernel.getSubShapes(shape, 'face');
54
+ if (faces.length === 0) {
55
+ return err(validationError('COMPOUND_NO_FACES', 'compoundOps: shape has no faces'));
56
+ }
57
+ let best = faces[0];
58
+ let bestZ = kernel.surfaceCenterOfMass(best).z;
59
+ for (let i = 1; i < faces.length; i++) {
60
+ const z = kernel.surfaceCenterOfMass(faces[i]).z;
61
+ if (z > bestZ) {
62
+ best = faces[i];
63
+ bestZ = z;
64
+ }
65
+ }
66
+ return ok(best);
67
+ }
68
+ if (typeof faceSpec === 'object') {
69
+ try {
70
+ return ok(brepHandleOf(faceSpec));
71
+ }
72
+ catch {
73
+ return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'));
74
+ }
75
+ }
76
+ return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'));
77
+ }
78
+ /** 面法向(uv 中心,vendored normalAt)。 */
79
+ function faceNormalAt(kernel, face) {
80
+ const b = kernel.uvBounds(face);
81
+ const u = 0.5 * (b.uMin + b.uMax);
82
+ const v = 0.5 * (b.vMin + b.vMax);
83
+ const n = kernel.surfaceNormal(face, u, v);
84
+ return [n.x, n.y, n.z];
85
+ }
86
+ /** 面质心(vendored faceCenter)。 */
87
+ function faceCenterAt(kernel, face) {
88
+ const c = kernel.surfaceCenterOfMass(face);
89
+ return [c.x, c.y, c.z];
90
+ }
91
+ /** profile(brepjs Wire)→ face handle。 */
92
+ function profileToFace(kernel, profile) {
93
+ try {
94
+ const wire = brepHandleOf(profile);
95
+ return ok(kernel.makeFace(wire));
96
+ }
97
+ catch (e) {
98
+ const raw = e instanceof Error ? e.message : String(e);
99
+ return err(validationError('COMPOUND_PROFILE_INVALID', `compoundOps: profile must be a brepjs Wire (${raw})`));
100
+ }
101
+ }
102
+ // ---------------------------------------------------------------------------
103
+ // drill — cut a cylinder through the shape
104
+ // ---------------------------------------------------------------------------
105
+ /**
106
+ * Drill — cut a cylinder through the shape.
107
+ *
108
+ * @param args - Resolved arguments (shape, drill options).
109
+ * @returns The drilled shape as a `BrepHandle`.
110
+ */
111
+ export function drillBrep(...args) {
112
+ const [shape, options] = resolveArgs(args, DRILL_PARAMS);
113
+ const kernel = getBrepApi();
114
+ const s = brepHandleOf(shape);
115
+ const { at, radius, axis, depth } = options;
116
+ const ax = (axis ?? [0, 0, 1]);
117
+ if (radius <= 0)
118
+ return err(validationError('DRILL_INVALID_RADIUS', 'Drill radius must be positive'));
119
+ if (vecIsZero(ax))
120
+ return err(validationError('DRILL_ZERO_AXIS', 'Drill axis cannot be zero'));
121
+ const dir = vecNormalize([ax[0], ax[1], ax[2]]);
122
+ const pos = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]];
123
+ let tool;
124
+ try {
125
+ if (depth !== undefined) {
126
+ tool = cylinderAt(kernel, radius, depth, pos, dir);
127
+ }
128
+ else {
129
+ // Through-all: project bounding box onto the drill axis, add overshoot.
130
+ const bb = kernel.getBoundingBox(s);
131
+ const corners = [
132
+ [bb.xmin, bb.ymin, bb.zmin],
133
+ [bb.xmax, bb.ymin, bb.zmin],
134
+ [bb.xmin, bb.ymax, bb.zmin],
135
+ [bb.xmax, bb.ymax, bb.zmin],
136
+ [bb.xmin, bb.ymin, bb.zmax],
137
+ [bb.xmax, bb.ymin, bb.zmax],
138
+ [bb.xmin, bb.ymax, bb.zmax],
139
+ [bb.xmax, bb.ymax, bb.zmax],
140
+ ];
141
+ let tMin = Infinity;
142
+ let tMax = -Infinity;
143
+ for (const c of corners) {
144
+ const t = (c[0] - pos[0]) * dir[0] + (c[1] - pos[1]) * dir[1] + (c[2] - pos[2]) * dir[2];
145
+ if (t < tMin)
146
+ tMin = t;
147
+ if (t > tMax)
148
+ tMax = t;
149
+ }
150
+ const overshoot = 1;
151
+ tMin -= overshoot;
152
+ tMax += overshoot;
153
+ const d = tMax - tMin;
154
+ const startPos = [
155
+ pos[0] + dir[0] * tMin,
156
+ pos[1] + dir[1] * tMin,
157
+ pos[2] + dir[2] * tMin,
158
+ ];
159
+ tool = cylinderAt(kernel, radius, d, startPos, dir);
160
+ }
161
+ return ok(kernel.cut(s, tool));
162
+ }
163
+ catch (e) {
164
+ const raw = e instanceof Error ? e.message : String(e);
165
+ return err(kernelError('DRILL_FAILED', `drill failed: ${raw}`, e));
166
+ }
167
+ finally {
168
+ if (tool !== undefined)
169
+ kernel.release(tool);
170
+ }
171
+ }
172
+ // ---------------------------------------------------------------------------
173
+ // pocket — extrude a profile inward and cut
174
+ // ---------------------------------------------------------------------------
175
+ /**
176
+ * Pocket — extrude a profile inward and cut it from the shape.
177
+ *
178
+ * @param args - Resolved arguments (shape, pocket options).
179
+ * @returns The pocketed shape as a `BrepHandle`.
180
+ */
181
+ export function pocketBrep(...args) {
182
+ const [shape, options] = resolveArgs(args, POCKET_PARAMS);
183
+ const kernel = getBrepApi();
184
+ const s = brepHandleOf(shape);
185
+ const { profile, depth } = options;
186
+ if (depth <= 0)
187
+ return err(validationError('POCKET_INVALID_DEPTH', 'Pocket depth must be positive'));
188
+ const faceRes = resolveTargetFace(kernel, s, options.face);
189
+ if (isErr(faceRes))
190
+ return faceRes;
191
+ const face = faceRes.value;
192
+ const normal = faceNormalAt(kernel, face);
193
+ const center = faceCenterAt(kernel, face);
194
+ const profRes = profileToFace(kernel, profile);
195
+ if (isErr(profRes))
196
+ return profRes;
197
+ const profFace = profRes.value;
198
+ let positioned;
199
+ let tool;
200
+ try {
201
+ positioned = kernel.translate(profFace, center[0], center[1], center[2]);
202
+ kernel.release(profFace);
203
+ const nn = vecNormalize([normal[0], normal[1], normal[2]]);
204
+ const extDir = vecScale(nn, -depth);
205
+ tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2]);
206
+ kernel.release(positioned);
207
+ return ok(kernel.cut(s, tool));
208
+ }
209
+ catch (e) {
210
+ const raw = e instanceof Error ? e.message : String(e);
211
+ return err(kernelError('POCKET_FAILED', `pocket failed: ${raw}`, e));
212
+ }
213
+ finally {
214
+ if (tool !== undefined)
215
+ kernel.release(tool);
216
+ if (positioned !== undefined)
217
+ kernel.release(positioned);
218
+ }
219
+ }
220
+ // ---------------------------------------------------------------------------
221
+ // boss — extrude a profile outward and fuse
222
+ // ---------------------------------------------------------------------------
223
+ /**
224
+ * Boss — extrude a profile outward and fuse it onto the shape.
225
+ *
226
+ * @param args - Resolved arguments (shape, boss options).
227
+ * @returns The shape with the boss fused as a `BrepHandle`.
228
+ */
229
+ export function bossBrep(...args) {
230
+ const [shape, options] = resolveArgs(args, BOSS_PARAMS);
231
+ const kernel = getBrepApi();
232
+ const s = brepHandleOf(shape);
233
+ const { profile, height } = options;
234
+ if (height <= 0)
235
+ return err(validationError('BOSS_INVALID_HEIGHT', 'Boss height must be positive'));
236
+ const faceRes = resolveTargetFace(kernel, s, options.face);
237
+ if (isErr(faceRes))
238
+ return faceRes;
239
+ const face = faceRes.value;
240
+ const normal = faceNormalAt(kernel, face);
241
+ const center = faceCenterAt(kernel, face);
242
+ const profRes = profileToFace(kernel, profile);
243
+ if (isErr(profRes))
244
+ return profRes;
245
+ const profFace = profRes.value;
246
+ let positioned;
247
+ let tool;
248
+ try {
249
+ positioned = kernel.translate(profFace, center[0], center[1], center[2]);
250
+ kernel.release(profFace);
251
+ const nn = vecNormalize([normal[0], normal[1], normal[2]]);
252
+ const extDir = vecScale(nn, height);
253
+ tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2]);
254
+ kernel.release(positioned);
255
+ return ok(kernel.fuse(s, tool));
256
+ }
257
+ catch (e) {
258
+ const raw = e instanceof Error ? e.message : String(e);
259
+ return err(kernelError('BOSS_FAILED', `boss failed: ${raw}`, e));
260
+ }
261
+ finally {
262
+ if (tool !== undefined)
263
+ kernel.release(tool);
264
+ if (positioned !== undefined)
265
+ kernel.release(positioned);
266
+ }
267
+ }
268
+ // ---------------------------------------------------------------------------
269
+ // mirrorJoin — mirror and fuse in one step
270
+ // ---------------------------------------------------------------------------
271
+ /**
272
+ * Mirror the shape across a plane and fuse the mirrored copy to the original.
273
+ *
274
+ * @param args - Resolved arguments (shape, mirror options).
275
+ * @returns The shape joined with its mirror as a `BrepHandle`.
276
+ */
277
+ export function mirrorJoinBrep(...args) {
278
+ const [shape, options] = resolveArgs(args, MIRROR_JOIN_PARAMS);
279
+ const kernel = getBrepApi();
280
+ const s = brepHandleOf(shape);
281
+ const { normal, at } = (options ?? {});
282
+ const n = (normal ?? [1, 0, 0]);
283
+ if (vecIsZero(n))
284
+ return err(validationError('MIRROR_ZERO_NORMAL', 'Mirror plane normal cannot be zero'));
285
+ const origin = (at ?? [0, 0, 0]);
286
+ let mirrored;
287
+ try {
288
+ mirrored = kernel.mirror(s, { x: origin[0], y: origin[1], z: origin[2] }, { x: n[0], y: n[1], z: n[2] });
289
+ return ok(kernel.fuse(s, mirrored));
290
+ }
291
+ catch (e) {
292
+ const raw = e instanceof Error ? e.message : String(e);
293
+ return err(kernelError('MIRROR_JOIN_FAILED', `mirrorJoin failed: ${raw}`, e));
294
+ }
295
+ finally {
296
+ if (mirrored !== undefined)
297
+ kernel.release(mirrored);
298
+ }
299
+ }
300
+ //# sourceMappingURL=compoundFns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compoundFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/compoundFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAe,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE3F,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AACjG,MAAM,aAAa,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AACnG,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAC/F,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAE5G,8EAA8E;A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E,CAAC,CAAC,CAAS,CAAA;IAEvC,IAAI,SAAS,CAAC,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC,eAAe,CAAC,oBAAoB,EAAE,oCAAoC,CAAC,CAAC,CAAA;IAEzG,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAS,CAAA;IACxC,IAAI,QAAgC,CAAA;IACpC,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,CAAC,MAAM,CACtB,CAAC,EACD,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAC5C,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAC9B,CAAA;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;IACrC,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,OAAO,GAAG,CAAC,WAAW,CAAC,oBAAoB,EAAE,sBAAsB,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAC/E,CAAC;YAAS,CAAC;QACT,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACtD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — compound feature family\n * (core-decouple Phase 3, §5.4; drill / pocket / boss / mirrorJoin).\n *\n * @platform occt\n *\n * Semantics mirror vendored `operations/compoundOpsFns.ts` with the brepjs\n * object model dropped:\n * - `options.face` supports an omitted default (highest-Z face) or an already\n * constructed brepjs Face (`{ wrapped }`); FinderFn (brepjs finder DSL) is\n * not supported after selfhosting.\n * - `options.profile` must be an already constructed brepjs Wire (`{ wrapped }`);\n * DrawingLike (sketchOnPlane) is not supported (sketch DSL is the brepjs\n * compat surface, not a core data type).\n * Intermediates (tool/profile face/positioned face) are released after use.\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { ok, err, isErr, 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'\nimport { brepHandleOf, composeAffine, rotationZTo, translationMatrix } from './brepHelpers'\n\nconst DRILL_PARAMS = { name: 'drill', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst POCKET_PARAMS = { name: 'pocket', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst BOSS_PARAMS = { name: 'boss', params: ['shape', 'options'], formClass: 'A' as FormClass }\nconst MIRROR_JOIN_PARAMS = { name: 'mirrorJoin', params: ['shape', 'options'], formClass: 'A' as FormClass }\n\n// ---------------------------------------------------------------------------\n// Vec helpers (vendored vecOps)\n// ---------------------------------------------------------------------------\n\nfunction vecIsZero(v: readonly number[]): boolean {\n return v[0] === 0 && v[1] === 0 && v[2] === 0\n}\n\nfunction vecNormalize(v: readonly [number, number, number]): [number, number, number] {\n const len = Math.hypot(v[0], v[1], v[2])\n return [v[0] / len, v[1] / len, v[2] / len]\n}\n\nfunction vecScale(v: readonly [number, number, number], k: number): [number, number, number] {\n return [v[0] * k, v[1] * k, v[2] * k]\n}\n\n// ---------------------------------------------------------------------------\n// Face/profile helpers\n// ---------------------------------------------------------------------------\n\n/** 构造位于 pos、沿 dir 轴的 cylinder(radius × height),返回句柄(调用方负责释放/消费)。 */\nfunction cylinderAt(\n kernel: ReturnType<typeof getBrepApi>,\n radius: number,\n height: number,\n pos: [number, number, number],\n dir: [number, number, number],\n): BrepHandle {\n const base = kernel.makeCylinder(radius, height)\n const m = composeAffine(rotationZTo(dir), translationMatrix(pos))\n const placed = kernel.located(base, m as number[])\n kernel.release(base)\n return placed\n}\n\n/** 解析目标面:省略 → 最高 Z 面(faceCenter 最大);Face({wrapped})→ 直取。 */\nfunction resolveTargetFace(\n kernel: ReturnType<typeof getBrepApi>,\n shape: BrepHandle,\n faceSpec: unknown,\n): Result<BrepHandle> {\n if (faceSpec === undefined || faceSpec === null) {\n const faces = kernel.getSubShapes(shape, 'face')\n if (faces.length === 0) {\n return err(validationError('COMPOUND_NO_FACES', 'compoundOps: shape has no faces'))\n }\n let best = faces[0]\n let bestZ = kernel.surfaceCenterOfMass(best).z\n for (let i = 1; i < faces.length; i++) {\n const z = kernel.surfaceCenterOfMass(faces[i]).z\n if (z > bestZ) {\n best = faces[i]\n bestZ = z\n }\n }\n return ok(best)\n }\n if (typeof faceSpec === 'object') {\n try {\n return ok(brepHandleOf(faceSpec))\n } catch {\n return err(\n validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'),\n )\n }\n }\n return err(validationError('COMPOUND_FACE_NOT_FOUND', 'compoundOps: face spec must be a brepjs Face handle or omitted'))\n}\n\n/** 面法向(uv 中心,vendored normalAt)。 */\nfunction faceNormalAt(kernel: ReturnType<typeof getBrepApi>, face: BrepHandle): Vec3 {\n const b = kernel.uvBounds(face)\n const u = 0.5 * (b.uMin + b.uMax)\n const v = 0.5 * (b.vMin + b.vMax)\n const n = kernel.surfaceNormal(face, u, v)\n return [n.x, n.y, n.z]\n}\n\n/** 面质心(vendored faceCenter)。 */\nfunction faceCenterAt(kernel: ReturnType<typeof getBrepApi>, face: BrepHandle): Vec3 {\n const c = kernel.surfaceCenterOfMass(face)\n return [c.x, c.y, c.z]\n}\n\n/** profile(brepjs Wire)→ face handle。 */\nfunction profileToFace(kernel: ReturnType<typeof getBrepApi>, profile: unknown): Result<BrepHandle> {\n try {\n const wire = brepHandleOf(profile)\n return ok(kernel.makeFace(wire))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(\n validationError('COMPOUND_PROFILE_INVALID', `compoundOps: profile must be a brepjs Wire (${raw})`),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// drill — cut a cylinder through the shape\n// ---------------------------------------------------------------------------\n\n/**\n * Drill — cut a cylinder through the shape.\n *\n * @param args - Resolved arguments (shape, drill options).\n * @returns The drilled shape as a `BrepHandle`.\n */\nexport function drillBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, DRILL_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { at, radius, axis, depth } = options as {\n at: Vec3 | [number, number]\n radius: number\n axis?: Vec3\n depth?: number\n }\n const ax = (axis ?? [0, 0, 1]) as Vec3\n\n if (radius <= 0) return err(validationError('DRILL_INVALID_RADIUS', 'Drill radius must be positive'))\n if (vecIsZero(ax)) return err(validationError('DRILL_ZERO_AXIS', 'Drill axis cannot be zero'))\n\n const dir = vecNormalize([ax[0], ax[1], ax[2]])\n const pos: [number, number, number] = at.length === 2 ? [at[0], at[1], 0] : [at[0], at[1], at[2]]\n\n let tool: BrepHandle | undefined\n try {\n if (depth !== undefined) {\n tool = cylinderAt(kernel, radius, depth, pos, dir)\n } else {\n // Through-all: project bounding box onto the drill axis, add overshoot.\n const bb = kernel.getBoundingBox(s)\n const corners: [number, number, number][] = [\n [bb.xmin, bb.ymin, bb.zmin],\n [bb.xmax, bb.ymin, bb.zmin],\n [bb.xmin, bb.ymax, bb.zmin],\n [bb.xmax, bb.ymax, bb.zmin],\n [bb.xmin, bb.ymin, bb.zmax],\n [bb.xmax, bb.ymin, bb.zmax],\n [bb.xmin, bb.ymax, bb.zmax],\n [bb.xmax, bb.ymax, bb.zmax],\n ]\n let tMin = Infinity\n let tMax = -Infinity\n for (const c of corners) {\n const t = (c[0] - pos[0]) * dir[0] + (c[1] - pos[1]) * dir[1] + (c[2] - pos[2]) * dir[2]\n if (t < tMin) tMin = t\n if (t > tMax) tMax = t\n }\n const overshoot = 1\n tMin -= overshoot\n tMax += overshoot\n const d = tMax - tMin\n const startPos: [number, number, number] = [\n pos[0] + dir[0] * tMin,\n pos[1] + dir[1] * tMin,\n pos[2] + dir[2] * tMin,\n ]\n tool = cylinderAt(kernel, radius, d, startPos, dir)\n }\n return ok(kernel.cut(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('DRILL_FAILED', `drill failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n }\n}\n\n// ---------------------------------------------------------------------------\n// pocket — extrude a profile inward and cut\n// ---------------------------------------------------------------------------\n\n/**\n * Pocket — extrude a profile inward and cut it from the shape.\n *\n * @param args - Resolved arguments (shape, pocket options).\n * @returns The pocketed shape as a `BrepHandle`.\n */\nexport function pocketBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, POCKET_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { profile, depth } = options as { profile: unknown; depth: number; face?: unknown }\n\n if (depth <= 0) return err(validationError('POCKET_INVALID_DEPTH', 'Pocket depth must be positive'))\n\n const faceRes = resolveTargetFace(kernel, s, (options as { face?: unknown }).face)\n if (isErr(faceRes)) return faceRes\n const face = faceRes.value\n const normal = faceNormalAt(kernel, face)\n const center = faceCenterAt(kernel, face)\n\n const profRes = profileToFace(kernel, profile)\n if (isErr(profRes)) return profRes\n const profFace = profRes.value\n\n let positioned: BrepHandle | undefined\n let tool: BrepHandle | undefined\n try {\n positioned = kernel.translate(profFace, center[0], center[1], center[2])\n kernel.release(profFace)\n const nn = vecNormalize([normal[0], normal[1], normal[2]])\n const extDir = vecScale(nn, -depth)\n tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2])\n kernel.release(positioned)\n return ok(kernel.cut(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('POCKET_FAILED', `pocket failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n if (positioned !== undefined) kernel.release(positioned)\n }\n}\n\n// ---------------------------------------------------------------------------\n// boss — extrude a profile outward and fuse\n// ---------------------------------------------------------------------------\n\n/**\n * Boss — extrude a profile outward and fuse it onto the shape.\n *\n * @param args - Resolved arguments (shape, boss options).\n * @returns The shape with the boss fused as a `BrepHandle`.\n */\nexport function bossBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, BOSS_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { profile, height } = options as { profile: unknown; height: number; face?: unknown }\n\n if (height <= 0) return err(validationError('BOSS_INVALID_HEIGHT', 'Boss height must be positive'))\n\n const faceRes = resolveTargetFace(kernel, s, (options as { face?: unknown }).face)\n if (isErr(faceRes)) return faceRes\n const face = faceRes.value\n const normal = faceNormalAt(kernel, face)\n const center = faceCenterAt(kernel, face)\n\n const profRes = profileToFace(kernel, profile)\n if (isErr(profRes)) return profRes\n const profFace = profRes.value\n\n let positioned: BrepHandle | undefined\n let tool: BrepHandle | undefined\n try {\n positioned = kernel.translate(profFace, center[0], center[1], center[2])\n kernel.release(profFace)\n const nn = vecNormalize([normal[0], normal[1], normal[2]])\n const extDir = vecScale(nn, height)\n tool = kernel.extrude(positioned, extDir[0], extDir[1], extDir[2])\n kernel.release(positioned)\n return ok(kernel.fuse(s, tool))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('BOSS_FAILED', `boss failed: ${raw}`, e))\n } finally {\n if (tool !== undefined) kernel.release(tool)\n if (positioned !== undefined) kernel.release(positioned)\n }\n}\n\n// ---------------------------------------------------------------------------\n// mirrorJoin — mirror and fuse in one step\n// ---------------------------------------------------------------------------\n\n/**\n * Mirror the shape across a plane and fuse the mirrored copy to the original.\n *\n * @param args - Resolved arguments (shape, mirror options).\n * @returns The shape joined with its mirror as a `BrepHandle`.\n */\nexport function mirrorJoinBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, MIRROR_JOIN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { normal, at } = (options ?? {}) as { normal?: Vec3; at?: Vec3 }\n const n = (normal ?? [1, 0, 0]) as Vec3\n\n if (vecIsZero(n)) return err(validationError('MIRROR_ZERO_NORMAL', 'Mirror plane normal cannot be zero'))\n\n const origin = (at ?? [0, 0, 0]) as Vec3\n let mirrored: BrepHandle | undefined\n try {\n mirrored = kernel.mirror(\n s,\n { x: origin[0], y: origin[1], z: origin[2] },\n { x: n[0], y: n[1], z: n[2] },\n )\n return ok(kernel.fuse(s, mirrored))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('MIRROR_JOIN_FAILED', `mirrorJoin failed: ${raw}`, e))\n } finally {\n if (mirrored !== undefined) kernel.release(mirrored)\n }\n}\n"]}
@@ -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,UAAU,CAAC,CAQ/D;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAQnE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAW9E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAOnE;AAMD,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAUD,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5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