@faicad/faijs 0.29.3 → 0.30.9

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 (614) hide show
  1. package/NOTICE +6 -5
  2. package/dist/api/api-namespace.d.ts +1 -1
  3. package/dist/api/api-namespace.d.ts.map +1 -1
  4. package/dist/api/api-namespace.js +53 -1
  5. package/dist/api/api-namespace.js.map +1 -1
  6. package/dist/api/appearance.d.ts +136 -0
  7. package/dist/api/appearance.d.ts.map +1 -0
  8. package/dist/api/appearance.js +228 -0
  9. package/dist/api/appearance.js.map +1 -0
  10. package/dist/api/assembly/entities.d.ts +1 -1
  11. package/dist/api/assembly/entities.js +1 -1
  12. package/dist/api/assembly/entities.js.map +1 -1
  13. package/dist/api/assembly/index.d.ts +1 -1
  14. package/dist/api/assembly/index.js +1 -1
  15. package/dist/api/assembly/index.js.map +1 -1
  16. package/dist/api/assembly/joints.d.ts +33 -15
  17. package/dist/api/assembly/joints.d.ts.map +1 -1
  18. package/dist/api/assembly/joints.js +31 -13
  19. package/dist/api/assembly/joints.js.map +1 -1
  20. package/dist/api/assembly/preview.d.ts +1 -1
  21. package/dist/api/assembly/preview.js +1 -1
  22. package/dist/api/assembly/preview.js.map +1 -1
  23. package/dist/api/assembly/solve.d.ts +1 -1
  24. package/dist/api/assembly/solve.js +1 -1
  25. package/dist/api/assembly/solve.js.map +1 -1
  26. package/dist/api/assembly/solvers/assembly-tree.d.ts +1 -1
  27. package/dist/api/assembly/solvers/assembly-tree.js +1 -1
  28. package/dist/api/assembly/solvers/assembly-tree.js.map +1 -1
  29. package/dist/api/assembly/solvers/chain-solver.d.ts +2 -2
  30. package/dist/api/assembly/solvers/chain-solver.js.map +1 -1
  31. package/dist/api/assembly/solvers/global-solver.d.ts +1 -2
  32. package/dist/api/assembly/solvers/global-solver.d.ts.map +1 -1
  33. package/dist/api/assembly/solvers/global-solver.js +3 -4
  34. package/dist/api/assembly/solvers/global-solver.js.map +1 -1
  35. package/dist/api/assembly/solvers/joints-kinematics.js +1 -1
  36. package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -1
  37. package/dist/api/assembly/solvers/linalg.d.ts +2 -2
  38. package/dist/api/assembly/solvers/linalg.js +2 -2
  39. package/dist/api/assembly/solvers/linalg.js.map +1 -1
  40. package/dist/api/assembly/solvers/types.d.ts +2 -5
  41. package/dist/api/assembly/solvers/types.d.ts.map +1 -1
  42. package/dist/api/assembly/solvers/types.js +1 -4
  43. package/dist/api/assembly/solvers/types.js.map +1 -1
  44. package/dist/api/boolean.d.ts.map +1 -1
  45. package/dist/api/boolean.js +7 -6
  46. package/dist/api/boolean.js.map +1 -1
  47. package/dist/api/brep-mirror/booleanFns.d.ts +3 -3
  48. package/dist/api/brep-mirror/booleanFns.js +5 -5
  49. package/dist/api/brep-mirror/booleanFns.js.map +1 -1
  50. package/dist/api/brep-mirror/compoundFns.d.ts +1 -1
  51. package/dist/api/brep-mirror/compoundFns.js +4 -4
  52. package/dist/api/brep-mirror/compoundFns.js.map +1 -1
  53. package/dist/api/brep-mirror/healingFns.d.ts +4 -4
  54. package/dist/api/brep-mirror/healingFns.js +4 -4
  55. package/dist/api/brep-mirror/healingFns.js.map +1 -1
  56. package/dist/api/brep-mirror/hullFns.d.ts +2 -2
  57. package/dist/api/brep-mirror/hullFns.js +2 -2
  58. package/dist/api/brep-mirror/hullFns.js.map +1 -1
  59. package/dist/api/brep-mirror/patternFns.d.ts +5 -5
  60. package/dist/api/brep-mirror/patternFns.js +10 -10
  61. package/dist/api/brep-mirror/patternFns.js.map +1 -1
  62. package/dist/api/brep-mirror/primitiveFns.d.ts +4 -4
  63. package/dist/api/brep-mirror/primitiveFns.js +4 -4
  64. package/dist/api/brep-mirror/primitiveFns.js.map +1 -1
  65. package/dist/api/brep-mirror/roofFns.d.ts +3 -3
  66. package/dist/api/brep-mirror/roofFns.js +7 -7
  67. package/dist/api/brep-mirror/roofFns.js.map +1 -1
  68. package/dist/api/brep-mirror/sweepFns.d.ts +7 -7
  69. package/dist/api/brep-mirror/sweepFns.js +14 -14
  70. package/dist/api/brep-mirror/sweepFns.js.map +1 -1
  71. package/dist/api/brep-mirror/threadFns.d.ts +1 -1
  72. package/dist/api/brep-mirror/threadFns.js +1 -1
  73. package/dist/api/brep-mirror/threadFns.js.map +1 -1
  74. package/dist/api/brep-mirror/topologyFns.d.ts +5 -5
  75. package/dist/api/brep-mirror/topologyFns.js +8 -8
  76. package/dist/api/brep-mirror/topologyFns.js.map +1 -1
  77. package/dist/api/brep-operations/booleanFns.d.ts +40 -0
  78. package/dist/api/brep-operations/booleanFns.d.ts.map +1 -0
  79. package/dist/api/brep-operations/booleanFns.js +104 -0
  80. package/dist/api/brep-operations/booleanFns.js.map +1 -0
  81. package/dist/api/brep-operations/brepHelpers.d.ts +55 -0
  82. package/dist/api/brep-operations/brepHelpers.d.ts.map +1 -0
  83. package/dist/api/brep-operations/brepHelpers.js +131 -0
  84. package/dist/api/brep-operations/brepHelpers.js.map +1 -0
  85. package/dist/api/brep-operations/compoundFns.d.ts +46 -0
  86. package/dist/api/brep-operations/compoundFns.d.ts.map +1 -0
  87. package/dist/api/brep-operations/compoundFns.js +299 -0
  88. package/dist/api/brep-operations/compoundFns.js.map +1 -0
  89. package/dist/api/brep-operations/healingFns.d.ts +78 -0
  90. package/dist/api/brep-operations/healingFns.d.ts.map +1 -0
  91. package/dist/api/brep-operations/healingFns.js +294 -0
  92. package/dist/api/brep-operations/healingFns.js.map +1 -0
  93. package/dist/api/brep-operations/hullFns.d.ts +20 -0
  94. package/dist/api/brep-operations/hullFns.d.ts.map +1 -0
  95. package/dist/api/brep-operations/hullFns.js +46 -0
  96. package/dist/api/brep-operations/hullFns.js.map +1 -0
  97. package/dist/api/brep-operations/joinery-brep.d.ts +172 -0
  98. package/dist/api/brep-operations/joinery-brep.d.ts.map +1 -0
  99. package/dist/api/brep-operations/joinery-brep.js +463 -0
  100. package/dist/api/brep-operations/joinery-brep.js.map +1 -0
  101. package/dist/api/brep-operations/patternFns.d.ts +43 -0
  102. package/dist/api/brep-operations/patternFns.d.ts.map +1 -0
  103. package/dist/api/brep-operations/patternFns.js +178 -0
  104. package/dist/api/brep-operations/patternFns.js.map +1 -0
  105. package/dist/api/brep-operations/primitiveFns.d.ts +42 -0
  106. package/dist/api/brep-operations/primitiveFns.d.ts.map +1 -0
  107. package/dist/api/brep-operations/primitiveFns.js +104 -0
  108. package/dist/api/brep-operations/primitiveFns.js.map +1 -0
  109. package/dist/api/brep-operations/roofFns.d.ts +24 -0
  110. package/dist/api/brep-operations/roofFns.d.ts.map +1 -0
  111. package/dist/api/brep-operations/roofFns.js +229 -0
  112. package/dist/api/brep-operations/roofFns.js.map +1 -0
  113. package/dist/api/brep-operations/straightSkeleton.d.ts +36 -0
  114. package/dist/api/brep-operations/straightSkeleton.d.ts.map +1 -0
  115. package/dist/api/brep-operations/straightSkeleton.js +431 -0
  116. package/dist/api/brep-operations/straightSkeleton.js.map +1 -0
  117. package/dist/api/brep-operations/sweepFns.d.ts +60 -0
  118. package/dist/api/brep-operations/sweepFns.d.ts.map +1 -0
  119. package/dist/api/brep-operations/sweepFns.js +323 -0
  120. package/dist/api/brep-operations/sweepFns.js.map +1 -0
  121. package/dist/api/brep-operations/threadFns.d.ts +83 -0
  122. package/dist/api/brep-operations/threadFns.d.ts.map +1 -0
  123. package/dist/api/brep-operations/threadFns.js +138 -0
  124. package/dist/api/brep-operations/threadFns.js.map +1 -0
  125. package/dist/api/brep-operations/topologyFns.d.ts +90 -0
  126. package/dist/api/brep-operations/topologyFns.d.ts.map +1 -0
  127. package/dist/api/brep-operations/topologyFns.js +276 -0
  128. package/dist/api/brep-operations/topologyFns.js.map +1 -0
  129. package/dist/api/brep-topology.d.ts +1 -1
  130. package/dist/api/brep-topology.d.ts.map +1 -1
  131. package/dist/api/brep-topology.js +1 -1
  132. package/dist/api/brep-topology.js.map +1 -1
  133. package/dist/api/brepjs-compat/index.d.ts +1 -1
  134. package/dist/api/brepjs-compat/index.js +3 -3
  135. package/dist/api/brepjs-compat/index.js.map +1 -1
  136. package/dist/api/cadquery-selectors/borrow-bridge.d.ts.map +1 -1
  137. package/dist/api/cadquery-selectors/borrow-bridge.js +3 -4
  138. package/dist/api/cadquery-selectors/borrow-bridge.js.map +1 -1
  139. package/dist/api/curve-sketch/index.d.ts +235 -0
  140. package/dist/api/curve-sketch/index.d.ts.map +1 -0
  141. package/dist/api/curve-sketch/index.js +487 -0
  142. package/dist/api/curve-sketch/index.js.map +1 -0
  143. package/dist/api/engrave.d.ts.map +1 -1
  144. package/dist/api/engrave.js +3 -2
  145. package/dist/api/engrave.js.map +1 -1
  146. package/dist/api/export-brep.d.ts +41 -0
  147. package/dist/api/export-brep.d.ts.map +1 -0
  148. package/dist/api/export-brep.js +58 -0
  149. package/dist/api/export-brep.js.map +1 -0
  150. package/dist/api/export-stl.d.ts +50 -0
  151. package/dist/api/export-stl.d.ts.map +1 -0
  152. package/dist/api/export-stl.js +99 -0
  153. package/dist/api/export-stl.js.map +1 -0
  154. package/dist/api/extrude.d.ts +8 -11
  155. package/dist/api/extrude.d.ts.map +1 -1
  156. package/dist/api/extrude.js +11 -14
  157. package/dist/api/extrude.js.map +1 -1
  158. package/dist/api/fillet-variable.d.ts +2 -2
  159. package/dist/api/fillet-variable.js +2 -2
  160. package/dist/api/fillet-variable.js.map +1 -1
  161. package/dist/api/fillet.d.ts +2 -4
  162. package/dist/api/fillet.d.ts.map +1 -1
  163. package/dist/api/fillet.js +2 -4
  164. package/dist/api/fillet.js.map +1 -1
  165. package/dist/api/generated/2d.d.ts +4 -0
  166. package/dist/api/generated/2d.d.ts.map +1 -1
  167. package/dist/api/generated/2d.js +4 -0
  168. package/dist/api/generated/2d.js.map +1 -1
  169. package/dist/api/generated/core.d.ts +4 -0
  170. package/dist/api/generated/core.d.ts.map +1 -1
  171. package/dist/api/generated/core.js +4 -0
  172. package/dist/api/generated/core.js.map +1 -1
  173. package/dist/api/generated/gear.d.ts +4 -0
  174. package/dist/api/generated/gear.d.ts.map +1 -1
  175. package/dist/api/generated/gear.js +4 -0
  176. package/dist/api/generated/gear.js.map +1 -1
  177. package/dist/api/generated/io.d.ts +4 -0
  178. package/dist/api/generated/io.d.ts.map +1 -1
  179. package/dist/api/generated/io.js +4 -0
  180. package/dist/api/generated/io.js.map +1 -1
  181. package/dist/api/generated/kernel.d.ts +4 -0
  182. package/dist/api/generated/kernel.d.ts.map +1 -1
  183. package/dist/api/generated/kernel.js +4 -0
  184. package/dist/api/generated/kernel.js.map +1 -1
  185. package/dist/api/generated/measurement.d.ts +21 -21
  186. package/dist/api/generated/measurement.d.ts.map +1 -1
  187. package/dist/api/generated/measurement.js +25 -21
  188. package/dist/api/generated/measurement.js.map +1 -1
  189. package/dist/api/generated/ns.d.ts +4 -0
  190. package/dist/api/generated/ns.d.ts.map +1 -1
  191. package/dist/api/generated/ns.js +4 -0
  192. package/dist/api/generated/ns.js.map +1 -1
  193. package/dist/api/generated/operations.d.ts +32 -32
  194. package/dist/api/generated/operations.d.ts.map +1 -1
  195. package/dist/api/generated/operations.js +52 -48
  196. package/dist/api/generated/operations.js.map +1 -1
  197. package/dist/api/generated/projection.d.ts +4 -0
  198. package/dist/api/generated/projection.d.ts.map +1 -1
  199. package/dist/api/generated/projection.js +4 -0
  200. package/dist/api/generated/projection.js.map +1 -1
  201. package/dist/api/generated/query.d.ts +4 -0
  202. package/dist/api/generated/query.d.ts.map +1 -1
  203. package/dist/api/generated/query.js +4 -0
  204. package/dist/api/generated/query.js.map +1 -1
  205. package/dist/api/generated/sketching.d.ts +2 -2
  206. package/dist/api/generated/sketching.d.ts.map +1 -1
  207. package/dist/api/generated/sketching.js +7 -3
  208. package/dist/api/generated/sketching.js.map +1 -1
  209. package/dist/api/generated/text.d.ts +4 -0
  210. package/dist/api/generated/text.d.ts.map +1 -1
  211. package/dist/api/generated/text.js +4 -0
  212. package/dist/api/generated/text.js.map +1 -1
  213. package/dist/api/generated/topology.d.ts +45 -45
  214. package/dist/api/generated/topology.d.ts.map +1 -1
  215. package/dist/api/generated/topology.js +67 -63
  216. package/dist/api/generated/topology.js.map +1 -1
  217. package/dist/api/generated/view.d.ts +4 -0
  218. package/dist/api/generated/view.d.ts.map +1 -1
  219. package/dist/api/generated/view.js +4 -0
  220. package/dist/api/generated/view.js.map +1 -1
  221. package/dist/api/geom-types/constants.d.ts +11 -0
  222. package/dist/api/geom-types/constants.d.ts.map +1 -0
  223. package/dist/api/geom-types/constants.js +11 -0
  224. package/dist/api/geom-types/constants.js.map +1 -0
  225. package/dist/api/geom-types/index.d.ts +21 -0
  226. package/dist/api/geom-types/index.d.ts.map +1 -0
  227. package/dist/api/geom-types/index.js +22 -0
  228. package/dist/api/geom-types/index.js.map +1 -0
  229. package/dist/api/geom-types/planeOps.d.ts +98 -0
  230. package/dist/api/geom-types/planeOps.d.ts.map +1 -0
  231. package/dist/api/geom-types/planeOps.js +170 -0
  232. package/dist/api/geom-types/planeOps.js.map +1 -0
  233. package/dist/api/geom-types/planeTypes.d.ts +24 -0
  234. package/dist/api/geom-types/planeTypes.d.ts.map +1 -0
  235. package/dist/api/geom-types/planeTypes.js +8 -0
  236. package/dist/api/geom-types/planeTypes.js.map +1 -0
  237. package/dist/api/geom-types/types.d.ts +64 -0
  238. package/dist/api/geom-types/types.d.ts.map +1 -0
  239. package/dist/api/geom-types/types.js +48 -0
  240. package/dist/api/geom-types/types.js.map +1 -0
  241. package/dist/api/geom-types/vecOps.d.ts +124 -0
  242. package/dist/api/geom-types/vecOps.d.ts.map +1 -0
  243. package/dist/api/geom-types/vecOps.js +202 -0
  244. package/dist/api/geom-types/vecOps.js.map +1 -0
  245. package/dist/api/geom.d.ts.map +1 -1
  246. package/dist/api/geom.js +6 -5
  247. package/dist/api/geom.js.map +1 -1
  248. package/dist/api/half-space.d.ts +56 -0
  249. package/dist/api/half-space.d.ts.map +1 -0
  250. package/dist/api/half-space.js +82 -0
  251. package/dist/api/half-space.js.map +1 -0
  252. package/dist/api/helix.d.ts +10 -1
  253. package/dist/api/helix.d.ts.map +1 -1
  254. package/dist/api/helix.js +19 -3
  255. package/dist/api/helix.js.map +1 -1
  256. package/dist/api/import-step.d.ts.map +1 -1
  257. package/dist/api/import-step.js +28 -0
  258. package/dist/api/import-step.js.map +1 -1
  259. package/dist/api/index.d.ts +19 -6
  260. package/dist/api/index.d.ts.map +1 -1
  261. package/dist/api/index.js +31 -8
  262. package/dist/api/index.js.map +1 -1
  263. package/dist/api/internal/compat-op.d.ts +4 -30
  264. package/dist/api/internal/compat-op.d.ts.map +1 -1
  265. package/dist/api/internal/compat-op.js +10 -42
  266. package/dist/api/internal/compat-op.js.map +1 -1
  267. package/dist/api/internal/compat-projection.d.ts +5 -5
  268. package/dist/api/internal/compat-projection.js +5 -5
  269. package/dist/api/internal/compat-projection.js.map +1 -1
  270. package/dist/api/internal/dual-form-args.d.ts +0 -2
  271. package/dist/api/internal/dual-form-args.d.ts.map +1 -1
  272. package/dist/api/internal/dual-form-args.js +1 -3
  273. package/dist/api/internal/dual-form-args.js.map +1 -1
  274. package/dist/api/internal/l3-bridge.d.ts +5 -37
  275. package/dist/api/internal/l3-bridge.d.ts.map +1 -1
  276. package/dist/api/internal/l3-bridge.js +7 -76
  277. package/dist/api/internal/l3-bridge.js.map +1 -1
  278. package/dist/api/internal/profile-wire.d.ts +1 -1
  279. package/dist/api/internal/profile-wire.js +1 -1
  280. package/dist/api/internal/profile-wire.js.map +1 -1
  281. package/dist/api/internal/result-unwrap.d.ts +4 -6
  282. package/dist/api/internal/result-unwrap.d.ts.map +1 -1
  283. package/dist/api/internal/result-unwrap.js +4 -6
  284. package/dist/api/internal/result-unwrap.js.map +1 -1
  285. package/dist/api/knurl.d.ts.map +1 -1
  286. package/dist/api/knurl.js +5 -3
  287. package/dist/api/knurl.js.map +1 -1
  288. package/dist/api/loft.d.ts +2 -2
  289. package/dist/api/loft.d.ts.map +1 -1
  290. package/dist/api/loft.js +2 -2
  291. package/dist/api/loft.js.map +1 -1
  292. package/dist/api/measurement/index.d.ts +3 -3
  293. package/dist/api/measurement/index.js +3 -3
  294. package/dist/api/measurement/index.js.map +1 -1
  295. package/dist/api/meta.d.ts +91 -0
  296. package/dist/api/meta.d.ts.map +1 -0
  297. package/dist/api/meta.js +97 -0
  298. package/dist/api/meta.js.map +1 -0
  299. package/dist/api/offset2d.d.ts +49 -0
  300. package/dist/api/offset2d.d.ts.map +1 -0
  301. package/dist/api/offset2d.js +86 -0
  302. package/dist/api/offset2d.js.map +1 -0
  303. package/dist/api/pattern.js +3 -3
  304. package/dist/api/pattern.js.map +1 -1
  305. package/dist/api/primitives.d.ts.map +1 -1
  306. package/dist/api/primitives.js +124 -8
  307. package/dist/api/primitives.js.map +1 -1
  308. package/dist/api/replicate.d.ts +2 -2
  309. package/dist/api/replicate.d.ts.map +1 -1
  310. package/dist/api/replicate.js +12 -12
  311. package/dist/api/replicate.js.map +1 -1
  312. package/dist/api/result.d.ts +1 -1
  313. package/dist/api/result.js +1 -1
  314. package/dist/api/result.js.map +1 -1
  315. package/dist/api/revolve.d.ts +2 -2
  316. package/dist/api/revolve.js +3 -3
  317. package/dist/api/revolve.js.map +1 -1
  318. package/dist/api/screw.d.ts +1 -1
  319. package/dist/api/screw.d.ts.map +1 -1
  320. package/dist/api/screw.js +5 -4
  321. package/dist/api/screw.js.map +1 -1
  322. package/dist/api/sdf.d.ts.map +1 -1
  323. package/dist/api/sdf.js +3 -2
  324. package/dist/api/sdf.js.map +1 -1
  325. package/dist/api/shape-type/index.d.ts +141 -0
  326. package/dist/api/shape-type/index.d.ts.map +1 -0
  327. package/dist/api/shape-type/index.js +182 -0
  328. package/dist/api/shape-type/index.js.map +1 -0
  329. package/dist/api/shell.d.ts +2 -2
  330. package/dist/api/shell.js +2 -2
  331. package/dist/api/shell.js.map +1 -1
  332. package/dist/api/solid-from-faces.d.ts +45 -0
  333. package/dist/api/solid-from-faces.d.ts.map +1 -0
  334. package/dist/api/solid-from-faces.js +72 -0
  335. package/dist/api/solid-from-faces.js.map +1 -0
  336. package/dist/api/solid-offset/index.d.ts +67 -0
  337. package/dist/api/solid-offset/index.d.ts.map +1 -0
  338. package/dist/api/solid-offset/index.js +132 -0
  339. package/dist/api/solid-offset/index.js.map +1 -0
  340. package/dist/api/surface/arg-spec.d.ts +35 -33
  341. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  342. package/dist/api/surface/arg-spec.js +222 -224
  343. package/dist/api/surface/arg-spec.js.map +1 -1
  344. package/dist/api/surface-face/index.d.ts +104 -0
  345. package/dist/api/surface-face/index.d.ts.map +1 -0
  346. package/dist/api/surface-face/index.js +217 -0
  347. package/dist/api/surface-face/index.js.map +1 -0
  348. package/dist/api/surface.d.ts +44 -0
  349. package/dist/api/surface.d.ts.map +1 -0
  350. package/dist/api/surface.js +66 -0
  351. package/dist/api/surface.js.map +1 -0
  352. package/dist/api/sweep.d.ts +59 -9
  353. package/dist/api/sweep.d.ts.map +1 -1
  354. package/dist/api/sweep.js +11 -6
  355. package/dist/api/sweep.js.map +1 -1
  356. package/dist/api/thicken.d.ts +1 -1
  357. package/dist/api/thicken.js +1 -1
  358. package/dist/api/thicken.js.map +1 -1
  359. package/dist/api/transform.d.ts +5 -5
  360. package/dist/api/transform.d.ts.map +1 -1
  361. package/dist/api/transform.js +11 -10
  362. package/dist/api/transform.js.map +1 -1
  363. package/dist/api/view/cameraFns.d.ts +1 -1
  364. package/dist/api/view/cameraFns.d.ts.map +1 -1
  365. package/dist/api/view/cameraFns.js +1 -1
  366. package/dist/api/view/cameraFns.js.map +1 -1
  367. package/dist/api/view/index.d.ts +0 -2
  368. package/dist/api/view/index.d.ts.map +1 -1
  369. package/dist/api/view/index.js +0 -2
  370. package/dist/api/view/index.js.map +1 -1
  371. package/dist/api/view/projectionPlanes.d.ts +1 -1
  372. package/dist/api/view/projectionPlanes.d.ts.map +1 -1
  373. package/dist/api/view/projectionPlanes.js.map +1 -1
  374. package/dist/api/view/view-camera.d.ts +7 -9
  375. package/dist/api/view/view-camera.d.ts.map +1 -1
  376. package/dist/api/view/view-camera.js +4 -6
  377. package/dist/api/view/view-camera.js.map +1 -1
  378. package/dist/api/view/view-projection.d.ts +0 -2
  379. package/dist/api/view/view-projection.d.ts.map +1 -1
  380. package/dist/api/view/view-projection.js +0 -2
  381. package/dist/api/view/view-projection.js.map +1 -1
  382. package/dist/api/view/view-sheet.d.ts +0 -2
  383. package/dist/api/view/view-sheet.d.ts.map +1 -1
  384. package/dist/api/view/view-sheet.js +0 -2
  385. package/dist/api/view/view-sheet.js.map +1 -1
  386. package/dist/api/view-export/index.d.ts +97 -0
  387. package/dist/api/view-export/index.d.ts.map +1 -0
  388. package/dist/api/view-export/index.js +118 -0
  389. package/dist/api/view-export/index.js.map +1 -0
  390. package/dist/brep/brep-ops.d.ts +89 -1
  391. package/dist/brep/brep-ops.d.ts.map +1 -1
  392. package/dist/brep/brep-ops.js +204 -13
  393. package/dist/brep/brep-ops.js.map +1 -1
  394. package/dist/brep/brep-topology.d.ts +20 -0
  395. package/dist/brep/brep-topology.d.ts.map +1 -1
  396. package/dist/brep/brep-topology.js +46 -0
  397. package/dist/brep/brep-topology.js.map +1 -1
  398. package/dist/brep/engine/adapters/occt.d.ts +1 -1
  399. package/dist/brep/engine/adapters/occt.js +8 -8
  400. package/dist/brep/engine/adapters/occt.js.map +1 -1
  401. package/dist/brep/engine/primitives.d.ts +2 -3
  402. package/dist/brep/engine/primitives.d.ts.map +1 -1
  403. package/dist/brep/engine/primitives.js +1 -2
  404. package/dist/brep/engine/primitives.js.map +1 -1
  405. package/dist/brep/engine/registry.d.ts +1 -1
  406. package/dist/brep/engine/registry.js +1 -1
  407. package/dist/brep/engine/registry.js.map +1 -1
  408. package/dist/brep/engine/types.d.ts +2 -2
  409. package/dist/brep/engine/types.js.map +1 -1
  410. package/dist/brep/export/export-model.d.ts +40 -0
  411. package/dist/brep/export/export-model.d.ts.map +1 -1
  412. package/dist/brep/export/export-model.js +268 -25
  413. package/dist/brep/export/export-model.js.map +1 -1
  414. package/dist/brep/export/step-meta-header.d.ts +102 -0
  415. package/dist/brep/export/step-meta-header.d.ts.map +1 -0
  416. package/dist/brep/export/step-meta-header.js +225 -0
  417. package/dist/brep/export/step-meta-header.js.map +1 -0
  418. package/dist/brep/export/step.d.ts +5 -1
  419. package/dist/brep/export/step.d.ts.map +1 -1
  420. package/dist/brep/export/step.js +11 -2
  421. package/dist/brep/export/step.js.map +1 -1
  422. package/dist/brep/handle-bridge.d.ts +2 -2
  423. package/dist/brep/handle-bridge.js +2 -2
  424. package/dist/brep/handle-bridge.js.map +1 -1
  425. package/dist/brep/index.d.ts +6 -3
  426. package/dist/brep/index.d.ts.map +1 -1
  427. package/dist/brep/index.js +6 -3
  428. package/dist/brep/index.js.map +1 -1
  429. package/dist/brepkit-kernel/brepkitKernel.d.ts +1 -1
  430. package/dist/brepkit-kernel/brepkitKernel.js +2 -2
  431. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  432. package/dist/browser.d.ts +2 -2
  433. package/dist/browser.d.ts.map +1 -1
  434. package/dist/browser.js +5 -4
  435. package/dist/browser.js.map +1 -1
  436. package/dist/cad-runtime/admit-compat-lib.d.ts +3 -10
  437. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  438. package/dist/cad-runtime/admit-compat-lib.js +3 -9
  439. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  440. package/dist/cad-runtime/backend-dispatch.js +12 -3
  441. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  442. package/dist/cad-runtime/direct-executor.d.ts +6 -3
  443. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  444. package/dist/cad-runtime/direct-executor.js +31 -9
  445. package/dist/cad-runtime/direct-executor.js.map +1 -1
  446. package/dist/cad-runtime/interp/env.d.ts +1 -1
  447. package/dist/cad-runtime/interp/env.js.map +1 -1
  448. package/dist/cad-runtime/lib-id.d.ts +0 -2
  449. package/dist/cad-runtime/lib-id.d.ts.map +1 -1
  450. package/dist/cad-runtime/lib-id.js +0 -2
  451. package/dist/cad-runtime/lib-id.js.map +1 -1
  452. package/dist/cad-runtime/live-shapes.d.ts +3 -5
  453. package/dist/cad-runtime/live-shapes.d.ts.map +1 -1
  454. package/dist/cad-runtime/live-shapes.js +8 -10
  455. package/dist/cad-runtime/live-shapes.js.map +1 -1
  456. package/dist/cad-runtime/ports.d.ts +3 -3
  457. package/dist/cad-runtime/ports.js.map +1 -1
  458. package/dist/cad-runtime/runtime.d.ts +21 -7
  459. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  460. package/dist/cad-runtime/runtime.js +45 -6
  461. package/dist/cad-runtime/runtime.js.map +1 -1
  462. package/dist/define-op.d.ts +4 -3
  463. package/dist/define-op.d.ts.map +1 -1
  464. package/dist/define-op.js +65 -3
  465. package/dist/define-op.js.map +1 -1
  466. package/dist/geometry2d/bridge/plane.d.ts +1 -1
  467. package/dist/geometry2d/bridge/plane.js +1 -1
  468. package/dist/geometry2d/bridge/plane.js.map +1 -1
  469. package/dist/geometry2d/curve2d.d.ts +1 -1
  470. package/dist/geometry2d/curve2d.js +1 -1
  471. package/dist/geometry2d/curve2d.js.map +1 -1
  472. package/dist/index.d.ts +1 -1
  473. package/dist/index.d.ts.map +1 -1
  474. package/dist/index.js +10 -4
  475. package/dist/index.js.map +1 -1
  476. package/dist/io/fai-zip/container-read.d.ts +16 -0
  477. package/dist/io/fai-zip/container-read.d.ts.map +1 -1
  478. package/dist/io/fai-zip/container-read.js +22 -0
  479. package/dist/io/fai-zip/container-read.js.map +1 -1
  480. package/dist/io/fai-zip/index.d.ts +1 -1
  481. package/dist/io/fai-zip/index.d.ts.map +1 -1
  482. package/dist/io/fai-zip/index.js +1 -1
  483. package/dist/io/fai-zip/index.js.map +1 -1
  484. package/dist/lang/code-to-args.d.ts.map +1 -1
  485. package/dist/lang/code-to-args.js +10 -1
  486. package/dist/lang/code-to-args.js.map +1 -1
  487. package/dist/lang/determinism-scanner.d.ts.map +1 -1
  488. package/dist/lang/determinism-scanner.js +22 -9
  489. package/dist/lang/determinism-scanner.js.map +1 -1
  490. package/dist/lang/metadata-extractor.d.ts +27 -6
  491. package/dist/lang/metadata-extractor.d.ts.map +1 -1
  492. package/dist/lang/metadata-extractor.js +90 -29
  493. package/dist/lang/metadata-extractor.js.map +1 -1
  494. package/dist/lang/parse-error.d.ts +4 -0
  495. package/dist/lang/parse-error.d.ts.map +1 -1
  496. package/dist/lang/parse-error.js.map +1 -1
  497. package/dist/lang/security-scanner.d.ts +27 -2
  498. package/dist/lang/security-scanner.d.ts.map +1 -1
  499. package/dist/lang/security-scanner.js +29 -2
  500. package/dist/lang/security-scanner.js.map +1 -1
  501. package/dist/lang/source-edit.d.ts +2 -2
  502. package/dist/lang/source-edit.js.map +1 -1
  503. package/dist/lang/symbol-table.generated.d.ts +36 -0
  504. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  505. package/dist/lang/symbol-table.generated.js +36 -0
  506. package/dist/lang/symbol-table.generated.js.map +1 -1
  507. package/dist/lang/types.d.ts +5 -6
  508. package/dist/lang/types.d.ts.map +1 -1
  509. package/dist/lang/types.js.map +1 -1
  510. package/dist/mesh/import-model.d.ts +94 -0
  511. package/dist/mesh/import-model.d.ts.map +1 -0
  512. package/dist/mesh/import-model.js +15 -0
  513. package/dist/mesh/import-model.js.map +1 -0
  514. package/dist/mesh/index.d.ts +19 -58
  515. package/dist/mesh/index.d.ts.map +1 -1
  516. package/dist/mesh/index.js +19 -70
  517. package/dist/mesh/index.js.map +1 -1
  518. package/dist/mesh/io.d.ts +39 -16
  519. package/dist/mesh/io.d.ts.map +1 -1
  520. package/dist/mesh/io.js +151 -22
  521. package/dist/mesh/io.js.map +1 -1
  522. package/dist/mesh/primitives.d.ts.map +1 -1
  523. package/dist/mesh/primitives.js +42 -7
  524. package/dist/mesh/primitives.js.map +1 -1
  525. package/dist/mesh/threemf-bambu.d.ts +12 -1
  526. package/dist/mesh/threemf-bambu.d.ts.map +1 -1
  527. package/dist/mesh/threemf-bambu.js +68 -16
  528. package/dist/mesh/threemf-bambu.js.map +1 -1
  529. package/dist/mesh/threemf-loader.d.ts +37 -1
  530. package/dist/mesh/threemf-loader.d.ts.map +1 -1
  531. package/dist/mesh/threemf-loader.js +205 -14
  532. package/dist/mesh/threemf-loader.js.map +1 -1
  533. package/dist/mesh/transform.d.ts +1 -1
  534. package/dist/mesh/transform.js +1 -1
  535. package/dist/mesh/transform.js.map +1 -1
  536. package/dist/mesh/types.d.ts +43 -5
  537. package/dist/mesh/types.d.ts.map +1 -1
  538. package/dist/mesh/types.js.map +1 -1
  539. package/dist/node-host/cli.d.ts +49 -1
  540. package/dist/node-host/cli.d.ts.map +1 -1
  541. package/dist/node-host/cli.js +125 -19
  542. package/dist/node-host/cli.js.map +1 -1
  543. package/dist/node-host/execute-script.d.ts +55 -0
  544. package/dist/node-host/execute-script.d.ts.map +1 -0
  545. package/dist/node-host/execute-script.js +46 -0
  546. package/dist/node-host/execute-script.js.map +1 -0
  547. package/dist/node.d.ts +2 -0
  548. package/dist/node.d.ts.map +1 -1
  549. package/dist/node.js +3 -0
  550. package/dist/node.js.map +1 -1
  551. package/dist/occt-kernel/generated/occtPlatform.generated.d.ts +260 -0
  552. package/dist/occt-kernel/generated/occtPlatform.generated.d.ts.map +1 -0
  553. package/dist/occt-kernel/generated/occtPlatform.generated.js +875 -0
  554. package/dist/occt-kernel/generated/occtPlatform.generated.js.map +1 -0
  555. package/dist/occt-kernel/highLevelApi.d.ts +4 -1
  556. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  557. package/dist/occt-kernel/highLevelApi.js +4 -2
  558. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  559. package/dist/occt-kernel/hullGeometry.d.ts +2 -2
  560. package/dist/occt-kernel/hullGeometry.js +2 -3
  561. package/dist/occt-kernel/hullGeometry.js.map +1 -1
  562. package/dist/occt-kernel/hullOps.d.ts +3 -3
  563. package/dist/occt-kernel/hullOps.js +4 -4
  564. package/dist/occt-kernel/hullOps.js.map +1 -1
  565. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -1
  566. package/dist/occt-kernel/occt-primitives.js +32 -5
  567. package/dist/occt-kernel/occt-primitives.js.map +1 -1
  568. package/dist/occt-kernel/occtKernel.d.ts +1 -1
  569. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  570. package/dist/occt-kernel/occtKernel.js +19 -1
  571. package/dist/occt-kernel/occtKernel.js.map +1 -1
  572. package/dist/occt-kernel/stepMetaParser.d.ts +44 -0
  573. package/dist/occt-kernel/stepMetaParser.d.ts.map +1 -0
  574. package/dist/occt-kernel/stepMetaParser.js +166 -0
  575. package/dist/occt-kernel/stepMetaParser.js.map +1 -0
  576. package/dist/occt-scan/recognize.d.ts +58 -0
  577. package/dist/occt-scan/recognize.d.ts.map +1 -0
  578. package/dist/occt-scan/recognize.js +216 -0
  579. package/dist/occt-scan/recognize.js.map +1 -0
  580. package/dist/primitives/brep-primitives.js +7 -7
  581. package/dist/primitives/brep-primitives.js.map +1 -1
  582. package/dist/result/bug.d.ts +1 -1
  583. package/dist/result/bug.js +1 -1
  584. package/dist/result/bug.js.map +1 -1
  585. package/dist/result/errors.d.ts +2 -2
  586. package/dist/result/errors.d.ts.map +1 -1
  587. package/dist/result/errors.js +1 -1
  588. package/dist/result/errors.js.map +1 -1
  589. package/dist/result/vec3.d.ts +1 -1
  590. package/dist/result/vec3.js +1 -1
  591. package/dist/result/vec3.js.map +1 -1
  592. package/dist/runtime-state.d.ts +16 -0
  593. package/dist/runtime-state.d.ts.map +1 -1
  594. package/dist/runtime-state.js +27 -0
  595. package/dist/runtime-state.js.map +1 -1
  596. package/dist/script-globals.d.ts +24 -0
  597. package/dist/script-globals.d.ts.map +1 -0
  598. package/dist/script-globals.js +24 -0
  599. package/dist/script-globals.js.map +1 -0
  600. package/dist/shape.d.ts +35 -3
  601. package/dist/shape.d.ts.map +1 -1
  602. package/dist/shape.js +44 -2
  603. package/dist/shape.js.map +1 -1
  604. package/dist/step/stepMetaParser.d.ts +55 -0
  605. package/dist/step/stepMetaParser.d.ts.map +1 -0
  606. package/dist/step/stepMetaParser.js +177 -0
  607. package/dist/step/stepMetaParser.js.map +1 -0
  608. package/dist/topology/naming/lineage.d.ts +3 -2
  609. package/dist/topology/naming/lineage.d.ts.map +1 -1
  610. package/dist/topology/naming/lineage.js.map +1 -1
  611. package/dist/weapp.d.ts +1 -1
  612. package/dist/weapp.js +1 -1
  613. package/dist/weapp.js.map +1 -1
  614. package/package.json +9 -11
@@ -1 +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,CAAA;AACpF,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAC/F,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAC7F,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,E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AA;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"]}
1
+ {"version":3,"file":"healingFns.js","sourceRoot":"","sources":["../../../src/api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ACtF,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 brepjs\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 brepjs `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 (brepjs `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 (brepjs `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"]}
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * Semantics mirror vendored `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
7
+ * Semantics mirror brepjs `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
8
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).
9
+ * hull closure, §5.1) with tolerance 0.1 (brepjs default).
10
10
  */
11
11
  import type { BrepHandle } from '../../brep/engine/types.js';
12
12
  import { type Result } from '../../result/result.js';
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * Semantics mirror vendored `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
7
+ * Semantics mirror brepjs `operations/convexHullFns.ts` (HULL_EMPTY_INPUT /
8
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).
9
+ * hull closure, §5.1) with tolerance 0.1 (brepjs default).
10
10
  */
11
11
  import { getBrepApi } from '../../brep/handle-bridge.js';
12
12
  import { ok, err } from '../../result/result.js';
@@ -1 +1 @@
1
- {"version":3,"file":"hullFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/hullFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,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;AAGxD,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAElG;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAG,IAAe;IAC/C,MAAM,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAA;IACzD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,CAAC,SAAS,IAAI,EAAE,CAAW,CAAA;IAE1C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,GAAG,CACR,eAAe,CACb,kBAAkB,EAClB,+CAA+C,MAAM,CAAC,MAAM,EAAE,CAC/D,CACF,CAAA;IACH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACpE,MAAM,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,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"]}
1
+ {"version":3,"file":"hullFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/hullFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EA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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 brepjs `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 (brepjs 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"]}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * Semantics mirror vendored `operations/patternFns.ts` + `compoundOpsFns.ts`
7
+ * Semantics mirror brepjs `operations/patternFns.ts` + `compoundOpsFns.ts`
8
8
  * rectangularPattern, on the L1 pattern primitives (occt-primitives:
9
9
  * native compound split per replica; gridPattern pre-fused compound).
10
10
  * Guards: PATTERN_INVALID_COUNT / PATTERN_ZERO_DIRECTION / PATTERN_ZERO_AXIS.
@@ -12,21 +12,21 @@
12
12
  import type { BrepHandle } from '../../brep/engine/types.js';
13
13
  import { type Result } from '../../result/result.js';
14
14
  /**
15
- * Linear pattern — copy a shape along a direction (vendored patternFns.ts#linearPattern).
15
+ * Linear pattern — copy a shape along a direction (brepjs patternFns.ts#linearPattern).
16
16
  *
17
17
  * @param args - Resolved arguments (shape, direction, count, spacing).
18
18
  * @returns The fused pattern copies as a `BrepHandle`.
19
19
  */
20
20
  export declare function linearPatternBrep(...args: unknown[]): Result<BrepHandle>;
21
21
  /**
22
- * Circular pattern — copy a shape around an axis (vendored patternFns.ts#circularPattern).
22
+ * Circular pattern — copy a shape around an axis (brepjs patternFns.ts#circularPattern).
23
23
  *
24
24
  * @param args - Resolved arguments (shape, axis, count, fullAngle, center).
25
25
  * @returns The fused pattern copies as a `BrepHandle`.
26
26
  */
27
27
  export declare function circularPatternBrep(...args: unknown[]): Result<BrepHandle>;
28
28
  /**
29
- * Grid pattern — 2D grid copies of a shape (vendored patternFns.ts#gridPattern).
29
+ * Grid pattern — 2D grid copies of a shape (brepjs patternFns.ts#gridPattern).
30
30
  *
31
31
  * @param args - Resolved arguments (shape, directions, counts, spacings).
32
32
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -34,7 +34,7 @@ export declare function circularPatternBrep(...args: unknown[]): Result<BrepHand
34
34
  export declare function gridPatternBrep(...args: unknown[]): Result<BrepHandle>;
35
35
  /**
36
36
  * Rectangular pattern — two-direction rectangular array
37
- * (vendored compoundOpsFns.ts#rectangularPattern).
37
+ * (brepjs compoundOpsFns.ts#rectangularPattern).
38
38
  *
39
39
  * @param args - Resolved arguments (shape, rectangular pattern options).
40
40
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * Semantics mirror vendored `operations/patternFns.ts` + `compoundOpsFns.ts`
7
+ * Semantics mirror brepjs `operations/patternFns.ts` + `compoundOpsFns.ts`
8
8
  * rectangularPattern, on the L1 pattern primitives (occt-primitives:
9
9
  * native compound split per replica; gridPattern pre-fused compound).
10
10
  * Guards: PATTERN_INVALID_COUNT / PATTERN_ZERO_DIRECTION / PATTERN_ZERO_AXIS.
@@ -25,7 +25,7 @@ function vecNormalize(v) {
25
25
  const len = Math.hypot(v[0], v[1], v[2]);
26
26
  return [v[0] / len, v[1] / len, v[2] / len];
27
27
  }
28
- /** fuse 全部 replicas 并释放中间句柄(vendored fuseAll sameFace 等价)。 */
28
+ /** fuse 全部 replicas 并释放中间句柄(brepjs fuseAll sameFace 等价)。 */
29
29
  function fuseReplicas(kernel, copies) {
30
30
  const fused = kernel.fuseAll(copies);
31
31
  for (const c of copies)
@@ -33,10 +33,10 @@ function fuseReplicas(kernel, copies) {
33
33
  return fused;
34
34
  }
35
35
  // ---------------------------------------------------------------------------
36
- // linearPattern — 沿方向复制(vendored patternFns.ts#linearPattern)
36
+ // linearPattern — 沿方向复制(brepjs patternFns.ts#linearPattern)
37
37
  // ---------------------------------------------------------------------------
38
38
  /**
39
- * Linear pattern — copy a shape along a direction (vendored patternFns.ts#linearPattern).
39
+ * Linear pattern — copy a shape along a direction (brepjs patternFns.ts#linearPattern).
40
40
  *
41
41
  * @param args - Resolved arguments (shape, direction, count, spacing).
42
42
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -60,10 +60,10 @@ export function linearPatternBrep(...args) {
60
60
  return ok(fuseReplicas(kernel, copies));
61
61
  }
62
62
  // ---------------------------------------------------------------------------
63
- // circularPattern — 绕轴环形复制(vendored patternFns.ts#circularPattern)
63
+ // circularPattern — 绕轴环形复制(brepjs patternFns.ts#circularPattern)
64
64
  // ---------------------------------------------------------------------------
65
65
  /**
66
- * Circular pattern — copy a shape around an axis (vendored patternFns.ts#circularPattern).
66
+ * Circular pattern — copy a shape around an axis (brepjs patternFns.ts#circularPattern).
67
67
  *
68
68
  * @param args - Resolved arguments (shape, axis, count, fullAngle, center).
69
69
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -88,10 +88,10 @@ export function circularPatternBrep(...args) {
88
88
  return ok(fuseReplicas(kernel, copies));
89
89
  }
90
90
  // ---------------------------------------------------------------------------
91
- // gridPattern — 二维网格复制(vendored patternFns.ts#gridPattern)
91
+ // gridPattern — 二维网格复制(brepjs patternFns.ts#gridPattern)
92
92
  // ---------------------------------------------------------------------------
93
93
  /**
94
- * Grid pattern — 2D grid copies of a shape (vendored patternFns.ts#gridPattern).
94
+ * Grid pattern — 2D grid copies of a shape (brepjs patternFns.ts#gridPattern).
95
95
  *
96
96
  * @param args - Resolved arguments (shape, directions, counts, spacings).
97
97
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -121,11 +121,11 @@ export function gridPatternBrep(...args) {
121
121
  return ok(kernel.gridPattern(s, { x: nx2[0], y: nx2[1], z: nx2[2] }, { x: ny2[0], y: ny2[1], z: ny2[2] }, Number(spacingX), Number(spacingY), nx, ny));
122
122
  }
123
123
  // ---------------------------------------------------------------------------
124
- // rectangularPattern — 双向矩形阵列(vendored compoundOpsFns.ts#rectangularPattern)
124
+ // rectangularPattern — 双向矩形阵列(brepjs compoundOpsFns.ts#rectangularPattern)
125
125
  // ---------------------------------------------------------------------------
126
126
  /**
127
127
  * Rectangular pattern — two-direction rectangular array
128
- * (vendored compoundOpsFns.ts#rectangularPattern).
128
+ * (brepjs compoundOpsFns.ts#rectangularPattern).
129
129
  *
130
130
  * @param args - Resolved arguments (shape, rectangular pattern options).
131
131
  * @returns The fused pattern copies as a `BrepHandle`.
@@ -1 +1 @@
1
- {"version":3,"file":"patternFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/patternFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AACxI,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;A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OAAO,CAAC,CAAC,CAAC,CAAA;IACxC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — pattern family\n * (core-decouple Phase 3, §5.4; G4).\n *\n * @platform occt\n *\n * Semantics mirror vendored `operations/patternFns.ts` + `compoundOpsFns.ts`\n * rectangularPattern, on the L1 pattern primitives (occt-primitives:\n * native compound split per replica; gridPattern pre-fused compound).\n * Guards: PATTERN_INVALID_COUNT / PATTERN_ZERO_DIRECTION / PATTERN_ZERO_AXIS.\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { ok, err, type Result } from '../../result/result'\nimport { 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 } from './brepHelpers'\n\nconst LINEAR_PATTERN_PARAMS = { name: 'linearPattern', params: ['shape', 'direction', 'count', 'spacing'], formClass: 'A' as FormClass }\nconst CIRCULAR_PATTERN_PARAMS = { name: 'circularPattern', params: ['shape', 'axis', 'count', 'fullAngle', 'center'], formClass: 'A' as FormClass }\nconst GRID_PATTERN_PARAMS = { name: 'gridPattern', params: ['shape', 'directionX', 'directionY', 'countX', 'countY', 'spacingX', 'spacingY'], formClass: 'A' as FormClass }\nconst RECT_PATTERN_PARAMS = { name: 'rectangularPattern', params: ['shape', 'options'], formClass: 'A' as FormClass }\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\n/** fuse 全部 replicas 并释放中间句柄(vendored fuseAll sameFace 等价)。 */\nfunction fuseReplicas(kernel: ReturnType<typeof getBrepApi>, copies: BrepHandle[]): BrepHandle {\n const fused = kernel.fuseAll(copies)\n for (const c of copies) kernel.release(c)\n return fused\n}\n\n// ---------------------------------------------------------------------------\n// linearPattern — 沿方向复制(vendored patternFns.ts#linearPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Linear pattern — copy a shape along a direction (vendored patternFns.ts#linearPattern).\n *\n * @param args - Resolved arguments (shape, direction, count, spacing).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function linearPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, direction, count, spacing] = resolveArgs(args, LINEAR_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const n = Number(count)\n if (n < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern count must be at least 1'))\n }\n if (n === 1) return ok(s)\n const dir = (direction ?? [0, 0, 0]) as Vec3\n if (vecIsZero(dir)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Pattern direction cannot be zero'))\n }\n const nn = vecNormalize([dir[0], dir[1], dir[2]])\n const copies = kernel.linearPattern(\n s,\n { x: nn[0], y: nn[1], z: nn[2] },\n Number(spacing),\n n,\n )\n return ok(fuseReplicas(kernel, copies))\n}\n\n// ---------------------------------------------------------------------------\n// circularPattern — 绕轴环形复制(vendored patternFns.ts#circularPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Circular pattern — copy a shape around an axis (vendored patternFns.ts#circularPattern).\n *\n * @param args - Resolved arguments (shape, axis, count, fullAngle, center).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function circularPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, axis, count, fullAngle, center] = resolveArgs(args, CIRCULAR_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const n = Number(count)\n if (n < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern count must be at least 1'))\n }\n if (n === 1) return ok(s)\n const ax = (axis ?? [0, 0, 0]) as Vec3\n if (vecIsZero(ax)) {\n return err(validationError('PATTERN_ZERO_AXIS', 'Pattern axis cannot be zero'))\n }\n const angleStep = (fullAngle === undefined ? 360 : Number(fullAngle)) / n\n const c = (center ?? [0, 0, 0]) as Vec3\n const copies = kernel.circularPattern(\n s,\n { x: c[0], y: c[1], z: c[2] },\n { x: ax[0], y: ax[1], z: ax[2] },\n angleStep,\n n,\n )\n return ok(fuseReplicas(kernel, copies))\n}\n\n// ---------------------------------------------------------------------------\n// gridPattern — 二维网格复制(vendored patternFns.ts#gridPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Grid pattern — 2D grid copies of a shape (vendored patternFns.ts#gridPattern).\n *\n * @param args - Resolved arguments (shape, directions, counts, spacings).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function gridPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, directionX, directionY, countX, countY, spacingX, spacingY] = resolveArgs(args, GRID_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const nx = Number(countX)\n const ny = Number(countY)\n if (nx < 1 || ny < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Grid pattern counts must be at least 1'))\n }\n if (nx === 1 && ny === 1) return ok(s)\n const dx = (directionX ?? [0, 0, 0]) as Vec3\n const dy = (directionY ?? [0, 0, 0]) as Vec3\n if (vecIsZero(dx)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Grid directionX cannot be zero'))\n }\n if (vecIsZero(dy)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Grid directionY cannot be zero'))\n }\n const nx2 = vecNormalize([dx[0], dx[1], dx[2]])\n const ny2 = vecNormalize([dy[0], dy[1], dy[2]])\n // core gridPattern 已组合复制并 fuse 成单个 compound/solid\n return ok(\n kernel.gridPattern(\n s,\n { x: nx2[0], y: nx2[1], z: nx2[2] },\n { x: ny2[0], y: ny2[1], z: ny2[2] },\n Number(spacingX),\n Number(spacingY),\n nx,\n ny,\n ),\n )\n}\n\n// ---------------------------------------------------------------------------\n// rectangularPattern — 双向矩形阵列(vendored compoundOpsFns.ts#rectangularPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Rectangular pattern — two-direction rectangular array\n * (vendored compoundOpsFns.ts#rectangularPattern).\n *\n * @param args - Resolved arguments (shape, rectangular pattern options).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function rectangularPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, RECT_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { xDir, xCount, xSpacing, yDir, yCount, ySpacing } = (options ?? {}) as {\n xDir?: Vec3\n xCount?: number\n xSpacing?: number\n yDir?: Vec3\n yCount?: number\n ySpacing?: number\n }\n const xc = Number(xCount ?? 0)\n const yc = Number(yCount ?? 0)\n const xs = Number(xSpacing ?? 0)\n const ys = Number(ySpacing ?? 0)\n if (xc < 1 || yc < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern counts must be at least 1'))\n }\n if (xc === 1 && yc === 1) return ok(s)\n const xd = (xDir ?? [0, 0, 0]) as Vec3\n const yd = (yDir ?? [0, 0, 0]) as Vec3\n if (vecIsZero(xd)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'X direction cannot be zero'))\n }\n if (vecIsZero(yd)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Y direction cannot be zero'))\n }\n const xNorm = vecNormalize([xd[0], xd[1], xd[2]])\n const yNorm = vecNormalize([yd[0], yd[1], yd[2]])\n const copies: BrepHandle[] = [s]\n const owned: BrepHandle[] = []\n for (let xi = 0; xi < xc; xi++) {\n for (let yi = 0; yi < yc; yi++) {\n if (xi === 0 && yi === 0) continue\n const offset: Vec3 = [\n xNorm[0] * xs * xi + yNorm[0] * ys * yi,\n xNorm[1] * xs * xi + yNorm[1] * ys * yi,\n xNorm[2] * xs * xi + yNorm[2] * ys * yi,\n ]\n const c = kernel.translate(s, offset[0], offset[1], offset[2])\n copies.push(c)\n owned.push(c)\n }\n }\n const fused = kernel.fuseAll(copies)\n for (const c of owned) kernel.release(c)\n return ok(fused)\n}\n"]}
1
+ {"version":3,"file":"patternFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/patternFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AACxI,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AACnJ,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAC3K,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE,CAAA;AAErH,SAAS,SAAS,CAAC,CAAoB;IACrC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,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gBAAE,SAAQ;YAClC,MAAM,MAAM,GAAS;gBACnB,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE;gBACvC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE;gBACvC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE;aACxC,CAAA;YACD,MAAM,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;YAC9D,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACd,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACf,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACpC,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACxC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — pattern family\n * (core-decouple Phase 3, §5.4; G4).\n *\n * @platform occt\n *\n * Semantics mirror brepjs `operations/patternFns.ts` + `compoundOpsFns.ts`\n * rectangularPattern, on the L1 pattern primitives (occt-primitives:\n * native compound split per replica; gridPattern pre-fused compound).\n * Guards: PATTERN_INVALID_COUNT / PATTERN_ZERO_DIRECTION / PATTERN_ZERO_AXIS.\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { getBrepApi } from '../../brep/handle-bridge'\nimport { ok, err, type Result } from '../../result/result'\nimport { 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 } from './brepHelpers'\n\nconst LINEAR_PATTERN_PARAMS = { name: 'linearPattern', params: ['shape', 'direction', 'count', 'spacing'], formClass: 'A' as FormClass }\nconst CIRCULAR_PATTERN_PARAMS = { name: 'circularPattern', params: ['shape', 'axis', 'count', 'fullAngle', 'center'], formClass: 'A' as FormClass }\nconst GRID_PATTERN_PARAMS = { name: 'gridPattern', params: ['shape', 'directionX', 'directionY', 'countX', 'countY', 'spacingX', 'spacingY'], formClass: 'A' as FormClass }\nconst RECT_PATTERN_PARAMS = { name: 'rectangularPattern', params: ['shape', 'options'], formClass: 'A' as FormClass }\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\n/** fuse 全部 replicas 并释放中间句柄(brepjs fuseAll sameFace 等价)。 */\nfunction fuseReplicas(kernel: ReturnType<typeof getBrepApi>, copies: BrepHandle[]): BrepHandle {\n const fused = kernel.fuseAll(copies)\n for (const c of copies) kernel.release(c)\n return fused\n}\n\n// ---------------------------------------------------------------------------\n// linearPattern — 沿方向复制(brepjs patternFns.ts#linearPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Linear pattern — copy a shape along a direction (brepjs patternFns.ts#linearPattern).\n *\n * @param args - Resolved arguments (shape, direction, count, spacing).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function linearPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, direction, count, spacing] = resolveArgs(args, LINEAR_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const n = Number(count)\n if (n < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern count must be at least 1'))\n }\n if (n === 1) return ok(s)\n const dir = (direction ?? [0, 0, 0]) as Vec3\n if (vecIsZero(dir)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Pattern direction cannot be zero'))\n }\n const nn = vecNormalize([dir[0], dir[1], dir[2]])\n const copies = kernel.linearPattern(\n s,\n { x: nn[0], y: nn[1], z: nn[2] },\n Number(spacing),\n n,\n )\n return ok(fuseReplicas(kernel, copies))\n}\n\n// ---------------------------------------------------------------------------\n// circularPattern — 绕轴环形复制(brepjs patternFns.ts#circularPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Circular pattern — copy a shape around an axis (brepjs patternFns.ts#circularPattern).\n *\n * @param args - Resolved arguments (shape, axis, count, fullAngle, center).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function circularPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, axis, count, fullAngle, center] = resolveArgs(args, CIRCULAR_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const n = Number(count)\n if (n < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern count must be at least 1'))\n }\n if (n === 1) return ok(s)\n const ax = (axis ?? [0, 0, 0]) as Vec3\n if (vecIsZero(ax)) {\n return err(validationError('PATTERN_ZERO_AXIS', 'Pattern axis cannot be zero'))\n }\n const angleStep = (fullAngle === undefined ? 360 : Number(fullAngle)) / n\n const c = (center ?? [0, 0, 0]) as Vec3\n const copies = kernel.circularPattern(\n s,\n { x: c[0], y: c[1], z: c[2] },\n { x: ax[0], y: ax[1], z: ax[2] },\n angleStep,\n n,\n )\n return ok(fuseReplicas(kernel, copies))\n}\n\n// ---------------------------------------------------------------------------\n// gridPattern — 二维网格复制(brepjs patternFns.ts#gridPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Grid pattern — 2D grid copies of a shape (brepjs patternFns.ts#gridPattern).\n *\n * @param args - Resolved arguments (shape, directions, counts, spacings).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function gridPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, directionX, directionY, countX, countY, spacingX, spacingY] = resolveArgs(args, GRID_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const nx = Number(countX)\n const ny = Number(countY)\n if (nx < 1 || ny < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Grid pattern counts must be at least 1'))\n }\n if (nx === 1 && ny === 1) return ok(s)\n const dx = (directionX ?? [0, 0, 0]) as Vec3\n const dy = (directionY ?? [0, 0, 0]) as Vec3\n if (vecIsZero(dx)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Grid directionX cannot be zero'))\n }\n if (vecIsZero(dy)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Grid directionY cannot be zero'))\n }\n const nx2 = vecNormalize([dx[0], dx[1], dx[2]])\n const ny2 = vecNormalize([dy[0], dy[1], dy[2]])\n // core gridPattern 已组合复制并 fuse 成单个 compound/solid\n return ok(\n kernel.gridPattern(\n s,\n { x: nx2[0], y: nx2[1], z: nx2[2] },\n { x: ny2[0], y: ny2[1], z: ny2[2] },\n Number(spacingX),\n Number(spacingY),\n nx,\n ny,\n ),\n )\n}\n\n// ---------------------------------------------------------------------------\n// rectangularPattern — 双向矩形阵列(brepjs compoundOpsFns.ts#rectangularPattern)\n// ---------------------------------------------------------------------------\n\n/**\n * Rectangular pattern — two-direction rectangular array\n * (brepjs compoundOpsFns.ts#rectangularPattern).\n *\n * @param args - Resolved arguments (shape, rectangular pattern options).\n * @returns The fused pattern copies as a `BrepHandle`.\n */\nexport function rectangularPatternBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, RECT_PATTERN_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const { xDir, xCount, xSpacing, yDir, yCount, ySpacing } = (options ?? {}) as {\n xDir?: Vec3\n xCount?: number\n xSpacing?: number\n yDir?: Vec3\n yCount?: number\n ySpacing?: number\n }\n const xc = Number(xCount ?? 0)\n const yc = Number(yCount ?? 0)\n const xs = Number(xSpacing ?? 0)\n const ys = Number(ySpacing ?? 0)\n if (xc < 1 || yc < 1) {\n return err(validationError('PATTERN_INVALID_COUNT', 'Pattern counts must be at least 1'))\n }\n if (xc === 1 && yc === 1) return ok(s)\n const xd = (xDir ?? [0, 0, 0]) as Vec3\n const yd = (yDir ?? [0, 0, 0]) as Vec3\n if (vecIsZero(xd)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'X direction cannot be zero'))\n }\n if (vecIsZero(yd)) {\n return err(validationError('PATTERN_ZERO_DIRECTION', 'Y direction cannot be zero'))\n }\n const xNorm = vecNormalize([xd[0], xd[1], xd[2]])\n const yNorm = vecNormalize([yd[0], yd[1], yd[2]])\n const copies: BrepHandle[] = [s]\n const owned: BrepHandle[] = []\n for (let xi = 0; xi < xc; xi++) {\n for (let yi = 0; yi < yc; yi++) {\n if (xi === 0 && yi === 0) continue\n const offset: Vec3 = [\n xNorm[0] * xs * xi + yNorm[0] * ys * yi,\n xNorm[1] * xs * xi + yNorm[1] * ys * yi,\n xNorm[2] * xs * xi + yNorm[2] * ys * yi,\n ]\n const c = kernel.translate(s, offset[0], offset[1], offset[2])\n copies.push(c)\n owned.push(c)\n }\n }\n const fused = kernel.fuseAll(copies)\n for (const c of owned) kernel.release(c)\n return ok(fused)\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  * @platform occt
6
6
  *
7
7
  * Brep-shaped implementations for `torus`, `ellipsoid`, `makeBaseBox`.
8
- * Semantics mirror vendored `topology/primitiveFns.ts` + `solidBuilders.ts`
8
+ * Semantics mirror brepjs `topology/primitiveFns.ts` + `solidBuilders.ts`
9
9
  * (`makeTorus`/`makeEllipsoid` take at/axis placement) and
10
10
  * `sketching/shortcuts.ts` `makeBaseBox` (origin-centered XY rectangle extruded
11
11
  * along +Z). Placement is composed from L1 `translate`/`generalTransform`
@@ -14,7 +14,7 @@
14
14
  import type { BrepHandle } from '../../brep/engine/types.js';
15
15
  import { type Result } from '../../result/result.js';
16
16
  /**
17
- * Create a torus (vendored `torus(majorRadius, minorRadius, {at, axis})`).
17
+ * Create a torus (brepjs `torus(majorRadius, minorRadius, {at, axis})`).
18
18
  *
19
19
  * The L1 `makeTorus(major, minor)` builds the ring on the +Z axis at the
20
20
  * origin; placement is composed afterwards (`axis` → rotation, `at` →
@@ -25,7 +25,7 @@ import { type Result } from '../../result/result.js';
25
25
  */
26
26
  export declare function torusBrep(...args: unknown[]): Result<BrepHandle>;
27
27
  /**
28
- * Create an ellipsoid (vendored `ellipsoid(rx, ry, rz, {at})`).
28
+ * Create an ellipsoid (brepjs `ellipsoid(rx, ry, rz, {at})`).
29
29
  *
30
30
  * @param args - Resolved arguments (rx, ry, rz, placement options).
31
31
  * @returns The ellipsoid as a `BrepHandle`.
@@ -33,7 +33,7 @@ export declare function torusBrep(...args: unknown[]): Result<BrepHandle>;
33
33
  export declare function ellipsoidBrep(...args: unknown[]): Result<BrepHandle>;
34
34
  /**
35
35
  * Create a base box: origin-centered XY rectangle extruded by `zLength` along
36
- * +Z (vendored `makeBaseBox(xLength, yLength, zLength)` via the sketcher).
36
+ * +Z (brepjs `makeBaseBox(xLength, yLength, zLength)` via the sketcher).
37
37
  *
38
38
  * @param args - Resolved arguments (xLength, yLength, zLength).
39
39
  * @returns The box as a `BrepHandle`.
@@ -5,7 +5,7 @@
5
5
  * @platform occt
6
6
  *
7
7
  * Brep-shaped implementations for `torus`, `ellipsoid`, `makeBaseBox`.
8
- * Semantics mirror vendored `topology/primitiveFns.ts` + `solidBuilders.ts`
8
+ * Semantics mirror brepjs `topology/primitiveFns.ts` + `solidBuilders.ts`
9
9
  * (`makeTorus`/`makeEllipsoid` take at/axis placement) and
10
10
  * `sketching/shortcuts.ts` `makeBaseBox` (origin-centered XY rectangle extruded
11
11
  * along +Z). Placement is composed from L1 `translate`/`generalTransform`
@@ -30,7 +30,7 @@ function translated(kernel, h, v) {
30
30
  return next;
31
31
  }
32
32
  /**
33
- * Create a torus (vendored `torus(majorRadius, minorRadius, {at, axis})`).
33
+ * Create a torus (brepjs `torus(majorRadius, minorRadius, {at, axis})`).
34
34
  *
35
35
  * The L1 `makeTorus(major, minor)` builds the ring on the +Z axis at the
36
36
  * origin; placement is composed afterwards (`axis` → rotation, `at` →
@@ -59,7 +59,7 @@ export function torusBrep(...args) {
59
59
  }
60
60
  }
61
61
  /**
62
- * Create an ellipsoid (vendored `ellipsoid(rx, ry, rz, {at})`).
62
+ * Create an ellipsoid (brepjs `ellipsoid(rx, ry, rz, {at})`).
63
63
  *
64
64
  * @param args - Resolved arguments (rx, ry, rz, placement options).
65
65
  * @returns The ellipsoid as a `BrepHandle`.
@@ -80,7 +80,7 @@ export function ellipsoidBrep(...args) {
80
80
  }
81
81
  /**
82
82
  * Create a base box: origin-centered XY rectangle extruded by `zLength` along
83
- * +Z (vendored `makeBaseBox(xLength, yLength, zLength)` via the sketcher).
83
+ * +Z (brepjs `makeBaseBox(xLength, yLength, zLength)` via the sketcher).
84
84
  *
85
85
  * @param args - Resolved arguments (xLength, yLength, zLength).
86
86
  * @returns The box as a `BrepHandle`.
@@ -1 +1 @@
1
- {"version":3,"file":"primitiveFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/primitiveFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAgB,EAAE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,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAC/G,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG,IAAe;IAChD,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAA;IAC3E,MAAM,MAAM,GAAG,UAAU,EAAE,CAAA;IAC3B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,CAAC,OAAiB,EAAE,OAAiB,CAAC,CAAA;QACvE,IAAI,CAAC;YACH,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,OAAiB,CAAC,CAAC,CAAA;QAC1D,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,GAAG,CACR,WAAW,CAAC,sBAAsB,EAAE,gCAAgC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CACrH,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — solid primitives\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Brep-shaped implementations for `torus`, `ellipsoid`, `makeBaseBox`.\n * Semantics mirror vendored `topology/primitiveFns.ts` + `solidBuilders.ts`\n * (`makeTorus`/`makeEllipsoid` take at/axis placement) and\n * `sketching/shortcuts.ts` `makeBaseBox` (origin-centered XY rectangle extruded\n * along +Z). Placement is composed from L1 `translate`/`generalTransform`\n * since the L1 `makeTorus`/`makeEllipsoid` signatures carry no location.\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 } 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 { rotationZTo } from './brepHelpers'\n\nconst TORUS_PARAMS = { name: 'torus', params: ['majorRadius', 'minorRadius', 'options'], formClass: 'A' as FormClass }\nconst ELLIPSOID_PARAMS = { name: 'ellipsoid', params: ['rx', 'ry', 'rz', 'options'], formClass: 'A' as FormClass }\nconst MAKE_BASE_BOX_PARAMS = {\n name: 'makeBaseBox',\n params: ['xLength', 'yLength', 'zLength'],\n formClass: 'A' as FormClass,\n}\n\n/** Translate a handle, releasing the intermediate (kernel returns a fresh one). */\nfunction translated(kernel: ReturnType<typeof getBrepApi>, h: BrepHandle, v: Vec3): BrepHandle {\n const next = kernel.translate(h, v[0], v[1], v[2])\n kernel.release(h)\n return next\n}\n\n/**\n * Create a torus (vendored `torus(majorRadius, minorRadius, {at, axis})`).\n *\n * The L1 `makeTorus(major, minor)` builds the ring on the +Z axis at the\n * origin; placement is composed afterwards (`axis` → rotation, `at` →\n * translation).\n *\n * @param args - Resolved arguments (majorRadius, minorRadius, placement options).\n * @returns The torus as a `BrepHandle`.\n */\nexport function torusBrep(...args: unknown[]): Result<BrepHandle> {\n const [majorRadius, minorRadius, options] = resolveArgs(args, TORUS_PARAMS)\n const opts = (options ?? {}) as { at?: Vec3; axis?: Vec3 }\n const kernel = getBrepApi()\n try {\n let h = kernel.makeTorus(majorRadius as number, minorRadius as number)\n if (opts.axis && !(opts.axis[0] === 0 && opts.axis[1] === 0 && opts.axis[2] === 1)) {\n const rotated = kernel.generalTransform(h, rotationZTo(opts.axis))\n kernel.release(h)\n h = rotated\n }\n if (opts.at) h = translated(kernel, h, opts.at)\n return ok(h)\n } catch (e) {\n return err(\n kernelError('TORUS_FAILED', `torus: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n\n/**\n * Create an ellipsoid (vendored `ellipsoid(rx, ry, rz, {at})`).\n *\n * @param args - Resolved arguments (rx, ry, rz, placement options).\n * @returns The ellipsoid as a `BrepHandle`.\n */\nexport function ellipsoidBrep(...args: unknown[]): Result<BrepHandle> {\n const [rx, ry, rz, options] = resolveArgs(args, ELLIPSOID_PARAMS)\n const opts = (options ?? {}) as { at?: Vec3 }\n const kernel = getBrepApi()\n try {\n let h = kernel.makeEllipsoid(rx as number, ry as number, rz as number)\n if (opts.at) h = translated(kernel, h, opts.at)\n return ok(h)\n } catch (e) {\n return err(\n kernelError('ELLIPSOID_FAILED', `ellipsoid: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n\n/**\n * Create a base box: origin-centered XY rectangle extruded by `zLength` along\n * +Z (vendored `makeBaseBox(xLength, yLength, zLength)` via the sketcher).\n *\n * @param args - Resolved arguments (xLength, yLength, zLength).\n * @returns The box as a `BrepHandle`.\n */\nexport function makeBaseBoxBrep(...args: unknown[]): Result<BrepHandle> {\n const [xLength, yLength, zLength] = resolveArgs(args, MAKE_BASE_BOX_PARAMS)\n const kernel = getBrepApi()\n try {\n const rect = kernel.makeRectangle(xLength as number, yLength as number)\n try {\n return ok(kernel.extrude(rect, 0, 0, zLength as number))\n } finally {\n kernel.release(rect)\n }\n } catch (e) {\n return err(\n kernelError('MAKE_BASE_BOX_FAILED', `makeBaseBox: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n"]}
1
+ {"version":3,"file":"primitiveFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/primitiveFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,qBAAqB,CAAA;AAC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osted compat-op implementations — solid primitives\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Brep-shaped implementations for `torus`, `ellipsoid`, `makeBaseBox`.\n * Semantics mirror brepjs `topology/primitiveFns.ts` + `solidBuilders.ts`\n * (`makeTorus`/`makeEllipsoid` take at/axis placement) and\n * `sketching/shortcuts.ts` `makeBaseBox` (origin-centered XY rectangle extruded\n * along +Z). Placement is composed from L1 `translate`/`generalTransform`\n * since the L1 `makeTorus`/`makeEllipsoid` signatures carry no location.\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 } 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 { rotationZTo } from './brepHelpers'\n\nconst TORUS_PARAMS = { name: 'torus', params: ['majorRadius', 'minorRadius', 'options'], formClass: 'A' as FormClass }\nconst ELLIPSOID_PARAMS = { name: 'ellipsoid', params: ['rx', 'ry', 'rz', 'options'], formClass: 'A' as FormClass }\nconst MAKE_BASE_BOX_PARAMS = {\n name: 'makeBaseBox',\n params: ['xLength', 'yLength', 'zLength'],\n formClass: 'A' as FormClass,\n}\n\n/** Translate a handle, releasing the intermediate (kernel returns a fresh one). */\nfunction translated(kernel: ReturnType<typeof getBrepApi>, h: BrepHandle, v: Vec3): BrepHandle {\n const next = kernel.translate(h, v[0], v[1], v[2])\n kernel.release(h)\n return next\n}\n\n/**\n * Create a torus (brepjs `torus(majorRadius, minorRadius, {at, axis})`).\n *\n * The L1 `makeTorus(major, minor)` builds the ring on the +Z axis at the\n * origin; placement is composed afterwards (`axis` → rotation, `at` →\n * translation).\n *\n * @param args - Resolved arguments (majorRadius, minorRadius, placement options).\n * @returns The torus as a `BrepHandle`.\n */\nexport function torusBrep(...args: unknown[]): Result<BrepHandle> {\n const [majorRadius, minorRadius, options] = resolveArgs(args, TORUS_PARAMS)\n const opts = (options ?? {}) as { at?: Vec3; axis?: Vec3 }\n const kernel = getBrepApi()\n try {\n let h = kernel.makeTorus(majorRadius as number, minorRadius as number)\n if (opts.axis && !(opts.axis[0] === 0 && opts.axis[1] === 0 && opts.axis[2] === 1)) {\n const rotated = kernel.generalTransform(h, rotationZTo(opts.axis))\n kernel.release(h)\n h = rotated\n }\n if (opts.at) h = translated(kernel, h, opts.at)\n return ok(h)\n } catch (e) {\n return err(\n kernelError('TORUS_FAILED', `torus: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n\n/**\n * Create an ellipsoid (brepjs `ellipsoid(rx, ry, rz, {at})`).\n *\n * @param args - Resolved arguments (rx, ry, rz, placement options).\n * @returns The ellipsoid as a `BrepHandle`.\n */\nexport function ellipsoidBrep(...args: unknown[]): Result<BrepHandle> {\n const [rx, ry, rz, options] = resolveArgs(args, ELLIPSOID_PARAMS)\n const opts = (options ?? {}) as { at?: Vec3 }\n const kernel = getBrepApi()\n try {\n let h = kernel.makeEllipsoid(rx as number, ry as number, rz as number)\n if (opts.at) h = translated(kernel, h, opts.at)\n return ok(h)\n } catch (e) {\n return err(\n kernelError('ELLIPSOID_FAILED', `ellipsoid: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n\n/**\n * Create a base box: origin-centered XY rectangle extruded by `zLength` along\n * +Z (brepjs `makeBaseBox(xLength, yLength, zLength)` via the sketcher).\n *\n * @param args - Resolved arguments (xLength, yLength, zLength).\n * @returns The box as a `BrepHandle`.\n */\nexport function makeBaseBoxBrep(...args: unknown[]): Result<BrepHandle> {\n const [xLength, yLength, zLength] = resolveArgs(args, MAKE_BASE_BOX_PARAMS)\n const kernel = getBrepApi()\n try {\n const rect = kernel.makeRectangle(xLength as number, yLength as number)\n try {\n return ok(kernel.extrude(rect, 0, 0, zLength as number))\n } finally {\n kernel.release(rect)\n }\n } catch (e) {\n return err(\n kernelError('MAKE_BASE_BOX_FAILED', `makeBaseBox: kernel failure: ${e instanceof Error ? e.message : String(e)}`, e),\n )\n }\n}\n"]}
@@ -4,18 +4,18 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * 迁移自 vendored `operations/roofFns.ts`(含 pure-TS straightSkeleton,
7
+ * 迁移自 brepjs `operations/roofFns.ts`(含 pure-TS straightSkeleton,
8
8
  * 见同目录 straightSkeleton.ts)。适配:
9
9
  * - getEdges → kernel.getSubShapes(handle, 'edge')
10
10
  * - curveStartPoint → kernel.curvePointAtParam(edge, 0)
11
11
  * - isValidSolid → kernel.isSolid(sew 兜底路径的闭合校验近似)
12
12
  * - Result/BrepError 用 core 面;输出 Result<BrepHandle>
13
- * 守卫与错误码保持 vendored:ROOF_FAILED / STRAIGHT_SKELETON_FAILED。
13
+ * 守卫与错误码保持 brepjs:ROOF_FAILED / STRAIGHT_SKELETON_FAILED。
14
14
  */
15
15
  import type { BrepHandle } from '../../brep/engine/types.js';
16
16
  import { type Result } from '../../result/result.js';
17
17
  /**
18
- * Roof — planar wire to straight-skeleton roof solid (vendored roofFns.ts#roof).
18
+ * Roof — planar wire to straight-skeleton roof solid (brepjs roofFns.ts#roof).
19
19
  *
20
20
  * @param args - Resolved arguments (wire, roof options).
21
21
  * @returns The generated roof solid as a `BrepHandle`.
@@ -4,13 +4,13 @@
4
4
  *
5
5
  * @platform occt
6
6
  *
7
- * 迁移自 vendored `operations/roofFns.ts`(含 pure-TS straightSkeleton,
7
+ * 迁移自 brepjs `operations/roofFns.ts`(含 pure-TS straightSkeleton,
8
8
  * 见同目录 straightSkeleton.ts)。适配:
9
9
  * - getEdges → kernel.getSubShapes(handle, 'edge')
10
10
  * - curveStartPoint → kernel.curvePointAtParam(edge, 0)
11
11
  * - isValidSolid → kernel.isSolid(sew 兜底路径的闭合校验近似)
12
12
  * - Result/BrepError 用 core 面;输出 Result<BrepHandle>
13
- * 守卫与错误码保持 vendored:ROOF_FAILED / STRAIGHT_SKELETON_FAILED。
13
+ * 守卫与错误码保持 brepjs:ROOF_FAILED / STRAIGHT_SKELETON_FAILED。
14
14
  */
15
15
  import { getBrepApi } from '../../brep/handle-bridge.js';
16
16
  import { ok, err } from '../../result/result.js';
@@ -20,7 +20,7 @@ import { brepHandleOf } from './brepHelpers.js';
20
20
  import { computeStraightSkeleton } from './straightSkeleton.js';
21
21
  const ROOF_PARAMS = { name: 'roof', params: ['shape', 'options'], formClass: 'A' };
22
22
  // ---------------------------------------------------------------------------
23
- // Helpers(照抄 vendored roofFns.ts)
23
+ // Helpers(照抄 brepjs roofFns.ts)
24
24
  // ---------------------------------------------------------------------------
25
25
  function extractPolygon(kernel, wire) {
26
26
  const edges = kernel.getSubShapes(wire, 'edge');
@@ -60,7 +60,7 @@ function pointInTriangle(px, py, ax, ay, bx, by, cx, cy) {
60
60
  const hasPos = d1 > 0 || d2 > 0 || d3 > 0;
61
61
  return !(hasNeg && hasPos);
62
62
  }
63
- /** Ear-clip triangulate a simple polygon(照抄 vendored,含 CW→CCW 归一)。 */
63
+ /** Ear-clip triangulate a simple polygon(照抄 brepjs,含 CW→CCW 归一)。 */
64
64
  function earClipTriangulate(poly) {
65
65
  const n = poly.length;
66
66
  if (n < 3)
@@ -122,7 +122,7 @@ function earClipTriangulate(poly) {
122
122
  }
123
123
  return tris;
124
124
  }
125
- /** Convert skeleton faces into 3D triangular kernel faces(照抄 vendored)。 */
125
+ /** Convert skeleton faces into 3D triangular kernel faces(照抄 brepjs)。 */
126
126
  function buildSkeletonTriFaces(skeleton, tanAngle, kernel) {
127
127
  const triFaces = [];
128
128
  for (const skFace of skeleton.faces) {
@@ -158,10 +158,10 @@ function buildSkeletonTriFaces(skeleton, tanAngle, kernel) {
158
158
  return triFaces;
159
159
  }
160
160
  // ---------------------------------------------------------------------------
161
- // roof — 平面 wire → 直骨架屋顶实体(vendored roofFns.ts#roof)
161
+ // roof — 平面 wire → 直骨架屋顶实体(brepjs roofFns.ts#roof)
162
162
  // ---------------------------------------------------------------------------
163
163
  /**
164
- * Roof — planar wire to straight-skeleton roof solid (vendored roofFns.ts#roof).
164
+ * Roof — planar wire to straight-skeleton roof solid (brepjs roofFns.ts#roof).
165
165
  *
166
166
  * @param args - Resolved arguments (wire, roof options).
167
167
  * @returns The generated roof solid as a `BrepHandle`.