@faicad/faijs 0.29.5 → 0.31.1

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 (722) hide show
  1. package/NOTICE +6 -5
  2. package/dist/api/align/index.d.ts +64 -0
  3. package/dist/api/align/index.d.ts.map +1 -0
  4. package/dist/api/align/index.js +101 -0
  5. package/dist/api/align/index.js.map +1 -0
  6. package/dist/api/api-namespace.d.ts +6 -5
  7. package/dist/api/api-namespace.d.ts.map +1 -1
  8. package/dist/api/api-namespace.js +89 -5
  9. package/dist/api/api-namespace.js.map +1 -1
  10. package/dist/api/appearance.d.ts +0 -2
  11. package/dist/api/appearance.d.ts.map +1 -1
  12. package/dist/api/appearance.js +0 -2
  13. package/dist/api/appearance.js.map +1 -1
  14. package/dist/api/assembly/entities.d.ts +1 -1
  15. package/dist/api/assembly/entities.js +1 -1
  16. package/dist/api/assembly/entities.js.map +1 -1
  17. package/dist/api/assembly/index.d.ts +1 -1
  18. package/dist/api/assembly/index.js +1 -1
  19. package/dist/api/assembly/index.js.map +1 -1
  20. package/dist/api/assembly/joints.d.ts +33 -15
  21. package/dist/api/assembly/joints.d.ts.map +1 -1
  22. package/dist/api/assembly/joints.js +31 -13
  23. package/dist/api/assembly/joints.js.map +1 -1
  24. package/dist/api/assembly/preview.d.ts +1 -1
  25. package/dist/api/assembly/preview.js +1 -1
  26. package/dist/api/assembly/preview.js.map +1 -1
  27. package/dist/api/assembly/solve.d.ts +1 -1
  28. package/dist/api/assembly/solve.js +1 -1
  29. package/dist/api/assembly/solve.js.map +1 -1
  30. package/dist/api/assembly/solvers/assembly-tree.d.ts +1 -1
  31. package/dist/api/assembly/solvers/assembly-tree.js +1 -1
  32. package/dist/api/assembly/solvers/assembly-tree.js.map +1 -1
  33. package/dist/api/assembly/solvers/chain-solver.d.ts +2 -2
  34. package/dist/api/assembly/solvers/chain-solver.js.map +1 -1
  35. package/dist/api/assembly/solvers/global-solver.d.ts +1 -2
  36. package/dist/api/assembly/solvers/global-solver.d.ts.map +1 -1
  37. package/dist/api/assembly/solvers/global-solver.js +3 -4
  38. package/dist/api/assembly/solvers/global-solver.js.map +1 -1
  39. package/dist/api/assembly/solvers/joints-kinematics.js +1 -1
  40. package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -1
  41. package/dist/api/assembly/solvers/linalg.d.ts +2 -2
  42. package/dist/api/assembly/solvers/linalg.js +2 -2
  43. package/dist/api/assembly/solvers/linalg.js.map +1 -1
  44. package/dist/api/assembly/solvers/types.d.ts +2 -5
  45. package/dist/api/assembly/solvers/types.d.ts.map +1 -1
  46. package/dist/api/assembly/solvers/types.js +1 -4
  47. package/dist/api/assembly/solvers/types.js.map +1 -1
  48. package/dist/api/boolean-op/index.d.ts +65 -0
  49. package/dist/api/boolean-op/index.d.ts.map +1 -0
  50. package/dist/api/boolean-op/index.js +113 -0
  51. package/dist/api/boolean-op/index.js.map +1 -0
  52. package/dist/api/boolean.d.ts.map +1 -1
  53. package/dist/api/boolean.js +22 -33
  54. package/dist/api/boolean.js.map +1 -1
  55. package/dist/api/brep-mirror/booleanFns.d.ts +3 -3
  56. package/dist/api/brep-mirror/booleanFns.js +5 -5
  57. package/dist/api/brep-mirror/booleanFns.js.map +1 -1
  58. package/dist/api/brep-mirror/compoundFns.d.ts +1 -1
  59. package/dist/api/brep-mirror/compoundFns.js +4 -4
  60. package/dist/api/brep-mirror/compoundFns.js.map +1 -1
  61. package/dist/api/brep-mirror/healingFns.d.ts +4 -4
  62. package/dist/api/brep-mirror/healingFns.js +4 -4
  63. package/dist/api/brep-mirror/healingFns.js.map +1 -1
  64. package/dist/api/brep-mirror/hullFns.d.ts +2 -2
  65. package/dist/api/brep-mirror/hullFns.js +2 -2
  66. package/dist/api/brep-mirror/hullFns.js.map +1 -1
  67. package/dist/api/brep-mirror/patternFns.d.ts +5 -5
  68. package/dist/api/brep-mirror/patternFns.js +10 -10
  69. package/dist/api/brep-mirror/patternFns.js.map +1 -1
  70. package/dist/api/brep-mirror/primitiveFns.d.ts +4 -4
  71. package/dist/api/brep-mirror/primitiveFns.js +4 -4
  72. package/dist/api/brep-mirror/primitiveFns.js.map +1 -1
  73. package/dist/api/brep-mirror/roofFns.d.ts +3 -3
  74. package/dist/api/brep-mirror/roofFns.js +7 -7
  75. package/dist/api/brep-mirror/roofFns.js.map +1 -1
  76. package/dist/api/brep-mirror/sweepFns.d.ts +7 -7
  77. package/dist/api/brep-mirror/sweepFns.js +14 -14
  78. package/dist/api/brep-mirror/sweepFns.js.map +1 -1
  79. package/dist/api/brep-mirror/threadFns.d.ts +1 -1
  80. package/dist/api/brep-mirror/threadFns.js +1 -1
  81. package/dist/api/brep-mirror/threadFns.js.map +1 -1
  82. package/dist/api/brep-mirror/topologyFns.d.ts +5 -5
  83. package/dist/api/brep-mirror/topologyFns.js +8 -8
  84. package/dist/api/brep-mirror/topologyFns.js.map +1 -1
  85. package/dist/api/brep-operations/booleanFns.d.ts +40 -0
  86. package/dist/api/brep-operations/booleanFns.d.ts.map +1 -0
  87. package/dist/api/brep-operations/booleanFns.js +104 -0
  88. package/dist/api/brep-operations/booleanFns.js.map +1 -0
  89. package/dist/api/brep-operations/brepHelpers.d.ts +55 -0
  90. package/dist/api/brep-operations/brepHelpers.d.ts.map +1 -0
  91. package/dist/api/brep-operations/brepHelpers.js +131 -0
  92. package/dist/api/brep-operations/brepHelpers.js.map +1 -0
  93. package/dist/api/brep-operations/compoundFns.d.ts +46 -0
  94. package/dist/api/brep-operations/compoundFns.d.ts.map +1 -0
  95. package/dist/api/brep-operations/compoundFns.js +299 -0
  96. package/dist/api/brep-operations/compoundFns.js.map +1 -0
  97. package/dist/api/brep-operations/healingFns.d.ts +91 -0
  98. package/dist/api/brep-operations/healingFns.d.ts.map +1 -0
  99. package/dist/api/brep-operations/healingFns.js +321 -0
  100. package/dist/api/brep-operations/healingFns.js.map +1 -0
  101. package/dist/api/brep-operations/hullFns.d.ts +20 -0
  102. package/dist/api/brep-operations/hullFns.d.ts.map +1 -0
  103. package/dist/api/brep-operations/hullFns.js +46 -0
  104. package/dist/api/brep-operations/hullFns.js.map +1 -0
  105. package/dist/api/brep-operations/joinery-brep.d.ts +172 -0
  106. package/dist/api/brep-operations/joinery-brep.d.ts.map +1 -0
  107. package/dist/api/brep-operations/joinery-brep.js +463 -0
  108. package/dist/api/brep-operations/joinery-brep.js.map +1 -0
  109. package/dist/api/brep-operations/patternFns.d.ts +43 -0
  110. package/dist/api/brep-operations/patternFns.d.ts.map +1 -0
  111. package/dist/api/brep-operations/patternFns.js +178 -0
  112. package/dist/api/brep-operations/patternFns.js.map +1 -0
  113. package/dist/api/brep-operations/primitiveFns.d.ts +42 -0
  114. package/dist/api/brep-operations/primitiveFns.d.ts.map +1 -0
  115. package/dist/api/brep-operations/primitiveFns.js +104 -0
  116. package/dist/api/brep-operations/primitiveFns.js.map +1 -0
  117. package/dist/api/brep-operations/roofFns.d.ts +24 -0
  118. package/dist/api/brep-operations/roofFns.d.ts.map +1 -0
  119. package/dist/api/brep-operations/roofFns.js +229 -0
  120. package/dist/api/brep-operations/roofFns.js.map +1 -0
  121. package/dist/api/brep-operations/straightSkeleton.d.ts +36 -0
  122. package/dist/api/brep-operations/straightSkeleton.d.ts.map +1 -0
  123. package/dist/api/brep-operations/straightSkeleton.js +431 -0
  124. package/dist/api/brep-operations/straightSkeleton.js.map +1 -0
  125. package/dist/api/brep-operations/sweepFns.d.ts +60 -0
  126. package/dist/api/brep-operations/sweepFns.d.ts.map +1 -0
  127. package/dist/api/brep-operations/sweepFns.js +323 -0
  128. package/dist/api/brep-operations/sweepFns.js.map +1 -0
  129. package/dist/api/brep-operations/threadFns.d.ts +83 -0
  130. package/dist/api/brep-operations/threadFns.d.ts.map +1 -0
  131. package/dist/api/brep-operations/threadFns.js +138 -0
  132. package/dist/api/brep-operations/threadFns.js.map +1 -0
  133. package/dist/api/brep-operations/topologyFns.d.ts +111 -0
  134. package/dist/api/brep-operations/topologyFns.d.ts.map +1 -0
  135. package/dist/api/brep-operations/topologyFns.js +300 -0
  136. package/dist/api/brep-operations/topologyFns.js.map +1 -0
  137. package/dist/api/brep-topology.d.ts +1 -1
  138. package/dist/api/brep-topology.d.ts.map +1 -1
  139. package/dist/api/brep-topology.js +1 -1
  140. package/dist/api/brep-topology.js.map +1 -1
  141. package/dist/api/brepjs-compat/index.d.ts +1 -1
  142. package/dist/api/brepjs-compat/index.js +3 -3
  143. package/dist/api/brepjs-compat/index.js.map +1 -1
  144. package/dist/api/cadquery-selectors/borrow-bridge.d.ts.map +1 -1
  145. package/dist/api/cadquery-selectors/borrow-bridge.js +3 -4
  146. package/dist/api/cadquery-selectors/borrow-bridge.js.map +1 -1
  147. package/dist/api/chamfer.d.ts +5 -4
  148. package/dist/api/chamfer.d.ts.map +1 -1
  149. package/dist/api/chamfer.js +12 -11
  150. package/dist/api/chamfer.js.map +1 -1
  151. package/dist/api/curve-sketch/index.d.ts +235 -0
  152. package/dist/api/curve-sketch/index.d.ts.map +1 -0
  153. package/dist/api/curve-sketch/index.js +493 -0
  154. package/dist/api/curve-sketch/index.js.map +1 -0
  155. package/dist/api/draft.d.ts.map +1 -1
  156. package/dist/api/draft.js +1 -3
  157. package/dist/api/draft.js.map +1 -1
  158. package/dist/api/engrave.d.ts.map +1 -1
  159. package/dist/api/engrave.js +6 -15
  160. package/dist/api/engrave.js.map +1 -1
  161. package/dist/api/export-3mf.d.ts +73 -0
  162. package/dist/api/export-3mf.d.ts.map +1 -0
  163. package/dist/api/export-3mf.js +121 -0
  164. package/dist/api/export-3mf.js.map +1 -0
  165. package/dist/api/export-brep.d.ts +47 -0
  166. package/dist/api/export-brep.d.ts.map +1 -0
  167. package/dist/api/export-brep.js +67 -0
  168. package/dist/api/export-brep.js.map +1 -0
  169. package/dist/api/export-step.d.ts +67 -0
  170. package/dist/api/export-step.d.ts.map +1 -0
  171. package/dist/api/export-step.js +98 -0
  172. package/dist/api/export-step.js.map +1 -0
  173. package/dist/api/export-stl.d.ts +58 -0
  174. package/dist/api/export-stl.d.ts.map +1 -0
  175. package/dist/api/export-stl.js +114 -0
  176. package/dist/api/export-stl.js.map +1 -0
  177. package/dist/api/extrude.d.ts +8 -11
  178. package/dist/api/extrude.d.ts.map +1 -1
  179. package/dist/api/extrude.js +11 -14
  180. package/dist/api/extrude.js.map +1 -1
  181. package/dist/api/feature-repair.d.ts +1 -1
  182. package/dist/api/feature-repair.d.ts.map +1 -1
  183. package/dist/api/feature-repair.js +1 -7
  184. package/dist/api/feature-repair.js.map +1 -1
  185. package/dist/api/fillet-variable.d.ts +2 -2
  186. package/dist/api/fillet-variable.d.ts.map +1 -1
  187. package/dist/api/fillet-variable.js +2 -3
  188. package/dist/api/fillet-variable.js.map +1 -1
  189. package/dist/api/fillet.d.ts +5 -7
  190. package/dist/api/fillet.d.ts.map +1 -1
  191. package/dist/api/fillet.js +5 -8
  192. package/dist/api/fillet.js.map +1 -1
  193. package/dist/api/generated/2d.d.ts +4 -0
  194. package/dist/api/generated/2d.d.ts.map +1 -1
  195. package/dist/api/generated/2d.js +4 -0
  196. package/dist/api/generated/2d.js.map +1 -1
  197. package/dist/api/generated/core.d.ts +4 -0
  198. package/dist/api/generated/core.d.ts.map +1 -1
  199. package/dist/api/generated/core.js +4 -0
  200. package/dist/api/generated/core.js.map +1 -1
  201. package/dist/api/generated/gear.d.ts +4 -0
  202. package/dist/api/generated/gear.d.ts.map +1 -1
  203. package/dist/api/generated/gear.js +4 -0
  204. package/dist/api/generated/gear.js.map +1 -1
  205. package/dist/api/generated/io.d.ts +4 -0
  206. package/dist/api/generated/io.d.ts.map +1 -1
  207. package/dist/api/generated/io.js +4 -0
  208. package/dist/api/generated/io.js.map +1 -1
  209. package/dist/api/generated/kernel.d.ts +4 -0
  210. package/dist/api/generated/kernel.d.ts.map +1 -1
  211. package/dist/api/generated/kernel.js +4 -0
  212. package/dist/api/generated/kernel.js.map +1 -1
  213. package/dist/api/generated/measurement.d.ts +21 -21
  214. package/dist/api/generated/measurement.d.ts.map +1 -1
  215. package/dist/api/generated/measurement.js +25 -21
  216. package/dist/api/generated/measurement.js.map +1 -1
  217. package/dist/api/generated/ns.d.ts +4 -0
  218. package/dist/api/generated/ns.d.ts.map +1 -1
  219. package/dist/api/generated/ns.js +4 -0
  220. package/dist/api/generated/ns.js.map +1 -1
  221. package/dist/api/generated/operations.d.ts +32 -32
  222. package/dist/api/generated/operations.d.ts.map +1 -1
  223. package/dist/api/generated/operations.js +58 -54
  224. package/dist/api/generated/operations.js.map +1 -1
  225. package/dist/api/generated/projection.d.ts +4 -0
  226. package/dist/api/generated/projection.d.ts.map +1 -1
  227. package/dist/api/generated/projection.js +4 -0
  228. package/dist/api/generated/projection.js.map +1 -1
  229. package/dist/api/generated/query.d.ts +4 -0
  230. package/dist/api/generated/query.d.ts.map +1 -1
  231. package/dist/api/generated/query.js +4 -0
  232. package/dist/api/generated/query.js.map +1 -1
  233. package/dist/api/generated/script-face-manifest.d.ts +1 -1
  234. package/dist/api/generated/script-face-manifest.js +3 -3
  235. package/dist/api/generated/script-face-manifest.js.map +1 -1
  236. package/dist/api/generated/script-face.d.ts +1 -1
  237. package/dist/api/generated/script-face.js +1 -1
  238. package/dist/api/generated/script-face.js.map +1 -1
  239. package/dist/api/generated/sketching.d.ts +2 -2
  240. package/dist/api/generated/sketching.d.ts.map +1 -1
  241. package/dist/api/generated/sketching.js +8 -4
  242. package/dist/api/generated/sketching.js.map +1 -1
  243. package/dist/api/generated/text.d.ts +4 -0
  244. package/dist/api/generated/text.d.ts.map +1 -1
  245. package/dist/api/generated/text.js +4 -0
  246. package/dist/api/generated/text.js.map +1 -1
  247. package/dist/api/generated/topology.d.ts +45 -45
  248. package/dist/api/generated/topology.d.ts.map +1 -1
  249. package/dist/api/generated/topology.js +77 -73
  250. package/dist/api/generated/topology.js.map +1 -1
  251. package/dist/api/generated/view.d.ts +4 -0
  252. package/dist/api/generated/view.d.ts.map +1 -1
  253. package/dist/api/generated/view.js +4 -0
  254. package/dist/api/generated/view.js.map +1 -1
  255. package/dist/api/geom-types/constants.d.ts +11 -0
  256. package/dist/api/geom-types/constants.d.ts.map +1 -0
  257. package/dist/api/geom-types/constants.js +11 -0
  258. package/dist/api/geom-types/constants.js.map +1 -0
  259. package/dist/api/geom-types/index.d.ts +21 -0
  260. package/dist/api/geom-types/index.d.ts.map +1 -0
  261. package/dist/api/geom-types/index.js +22 -0
  262. package/dist/api/geom-types/index.js.map +1 -0
  263. package/dist/api/geom-types/planeOps.d.ts +98 -0
  264. package/dist/api/geom-types/planeOps.d.ts.map +1 -0
  265. package/dist/api/geom-types/planeOps.js +170 -0
  266. package/dist/api/geom-types/planeOps.js.map +1 -0
  267. package/dist/api/geom-types/planeTypes.d.ts +24 -0
  268. package/dist/api/geom-types/planeTypes.d.ts.map +1 -0
  269. package/dist/api/geom-types/planeTypes.js +8 -0
  270. package/dist/api/geom-types/planeTypes.js.map +1 -0
  271. package/dist/api/geom-types/types.d.ts +64 -0
  272. package/dist/api/geom-types/types.d.ts.map +1 -0
  273. package/dist/api/geom-types/types.js +48 -0
  274. package/dist/api/geom-types/types.js.map +1 -0
  275. package/dist/api/geom-types/vecOps.d.ts +124 -0
  276. package/dist/api/geom-types/vecOps.d.ts.map +1 -0
  277. package/dist/api/geom-types/vecOps.js +202 -0
  278. package/dist/api/geom-types/vecOps.js.map +1 -0
  279. package/dist/api/geom.d.ts.map +1 -1
  280. package/dist/api/geom.js +6 -5
  281. package/dist/api/geom.js.map +1 -1
  282. package/dist/api/half-space.d.ts +56 -0
  283. package/dist/api/half-space.d.ts.map +1 -0
  284. package/dist/api/half-space.js +82 -0
  285. package/dist/api/half-space.js.map +1 -0
  286. package/dist/api/helix.d.ts +11 -2
  287. package/dist/api/helix.d.ts.map +1 -1
  288. package/dist/api/helix.js +20 -4
  289. package/dist/api/helix.js.map +1 -1
  290. package/dist/api/index.d.ts +19 -7
  291. package/dist/api/index.d.ts.map +1 -1
  292. package/dist/api/index.js +44 -11
  293. package/dist/api/index.js.map +1 -1
  294. package/dist/api/internal/compat-op.d.ts +10 -36
  295. package/dist/api/internal/compat-op.d.ts.map +1 -1
  296. package/dist/api/internal/compat-op.js +17 -51
  297. package/dist/api/internal/compat-op.js.map +1 -1
  298. package/dist/api/internal/compat-projection.d.ts +5 -5
  299. package/dist/api/internal/compat-projection.js +5 -5
  300. package/dist/api/internal/compat-projection.js.map +1 -1
  301. package/dist/api/internal/dual-form-args.d.ts +0 -2
  302. package/dist/api/internal/dual-form-args.d.ts.map +1 -1
  303. package/dist/api/internal/dual-form-args.js +1 -3
  304. package/dist/api/internal/dual-form-args.js.map +1 -1
  305. package/dist/api/internal/export-members.d.ts +80 -0
  306. package/dist/api/internal/export-members.d.ts.map +1 -0
  307. package/dist/api/internal/export-members.js +104 -0
  308. package/dist/api/internal/export-members.js.map +1 -0
  309. package/dist/api/internal/l3-bridge.d.ts +22 -37
  310. package/dist/api/internal/l3-bridge.d.ts.map +1 -1
  311. package/dist/api/internal/l3-bridge.js +30 -77
  312. package/dist/api/internal/l3-bridge.js.map +1 -1
  313. package/dist/api/internal/profile-wire.d.ts +1 -1
  314. package/dist/api/internal/profile-wire.js +1 -1
  315. package/dist/api/internal/profile-wire.js.map +1 -1
  316. package/dist/api/internal/result-unwrap.d.ts +4 -6
  317. package/dist/api/internal/result-unwrap.d.ts.map +1 -1
  318. package/dist/api/internal/result-unwrap.js +4 -6
  319. package/dist/api/internal/result-unwrap.js.map +1 -1
  320. package/dist/api/knurl.d.ts.map +1 -1
  321. package/dist/api/knurl.js +5 -3
  322. package/dist/api/knurl.js.map +1 -1
  323. package/dist/api/loft.d.ts +2 -2
  324. package/dist/api/loft.d.ts.map +1 -1
  325. package/dist/api/loft.js +2 -2
  326. package/dist/api/loft.js.map +1 -1
  327. package/dist/api/measure-query/index.d.ts +262 -0
  328. package/dist/api/measure-query/index.d.ts.map +1 -0
  329. package/dist/api/measure-query/index.js +390 -0
  330. package/dist/api/measure-query/index.js.map +1 -0
  331. package/dist/api/measurement/index.d.ts +3 -3
  332. package/dist/api/measurement/index.js +3 -3
  333. package/dist/api/measurement/index.js.map +1 -1
  334. package/dist/api/meta.d.ts +0 -2
  335. package/dist/api/meta.d.ts.map +1 -1
  336. package/dist/api/meta.js +0 -2
  337. package/dist/api/meta.js.map +1 -1
  338. package/dist/api/offset2d.d.ts +49 -0
  339. package/dist/api/offset2d.d.ts.map +1 -0
  340. package/dist/api/offset2d.js +86 -0
  341. package/dist/api/offset2d.js.map +1 -0
  342. package/dist/api/pattern.d.ts.map +1 -1
  343. package/dist/api/pattern.js +3 -6
  344. package/dist/api/pattern.js.map +1 -1
  345. package/dist/api/primitives.d.ts +6 -6
  346. package/dist/api/primitives.d.ts.map +1 -1
  347. package/dist/api/primitives.js +19 -17
  348. package/dist/api/primitives.js.map +1 -1
  349. package/dist/api/profile.d.ts.map +1 -1
  350. package/dist/api/profile.js +0 -1
  351. package/dist/api/profile.js.map +1 -1
  352. package/dist/api/punch-hole.d.ts.map +1 -1
  353. package/dist/api/punch-hole.js +0 -1
  354. package/dist/api/punch-hole.js.map +1 -1
  355. package/dist/api/replicate.d.ts +6 -8
  356. package/dist/api/replicate.d.ts.map +1 -1
  357. package/dist/api/replicate.js +27 -65
  358. package/dist/api/replicate.js.map +1 -1
  359. package/dist/api/result.d.ts +1 -1
  360. package/dist/api/result.js +1 -1
  361. package/dist/api/result.js.map +1 -1
  362. package/dist/api/revolve.d.ts +2 -2
  363. package/dist/api/revolve.js +3 -3
  364. package/dist/api/revolve.js.map +1 -1
  365. package/dist/api/screw.d.ts +1 -1
  366. package/dist/api/screw.d.ts.map +1 -1
  367. package/dist/api/screw.js +5 -4
  368. package/dist/api/screw.js.map +1 -1
  369. package/dist/api/sdf.d.ts.map +1 -1
  370. package/dist/api/sdf.js +3 -2
  371. package/dist/api/sdf.js.map +1 -1
  372. package/dist/api/section-by-plane.d.ts.map +1 -1
  373. package/dist/api/section-by-plane.js +0 -1
  374. package/dist/api/section-by-plane.js.map +1 -1
  375. package/dist/api/shape-type/index.d.ts +141 -0
  376. package/dist/api/shape-type/index.d.ts.map +1 -0
  377. package/dist/api/shape-type/index.js +182 -0
  378. package/dist/api/shape-type/index.js.map +1 -0
  379. package/dist/api/shell.d.ts +2 -2
  380. package/dist/api/shell.d.ts.map +1 -1
  381. package/dist/api/shell.js +12 -3
  382. package/dist/api/shell.js.map +1 -1
  383. package/dist/api/sketch-on-face.d.ts +3 -3
  384. package/dist/api/sketch-on-face.d.ts.map +1 -1
  385. package/dist/api/sketch-on-face.js +6 -4
  386. package/dist/api/sketch-on-face.js.map +1 -1
  387. package/dist/api/sketch-on-plane.d.ts.map +1 -1
  388. package/dist/api/sketch-on-plane.js +0 -1
  389. package/dist/api/sketch-on-plane.js.map +1 -1
  390. package/dist/api/solid-from-faces.d.ts +45 -0
  391. package/dist/api/solid-from-faces.d.ts.map +1 -0
  392. package/dist/api/solid-from-faces.js +72 -0
  393. package/dist/api/solid-from-faces.js.map +1 -0
  394. package/dist/api/solid-offset/index.d.ts +67 -0
  395. package/dist/api/solid-offset/index.d.ts.map +1 -0
  396. package/dist/api/solid-offset/index.js +132 -0
  397. package/dist/api/solid-offset/index.js.map +1 -0
  398. package/dist/api/split-by-plane.d.ts.map +1 -1
  399. package/dist/api/split-by-plane.js +0 -1
  400. package/dist/api/split-by-plane.js.map +1 -1
  401. package/dist/api/split.d.ts +1 -1
  402. package/dist/api/split.js +1 -1
  403. package/dist/api/split.js.map +1 -1
  404. package/dist/api/surface/arg-spec.d.ts +37 -44
  405. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  406. package/dist/api/surface/arg-spec.js +224 -233
  407. package/dist/api/surface/arg-spec.js.map +1 -1
  408. package/dist/api/surface-face/index.d.ts +104 -0
  409. package/dist/api/surface-face/index.d.ts.map +1 -0
  410. package/dist/api/surface-face/index.js +217 -0
  411. package/dist/api/surface-face/index.js.map +1 -0
  412. package/dist/api/surface.d.ts +44 -0
  413. package/dist/api/surface.d.ts.map +1 -0
  414. package/dist/api/surface.js +66 -0
  415. package/dist/api/surface.js.map +1 -0
  416. package/dist/api/sweep.d.ts +71 -9
  417. package/dist/api/sweep.d.ts.map +1 -1
  418. package/dist/api/sweep.js +13 -6
  419. package/dist/api/sweep.js.map +1 -1
  420. package/dist/api/thicken.d.ts +1 -1
  421. package/dist/api/thicken.d.ts.map +1 -1
  422. package/dist/api/thicken.js +12 -3
  423. package/dist/api/thicken.js.map +1 -1
  424. package/dist/api/transform.d.ts +8 -8
  425. package/dist/api/transform.d.ts.map +1 -1
  426. package/dist/api/transform.js +58 -27
  427. package/dist/api/transform.js.map +1 -1
  428. package/dist/api/view/cameraFns.d.ts +1 -1
  429. package/dist/api/view/cameraFns.d.ts.map +1 -1
  430. package/dist/api/view/cameraFns.js +1 -1
  431. package/dist/api/view/cameraFns.js.map +1 -1
  432. package/dist/api/view/index.d.ts +0 -2
  433. package/dist/api/view/index.d.ts.map +1 -1
  434. package/dist/api/view/index.js +0 -2
  435. package/dist/api/view/index.js.map +1 -1
  436. package/dist/api/view/projectionPlanes.d.ts +1 -1
  437. package/dist/api/view/projectionPlanes.d.ts.map +1 -1
  438. package/dist/api/view/projectionPlanes.js.map +1 -1
  439. package/dist/api/view/view-camera.d.ts +7 -9
  440. package/dist/api/view/view-camera.d.ts.map +1 -1
  441. package/dist/api/view/view-camera.js +4 -6
  442. package/dist/api/view/view-camera.js.map +1 -1
  443. package/dist/api/view/view-projection.d.ts +0 -2
  444. package/dist/api/view/view-projection.d.ts.map +1 -1
  445. package/dist/api/view/view-projection.js +0 -2
  446. package/dist/api/view/view-projection.js.map +1 -1
  447. package/dist/api/view/view-sheet.d.ts +0 -2
  448. package/dist/api/view/view-sheet.d.ts.map +1 -1
  449. package/dist/api/view/view-sheet.js +0 -2
  450. package/dist/api/view/view-sheet.js.map +1 -1
  451. package/dist/api/view-export/index.d.ts +97 -0
  452. package/dist/api/view-export/index.d.ts.map +1 -0
  453. package/dist/api/view-export/index.js +118 -0
  454. package/dist/api/view-export/index.js.map +1 -0
  455. package/dist/boolean/index.d.ts +23 -0
  456. package/dist/boolean/index.d.ts.map +1 -0
  457. package/dist/boolean/index.js +27 -0
  458. package/dist/boolean/index.js.map +1 -0
  459. package/dist/brep/brep-chain.d.ts +1 -19
  460. package/dist/brep/brep-chain.d.ts.map +1 -1
  461. package/dist/brep/brep-chain.js +0 -1
  462. package/dist/brep/brep-chain.js.map +1 -1
  463. package/dist/brep/brep-ops.d.ts +93 -2
  464. package/dist/brep/brep-ops.d.ts.map +1 -1
  465. package/dist/brep/brep-ops.js +185 -15
  466. package/dist/brep/brep-ops.js.map +1 -1
  467. package/dist/brep/brep-topology.d.ts +20 -0
  468. package/dist/brep/brep-topology.d.ts.map +1 -1
  469. package/dist/brep/brep-topology.js +46 -0
  470. package/dist/brep/brep-topology.js.map +1 -1
  471. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  472. package/dist/brep/engine/adapters/brep-mock.js +0 -3
  473. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  474. package/dist/brep/engine/adapters/brepkit.d.ts +4 -3
  475. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  476. package/dist/brep/engine/adapters/brepkit.js +4 -98
  477. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  478. package/dist/brep/engine/adapters/occt.d.ts +1 -1
  479. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  480. package/dist/brep/engine/adapters/occt.js +4 -148
  481. package/dist/brep/engine/adapters/occt.js.map +1 -1
  482. package/dist/brep/engine/native-history.d.ts +27 -0
  483. package/dist/brep/engine/native-history.d.ts.map +1 -0
  484. package/dist/brep/engine/native-history.js +54 -0
  485. package/dist/brep/engine/native-history.js.map +1 -0
  486. package/dist/brep/engine/primitives.d.ts +2 -3
  487. package/dist/brep/engine/primitives.d.ts.map +1 -1
  488. package/dist/brep/engine/primitives.js +1 -2
  489. package/dist/brep/engine/primitives.js.map +1 -1
  490. package/dist/brep/engine/registry.d.ts +3 -5
  491. package/dist/brep/engine/registry.d.ts.map +1 -1
  492. package/dist/brep/engine/registry.js +2 -2
  493. package/dist/brep/engine/registry.js.map +1 -1
  494. package/dist/brep/engine/types.d.ts +35 -77
  495. package/dist/brep/engine/types.d.ts.map +1 -1
  496. package/dist/brep/engine/types.js.map +1 -1
  497. package/dist/brep/export/export-model.d.ts +21 -0
  498. package/dist/brep/export/export-model.d.ts.map +1 -1
  499. package/dist/brep/export/export-model.js +171 -73
  500. package/dist/brep/export/export-model.js.map +1 -1
  501. package/dist/brep/export/step.d.ts +17 -1
  502. package/dist/brep/export/step.d.ts.map +1 -1
  503. package/dist/brep/export/step.js +133 -0
  504. package/dist/brep/export/step.js.map +1 -1
  505. package/dist/brep/export/stl.d.ts +22 -1
  506. package/dist/brep/export/stl.d.ts.map +1 -1
  507. package/dist/brep/export/stl.js +58 -10
  508. package/dist/brep/export/stl.js.map +1 -1
  509. package/dist/brep/export/transform12.d.ts +47 -0
  510. package/dist/brep/export/transform12.d.ts.map +1 -0
  511. package/dist/brep/export/transform12.js +87 -0
  512. package/dist/brep/export/transform12.js.map +1 -0
  513. package/dist/brep/face-evolution.d.ts +53 -0
  514. package/dist/brep/face-evolution.d.ts.map +1 -1
  515. package/dist/brep/face-evolution.js +65 -0
  516. package/dist/brep/face-evolution.js.map +1 -1
  517. package/dist/brep/handle-bridge.d.ts +2 -2
  518. package/dist/brep/handle-bridge.js +2 -2
  519. package/dist/brep/handle-bridge.js.map +1 -1
  520. package/dist/brep/index.d.ts +6 -3
  521. package/dist/brep/index.d.ts.map +1 -1
  522. package/dist/brep/index.js +6 -3
  523. package/dist/brep/index.js.map +1 -1
  524. package/dist/brepkit-kernel/brepkitKernel.d.ts +1 -1
  525. package/dist/brepkit-kernel/brepkitKernel.js +2 -2
  526. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  527. package/dist/browser-host/index.d.ts +4 -1
  528. package/dist/browser-host/index.d.ts.map +1 -1
  529. package/dist/browser-host/index.js +7 -1
  530. package/dist/browser-host/index.js.map +1 -1
  531. package/dist/browser.d.ts +5 -9
  532. package/dist/browser.d.ts.map +1 -1
  533. package/dist/browser.js +5 -26
  534. package/dist/browser.js.map +1 -1
  535. package/dist/cad-runtime/admit-compat-lib.d.ts +3 -10
  536. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  537. package/dist/cad-runtime/admit-compat-lib.js +3 -9
  538. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  539. package/dist/cad-runtime/backend-dispatch.d.ts +13 -58
  540. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  541. package/dist/cad-runtime/backend-dispatch.js +34 -83
  542. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  543. package/dist/cad-runtime/content-key.d.ts +3 -3
  544. package/dist/cad-runtime/content-key.js +3 -3
  545. package/dist/cad-runtime/content-key.js.map +1 -1
  546. package/dist/cad-runtime/direct-executor.d.ts +6 -3
  547. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  548. package/dist/cad-runtime/direct-executor.js +31 -9
  549. package/dist/cad-runtime/direct-executor.js.map +1 -1
  550. package/dist/cad-runtime/interp/env.d.ts +1 -1
  551. package/dist/cad-runtime/interp/env.js.map +1 -1
  552. package/dist/cad-runtime/lib-id.d.ts +0 -2
  553. package/dist/cad-runtime/lib-id.d.ts.map +1 -1
  554. package/dist/cad-runtime/lib-id.js +0 -2
  555. package/dist/cad-runtime/lib-id.js.map +1 -1
  556. package/dist/cad-runtime/live-shapes.d.ts +3 -5
  557. package/dist/cad-runtime/live-shapes.d.ts.map +1 -1
  558. package/dist/cad-runtime/live-shapes.js +8 -10
  559. package/dist/cad-runtime/live-shapes.js.map +1 -1
  560. package/dist/cad-runtime/ports.d.ts +31 -3
  561. package/dist/cad-runtime/ports.d.ts.map +1 -1
  562. package/dist/cad-runtime/ports.js.map +1 -1
  563. package/dist/cad-runtime/runtime.d.ts +54 -19
  564. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  565. package/dist/cad-runtime/runtime.js +89 -54
  566. package/dist/cad-runtime/runtime.js.map +1 -1
  567. package/dist/define-op.d.ts +10 -14
  568. package/dist/define-op.d.ts.map +1 -1
  569. package/dist/define-op.js +5 -22
  570. package/dist/define-op.js.map +1 -1
  571. package/dist/env-agnostic.d.ts +2 -2
  572. package/dist/env-agnostic.d.ts.map +1 -1
  573. package/dist/env-agnostic.js +1 -1
  574. package/dist/env-agnostic.js.map +1 -1
  575. package/dist/geometry2d/bridge/plane.d.ts +1 -1
  576. package/dist/geometry2d/bridge/plane.js +1 -1
  577. package/dist/geometry2d/bridge/plane.js.map +1 -1
  578. package/dist/geometry2d/curve2d.d.ts +1 -1
  579. package/dist/geometry2d/curve2d.js +1 -1
  580. package/dist/geometry2d/curve2d.js.map +1 -1
  581. package/dist/index.d.ts +14 -65
  582. package/dist/index.d.ts.map +1 -1
  583. package/dist/index.js +18 -70
  584. package/dist/index.js.map +1 -1
  585. package/dist/io/fai-zip/container-read.d.ts +16 -0
  586. package/dist/io/fai-zip/container-read.d.ts.map +1 -1
  587. package/dist/io/fai-zip/container-read.js +22 -0
  588. package/dist/io/fai-zip/container-read.js.map +1 -1
  589. package/dist/io/fai-zip/index.d.ts +1 -1
  590. package/dist/io/fai-zip/index.d.ts.map +1 -1
  591. package/dist/io/fai-zip/index.js +1 -1
  592. package/dist/io/fai-zip/index.js.map +1 -1
  593. package/dist/lang/code-to-args.d.ts.map +1 -1
  594. package/dist/lang/code-to-args.js +10 -1
  595. package/dist/lang/code-to-args.js.map +1 -1
  596. package/dist/lang/determinism-scanner.d.ts.map +1 -1
  597. package/dist/lang/determinism-scanner.js +22 -9
  598. package/dist/lang/determinism-scanner.js.map +1 -1
  599. package/dist/lang/metadata-extractor.d.ts +27 -6
  600. package/dist/lang/metadata-extractor.d.ts.map +1 -1
  601. package/dist/lang/metadata-extractor.js +88 -8
  602. package/dist/lang/metadata-extractor.js.map +1 -1
  603. package/dist/lang/parse-error.d.ts +4 -0
  604. package/dist/lang/parse-error.d.ts.map +1 -1
  605. package/dist/lang/parse-error.js.map +1 -1
  606. package/dist/lang/security-scanner.d.ts +27 -2
  607. package/dist/lang/security-scanner.d.ts.map +1 -1
  608. package/dist/lang/security-scanner.js +29 -2
  609. package/dist/lang/security-scanner.js.map +1 -1
  610. package/dist/lang/source-edit.d.ts +2 -2
  611. package/dist/lang/source-edit.js.map +1 -1
  612. package/dist/lang/symbol-table.generated.d.ts +53 -0
  613. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  614. package/dist/lang/symbol-table.generated.js +53 -0
  615. package/dist/lang/symbol-table.generated.js.map +1 -1
  616. package/dist/mesh/import-model.d.ts +94 -0
  617. package/dist/mesh/import-model.d.ts.map +1 -0
  618. package/dist/mesh/import-model.js +15 -0
  619. package/dist/mesh/import-model.js.map +1 -0
  620. package/dist/mesh/index.d.ts +19 -63
  621. package/dist/mesh/index.d.ts.map +1 -1
  622. package/dist/mesh/index.js +19 -72
  623. package/dist/mesh/index.js.map +1 -1
  624. package/dist/mesh/io.d.ts +62 -17
  625. package/dist/mesh/io.d.ts.map +1 -1
  626. package/dist/mesh/io.js +210 -41
  627. package/dist/mesh/io.js.map +1 -1
  628. package/dist/mesh/primitives.js +1 -1
  629. package/dist/mesh/primitives.js.map +1 -1
  630. package/dist/mesh/threemf-bambu.d.ts +12 -1
  631. package/dist/mesh/threemf-bambu.d.ts.map +1 -1
  632. package/dist/mesh/threemf-bambu.js +68 -16
  633. package/dist/mesh/threemf-bambu.js.map +1 -1
  634. package/dist/mesh/threemf-loader.d.ts +52 -5
  635. package/dist/mesh/threemf-loader.d.ts.map +1 -1
  636. package/dist/mesh/threemf-loader.js +139 -41
  637. package/dist/mesh/threemf-loader.js.map +1 -1
  638. package/dist/mesh/transform.d.ts +1 -1
  639. package/dist/mesh/transform.js +1 -1
  640. package/dist/mesh/transform.js.map +1 -1
  641. package/dist/mesh/types.d.ts +35 -5
  642. package/dist/mesh/types.d.ts.map +1 -1
  643. package/dist/mesh/types.js.map +1 -1
  644. package/dist/node-host/cli.d.ts +49 -1
  645. package/dist/node-host/cli.d.ts.map +1 -1
  646. package/dist/node-host/cli.js +125 -19
  647. package/dist/node-host/cli.js.map +1 -1
  648. package/dist/node-host/execute-script.d.ts +56 -0
  649. package/dist/node-host/execute-script.d.ts.map +1 -0
  650. package/dist/node-host/execute-script.js +47 -0
  651. package/dist/node-host/execute-script.js.map +1 -0
  652. package/dist/node-host/index.d.ts +1 -0
  653. package/dist/node-host/index.d.ts.map +1 -1
  654. package/dist/node-host/index.js +4 -0
  655. package/dist/node-host/index.js.map +1 -1
  656. package/dist/node.d.ts +2 -0
  657. package/dist/node.d.ts.map +1 -1
  658. package/dist/node.js +3 -0
  659. package/dist/node.js.map +1 -1
  660. package/dist/occt-kernel/generated/occtPlatform.generated.d.ts +260 -0
  661. package/dist/occt-kernel/generated/occtPlatform.generated.d.ts.map +1 -0
  662. package/dist/occt-kernel/generated/occtPlatform.generated.js +875 -0
  663. package/dist/occt-kernel/generated/occtPlatform.generated.js.map +1 -0
  664. package/dist/occt-kernel/hullGeometry.d.ts +2 -2
  665. package/dist/occt-kernel/hullGeometry.js +2 -3
  666. package/dist/occt-kernel/hullGeometry.js.map +1 -1
  667. package/dist/occt-kernel/hullOps.d.ts +3 -3
  668. package/dist/occt-kernel/hullOps.js +4 -4
  669. package/dist/occt-kernel/hullOps.js.map +1 -1
  670. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -1
  671. package/dist/occt-kernel/occt-primitives.js +31 -4
  672. package/dist/occt-kernel/occt-primitives.js.map +1 -1
  673. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  674. package/dist/occt-kernel/occtKernel.js +18 -0
  675. package/dist/occt-kernel/occtKernel.js.map +1 -1
  676. package/dist/occt-scan/recognize.d.ts +58 -0
  677. package/dist/occt-scan/recognize.d.ts.map +1 -0
  678. package/dist/occt-scan/recognize.js +216 -0
  679. package/dist/occt-scan/recognize.js.map +1 -0
  680. package/dist/primitives/brep-primitives.js +7 -7
  681. package/dist/primitives/brep-primitives.js.map +1 -1
  682. package/dist/primitives/index.d.ts +19 -0
  683. package/dist/primitives/index.d.ts.map +1 -0
  684. package/dist/primitives/index.js +21 -0
  685. package/dist/primitives/index.js.map +1 -0
  686. package/dist/result/bug.d.ts +1 -1
  687. package/dist/result/bug.js +1 -1
  688. package/dist/result/bug.js.map +1 -1
  689. package/dist/result/errors.d.ts +2 -2
  690. package/dist/result/errors.d.ts.map +1 -1
  691. package/dist/result/errors.js +1 -1
  692. package/dist/result/errors.js.map +1 -1
  693. package/dist/result/vec3.d.ts +1 -1
  694. package/dist/result/vec3.js +1 -1
  695. package/dist/result/vec3.js.map +1 -1
  696. package/dist/runtime-state.d.ts +79 -29
  697. package/dist/runtime-state.d.ts.map +1 -1
  698. package/dist/runtime-state.js +84 -0
  699. package/dist/runtime-state.js.map +1 -1
  700. package/dist/script-globals.d.ts +24 -0
  701. package/dist/script-globals.d.ts.map +1 -0
  702. package/dist/script-globals.js +24 -0
  703. package/dist/script-globals.js.map +1 -0
  704. package/dist/sdf/index.d.ts +12 -0
  705. package/dist/sdf/index.d.ts.map +1 -0
  706. package/dist/sdf/index.js +13 -0
  707. package/dist/sdf/index.js.map +1 -0
  708. package/dist/sdk.d.ts +0 -1
  709. package/dist/sdk.d.ts.map +1 -1
  710. package/dist/sdk.js.map +1 -1
  711. package/dist/shape.d.ts +24 -0
  712. package/dist/shape.d.ts.map +1 -1
  713. package/dist/shape.js +40 -0
  714. package/dist/shape.js.map +1 -1
  715. package/dist/topology/naming/lineage.d.ts +3 -2
  716. package/dist/topology/naming/lineage.d.ts.map +1 -1
  717. package/dist/topology/naming/lineage.js.map +1 -1
  718. package/dist/weapp.d.ts +3 -3
  719. package/dist/weapp.d.ts.map +1 -1
  720. package/dist/weapp.js +2 -2
  721. package/dist/weapp.js.map +1 -1
  722. package/package.json +283 -44
@@ -10,7 +10,7 @@
10
10
  * faijs Shapes (or raw handles) and results are returned as BREP handles
11
11
  * (wrapped by `wrapBrepOne` → `fromHandle`).
12
12
  *
13
- * Semantics mirror the vendored brepjs fns (`topology/transformFns.ts`,
13
+ * Semantics mirror the early brepjs fns (`topology/transformFns.ts`,
14
14
  * `topology/shapeFns.ts`) with the brepjs object model (castResultShape,
15
15
  * metadata propagation, evolution tracking) dropped: occt-wasm handles only.
16
16
  */
@@ -19,7 +19,7 @@ import { type Result } from '../../result/result.js';
19
19
  /**
20
20
  * Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).
21
21
  *
22
- * The vendored fn splits orthogonal (evolution-tracked) and non-orthogonal
22
+ * The brepjs fn splits orthogonal (evolution-tracked) and non-orthogonal
23
23
  * (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`
24
24
  * (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since
25
25
  * `applyMatrix` carries identity naming and needs no face evolution.
@@ -51,21 +51,21 @@ export declare function locateBrep(...args: unknown[]): Result<BrepHandle>;
51
51
  */
52
52
  export declare function mirrorBrep(...args: unknown[]): Result<BrepHandle>;
53
53
  /**
54
- * Rotate the shape around an axis (vendored topology/api.js#rotate + transformFns.ts#rotate).
54
+ * Rotate the shape around an axis (brepjs topology/api.js#rotate + transformFns.ts#rotate).
55
55
  *
56
56
  * @param args - Resolved arguments (shape, angle in degrees, axis options).
57
57
  * @returns The rotated shape as a `BrepHandle`.
58
58
  */
59
59
  export declare function rotateBrep(...args: unknown[]): Result<BrepHandle>;
60
60
  /**
61
- * Shell — hollow the shape by removing faces (vendored topology/api.js#shell + modifierFns.ts#shell).
61
+ * Shell — hollow the shape by removing faces (brepjs topology/api.js#shell + modifierFns.ts#shell).
62
62
  *
63
63
  * @param args - Resolved arguments (shape, faces, thickness, options).
64
64
  * @returns The shelled (hollowed) shape as a `BrepHandle`.
65
65
  */
66
66
  export declare function shellBrep(...args: unknown[]): Result<BrepHandle>;
67
67
  /**
68
- * Offset all faces of the shape (vendored topology/api.js#offset + modifierFns.ts#offset).
68
+ * Offset all faces of the shape (brepjs topology/api.js#offset + modifierFns.ts#offset).
69
69
  *
70
70
  * @param args - Resolved arguments (shape, distance, options).
71
71
  * @returns The offset shape as a `BrepHandle`.
@@ -10,7 +10,7 @@
10
10
  * faijs Shapes (or raw handles) and results are returned as BREP handles
11
11
  * (wrapped by `wrapBrepOne` → `fromHandle`).
12
12
  *
13
- * Semantics mirror the vendored brepjs fns (`topology/transformFns.ts`,
13
+ * Semantics mirror the early brepjs fns (`topology/transformFns.ts`,
14
14
  * `topology/shapeFns.ts`) with the brepjs object model (castResultShape,
15
15
  * metadata propagation, evolution tracking) dropped: occt-wasm handles only.
16
16
  */
@@ -47,7 +47,7 @@ const APPLY_MATRIX_PARAMS = { name: 'applyMatrix', params: ['shape', 'matrix'],
47
47
  /**
48
48
  * Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).
49
49
  *
50
- * The vendored fn splits orthogonal (evolution-tracked) and non-orthogonal
50
+ * The brepjs fn splits orthogonal (evolution-tracked) and non-orthogonal
51
51
  * (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`
52
52
  * (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since
53
53
  * `applyMatrix` carries identity naming and needs no face evolution.
@@ -172,10 +172,10 @@ export function mirrorBrep(...args) {
172
172
  }
173
173
  }
174
174
  // ---------------------------------------------------------------------------
175
- // rotate — 绕轴旋转(vendored topology/api.js#rotate + transformFns.ts#rotate)// ---------------------------------------------------------------------------
175
+ // rotate — 绕轴旋转(brepjs topology/api.js#rotate + transformFns.ts#rotate)// ---------------------------------------------------------------------------
176
176
  const ROTATE_PARAMS = { name: 'rotate', params: ['shape', 'angle', 'options'], formClass: 'A' };
177
177
  /**
178
- * Rotate the shape around an axis (vendored topology/api.js#rotate + transformFns.ts#rotate).
178
+ * Rotate the shape around an axis (brepjs topology/api.js#rotate + transformFns.ts#rotate).
179
179
  *
180
180
  * @param args - Resolved arguments (shape, angle in degrees, axis options).
181
181
  * @returns The rotated shape as a `BrepHandle`.
@@ -218,10 +218,10 @@ export function rotateBrep(...args) {
218
218
  }
219
219
  }
220
220
  // ---------------------------------------------------------------------------
221
- // shell — 去面掏空(vendored topology/api.js#shell + modifierFns.ts#shell)// ---------------------------------------------------------------------------
221
+ // shell — 去面掏空(brepjs topology/api.js#shell + modifierFns.ts#shell)// ---------------------------------------------------------------------------
222
222
  const SHELL_PARAMS = { name: 'shell', params: ['shape', 'faces', 'thickness', 'options'], formClass: 'A' };
223
223
  /**
224
- * Shell — hollow the shape by removing faces (vendored topology/api.js#shell + modifierFns.ts#shell).
224
+ * Shell — hollow the shape by removing faces (brepjs topology/api.js#shell + modifierFns.ts#shell).
225
225
  *
226
226
  * @param args - Resolved arguments (shape, faces, thickness, options).
227
227
  * @returns The shelled (hollowed) shape as a `BrepHandle`.
@@ -248,10 +248,10 @@ export function shellBrep(...args) {
248
248
  }
249
249
  }
250
250
  // ---------------------------------------------------------------------------
251
- // offset — 全表面偏移(vendored topology/api.js#offset + modifierFns.ts#offset)// ---------------------------------------------------------------------------
251
+ // offset — 全表面偏移(brepjs topology/api.js#offset + modifierFns.ts#offset)// ---------------------------------------------------------------------------
252
252
  const OFFSET_PARAMS = { name: 'offset', params: ['shape', 'distance', 'options'], formClass: 'A' };
253
253
  /**
254
- * Offset all faces of the shape (vendored topology/api.js#offset + modifierFns.ts#offset).
254
+ * Offset all faces of the shape (brepjs topology/api.js#offset + modifierFns.ts#offset).
255
255
  *
256
256
  * @param args - Resolved arguments (shape, distance, options).
257
257
  * @returns The offset shape as a `BrepHandle`.
@@ -1 +1 @@
1
- {"version":3,"file":"topologyFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/topologyFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;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;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;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,IAAe;IAC3C,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;IACnE,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC,eAAe,CAAC,aAAa,EAAE,gCAAgC,CAAC,CAAC,CAAA;IAC9E,CAAC;IACD,MAAM,SAAS,GAAI,CAAC,OAAO,IAAI,EAAE,CAA4B,CAAC,SAAS,IAAI,IAAI,CAAA;IAC/E,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,aAAa,EAAE,CAAC,MAAM,CAAC,CAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;QAC1D,OAAO,EAAE,CAAC,CAA0B,CAAC,CAAA;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE,4BAA4B,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAChF,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — topology transform family\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Each export is a \"brep-shaped\" implementation consumed by the generated\n * compat-op projection (defineOp + D11 arg normalization). Inputs are the\n * normalized positional arguments of the op's params table; shapes arrive as\n * faijs Shapes (or raw handles) and results are returned as BREP handles\n * (wrapped by `wrapBrepOne` → `fromHandle`).\n *\n * Semantics mirror the vendored brepjs fns (`topology/transformFns.ts`,\n * `topology/shapeFns.ts`) with the brepjs object model (castResultShape,\n * metadata propagation, evolution tracking) dropped: occt-wasm handles only.\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 { MatrixInput, Vec3 } from '../brepjs-compat/types'\nimport { brepHandleOf, composeAffine, IDENTITY_3X4, rotationMatrix, translationMatrix } from './brepHelpers'\nimport { getOcctKernel } from '../../occt-kernel/occtKernel'\n\nconst VALIDATION_FAILED = 'VALIDATION_FAILED'\n\n// ---------------------------------------------------------------------------\n// Matrix input parsing (vendored `parseMatrixInput` / `det3x3`)\n// ---------------------------------------------------------------------------\n\ntype Linear3x3 = readonly [number, number, number, number, number, number, number, number, number]\n\nfunction parseMatrixInput(\n input: MatrixInput,\n): Result<{ linear: Linear3x3; translation: readonly [number, number, number] }> {\n if ('linear' in input) {\n return ok({ linear: input.linear, translation: input.translation })\n }\n const [r0, r1, r2, r3] = input\n const TOL = 1e-10\n if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL) {\n return err(\n validationError(\n VALIDATION_FAILED,\n `applyMatrix: invalid bottom row [${String(r3[0])}, ${String(r3[1])}, ${String(r3[2])}, ${String(r3[3])}]. Must be [0, 0, 0, 1] for an affine transform.`,\n ),\n )\n }\n return ok({\n linear: [r0[0], r0[1], r0[2], r1[0], r1[1], r1[2], r2[0], r2[1], r2[2]],\n translation: [r0[3], r1[3], r2[3]],\n })\n}\n\nfunction det3x3(m: Linear3x3): number {\n return (\n m[0] * (m[4] * m[8] - m[5] * m[7]) -\n m[1] * (m[3] * m[8] - m[5] * m[6]) +\n m[2] * (m[3] * m[7] - m[4] * m[6])\n )\n}\n\n// ---------------------------------------------------------------------------\n// applyMatrix\n// ---------------------------------------------------------------------------\n\nconst APPLY_MATRIX_PARAMS = { name: 'applyMatrix', params: ['shape', 'matrix'], formClass: 'A' as FormClass }\n\n/**\n * Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).\n *\n * The vendored fn splits orthogonal (evolution-tracked) and non-orthogonal\n * (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`\n * (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since\n * `applyMatrix` carries identity naming and needs no face evolution.\n *\n * @param args - Resolved arguments (shape, matrix).\n * @returns The transformed shape as a `BrepHandle`.\n */\nexport function applyMatrixBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, matrix] = resolveArgs(args, APPLY_MATRIX_PARAMS)\n const parsed = parseMatrixInput(matrix as MatrixInput)\n if (!parsed.ok) return parsed\n const { linear, translation } = parsed.value\n if (Math.abs(det3x3(linear)) < 1e-12) {\n return err(\n validationError(\n VALIDATION_FAILED,\n 'applyMatrix: singular matrix (determinant ≈0). Cannot apply a non-invertible transform.',\n ),\n )\n }\n const kernel = getBrepApi()\n try {\n const m12 = [\n linear[0], linear[1], linear[2], translation[0],\n linear[3], linear[4], linear[5], translation[1],\n linear[6], linear[7], linear[8], translation[2],\n ]\n // GOTCHA (2026-09-25): occt-wasm's `located`/`generalTransform` return\n // TopLoc/GTrsf-referencing handles whose STEP export crashes\n // (\"memory access out of bounds\") — only the affine `transform`\n // (BRepBuilderAPI_Transform, deep-copy) is STEP-safe. A similar\n // transform (orthogonal rows, equal lengths) is affine and goes\n // through `transform`; genuinely non-affine matrices keep the\n // generalTransform path (no current caller, pre-existing behavior).\n const lin = linear as readonly [number, number, number, number, number, number, number, number, number]\n const s0 = Math.hypot(lin[0], lin[1], lin[2])\n const s1 = Math.hypot(lin[3], lin[4], lin[5])\n const s2 = Math.hypot(lin[6], lin[7], lin[8])\n const dot01 = Math.abs(lin[0] * lin[3] + lin[1] * lin[4] + lin[2] * lin[5])\n const dot02 = Math.abs(lin[0] * lin[6] + lin[1] * lin[7] + lin[2] * lin[8])\n const dot12 = Math.abs(lin[3] * lin[6] + lin[4] * lin[7] + lin[5] * lin[8])\n const TOL = 1e-9\n const similar =\n s0 > TOL && Math.abs(s1 - s0) < TOL && Math.abs(s2 - s0) < TOL &&\n dot01 < TOL && dot02 < TOL && dot12 < TOL\n return ok(similar ? kernel.transform(brepHandleOf(shape), m12) : kernel.generalTransform(brepHandleOf(shape), m12))\n } catch (e) {\n return err(\n kernelError(\n 'APPLY_MATRIX_FAILED',\n `applyMatrix: kernel transform failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// clone\n// ---------------------------------------------------------------------------\n\nconst CLONE_PARAMS = { name: 'clone', params: ['shape'], formClass: 'A' as FormClass }\n\n/**\n * Deep-copy a shape (`kernel.copyShape`).\n *\n * @param args - Resolved arguments (shape).\n * @returns The cloned shape as a `BrepHandle`.\n */\nexport function cloneBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, CLONE_PARAMS)\n const kernel = getBrepApi()\n try {\n return ok(kernel.copyShape(brepHandleOf(shape)))\n } catch (e) {\n return err(\n kernelError(\n 'CLONE_FAILED',\n `clone: kernel copy failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// locate\n// ---------------------------------------------------------------------------\n\nconst LOCATE_PARAMS = { name: 'locate', params: ['shape', 'placement'], formClass: 'A' as FormClass }\n\ntype TransformOp =\n | { readonly type: 'translate'; readonly v: Vec3 }\n | { readonly type: 'rotate'; readonly angle: number; readonly axis?: Vec3; readonly center?: Vec3 }\n\nfunction opToMatrix(op: TransformOp): number[] {\n if (op.type === 'translate') return translationMatrix(op.v)\n const axis = op.axis ?? [0, 0, 1]\n const center = op.center ?? [0, 0, 0]\n return rotationMatrix(axis as Vec3, center as Vec3, op.angle)\n}\n\n/**\n * Placement-only rigid move (translate/rotate) via the kernel's cheap location\n * re-tag. Ops apply first-to-last (rotate then translate).\n *\n * @param args - Resolved arguments (shape, placement).\n * @returns The relocated shape as a `BrepHandle`.\n */\nexport function locateBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, placement] = resolveArgs(args, LOCATE_PARAMS)\n const ops: readonly TransformOp[] =\n placement !== null && typeof placement === 'object' && 'type' in (placement as object)\n ? [placement as TransformOp]\n : (placement as readonly TransformOp[])\n const kernel = getBrepApi()\n try {\n let acc: number[] = [...IDENTITY_3X4]\n for (const op of ops) acc = composeAffine(acc, opToMatrix(op))\n return ok(kernel.locate(brepHandleOf(shape), acc))\n } catch (e) {\n return err(\n kernelError(\n 'LOCATE_FAILED',\n `locate: kernel locate failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// mirror\n// ---------------------------------------------------------------------------\n\nconst MIRROR_PARAMS = { name: 'mirror', params: ['shape', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Mirror across a plane defined by `options.at` (origin) and `options.normal`.\n *\n * @param args - Resolved arguments (shape, mirror options).\n * @returns The mirrored shape as a `BrepHandle`.\n */\nexport function mirrorBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, MIRROR_PARAMS)\n const opts = (options ?? {}) as { normal?: Vec3; at?: Vec3 }\n const normal = opts.normal ?? [1, 0, 0]\n const at = opts.at ?? [0, 0, 0]\n const kernel = getBrepApi()\n try {\n return ok(kernel.mirror(brepHandleOf(shape), { x: at[0], y: at[1], z: at[2] }, { x: normal[0], y: normal[1], z: normal[2] }))\n } catch (e) {\n return err(\n kernelError(\n 'MIRROR_FAILED',\n `mirror: kernel mirror failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n\n// ---------------------------------------------------------------------------\n// rotate — 绕轴旋转(vendored topology/api.js#rotate + transformFns.ts#rotate)// ---------------------------------------------------------------------------\n\nconst ROTATE_PARAMS = { name: 'rotate', params: ['shape', 'angle', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Rotate the shape around an axis (vendored topology/api.js#rotate + transformFns.ts#rotate).\n *\n * @param args - Resolved arguments (shape, angle in degrees, axis options).\n * @returns The rotated shape as a `BrepHandle`.\n */\nexport function rotateBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, angle, options] = resolveArgs(args, ROTATE_PARAMS)\n const s = brepHandleOf(shape)\n const { at = [0, 0, 0], axis = [0, 0, 1] } = (options ?? {}) as { at?: Vec3; axis?: Vec3 }\n try {\n // GOTCHA (2026-09-25): occt-wasm's native `rotate` returns a handle whose\n // STEP export crashes (\"memory access out of bounds\") — same family as\n // located/generalTransform. Rotation is affine, so build the Rodrigues\n // matrix and go through the STEP-safe `transform` (BRepBuilderAPI_Transform).\n // 2026-09-26: switched from getOcctKernel().transform to the L1 getBrepApi().transform\n // so the op is engine-neutral (brepkit transform = cloneAndTransform deep-copy,\n // same STEP-safe semantics) — see brepkit-batchA-fix.\n const [ax, ay, az] = axis as readonly [number, number, number]\n const alen = Math.hypot(ax, ay, az)\n if (alen < 1e-12) {\n return err(validationError('INVALID_AXIS', `rotate: axis must be non-zero, got [${ax}, ${ay}, ${az}]`))\n }\n const nx = ax / alen, ny = ay / alen, nz = az / alen\n const theta = (Number(angle) * Math.PI) / 180\n const c = Math.cos(theta), sTheta = Math.sin(theta), t = 1 - c\n // R = cI + sK + t·(n⊗n) (Rodrigues)\n const r00 = t * nx * nx + c, r01 = t * nx * ny - nz * sTheta, r02 = t * nx * nz + ny * sTheta\n const r10 = t * nx * ny + nz * sTheta, r11 = t * ny * ny + c, r12 = t * ny * nz - nx * sTheta\n const r20 = t * nx * nz - ny * sTheta, r21 = t * ny * nz + nx * sTheta, r22 = t * nz * nz + c\n const [px, py, pz] = at as readonly [number, number, number]\n // Pivot-preserving translation: p' = R·(p − at) + at ⇒ tx = at − R·at\n const tx = px - (r00 * px + r01 * py + r02 * pz)\n const ty = py - (r10 * px + r11 * py + r12 * pz)\n const tz = pz - (r20 * px + r21 * py + r22 * pz)\n const m12 = [r00, r01, r02, tx, r10, r11, r12, ty, r20, r21, r22, tz]\n return ok(getBrepApi().transform(s, m12))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('ROTATE_FAILED', `Rotate operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// shell — 去面掏空(vendored topology/api.js#shell + modifierFns.ts#shell)// ---------------------------------------------------------------------------\n\nconst SHELL_PARAMS = { name: 'shell', params: ['shape', 'faces', 'thickness', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Shell — hollow the shape by removing faces (vendored topology/api.js#shell + modifierFns.ts#shell).\n *\n * @param args - Resolved arguments (shape, faces, thickness, options).\n * @returns The shelled (hollowed) shape as a `BrepHandle`.\n */\nexport function shellBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, faces, thickness, options] = resolveArgs(args, SHELL_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const t = Number(thickness)\n if (t <= 0) {\n return err(validationError('INVALID_THICKNESS', 'Shell thickness must be positive'))\n }\n if (!Array.isArray(faces) || faces.length === 0) {\n return err(validationError('NO_FACES', 'At least one face must be specified for shell'))\n }\n const faceHandles = (faces as unknown[]).map((f) => brepHandleOf(f))\n const tolerance = ((options ?? {}) as { tolerance?: number }).tolerance ?? 1e-3\n try {\n return ok(kernel.shell(s, faceHandles, t, tolerance))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('SHELL_FAILED', `Shell operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// offset — 全表面偏移(vendored topology/api.js#offset + modifierFns.ts#offset)// ---------------------------------------------------------------------------\n\nconst OFFSET_PARAMS = { name: 'offset', params: ['shape', 'distance', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Offset all faces of the shape (vendored topology/api.js#offset + modifierFns.ts#offset).\n *\n * @param args - Resolved arguments (shape, distance, options).\n * @returns The offset shape as a `BrepHandle`.\n */\nexport function offsetBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, distance, options] = resolveArgs(args, OFFSET_PARAMS)\n const s = brepHandleOf(shape)\n const d = Number(distance)\n if (Math.abs(d) < 1e-10) {\n return err(validationError('ZERO_OFFSET', 'Offset distance cannot be zero'))\n }\n const tolerance = ((options ?? {}) as { tolerance?: number }).tolerance ?? 1e-6\n try {\n const h = getOcctKernel().offset(s as never, d, tolerance)\n return ok(h as unknown as BrepHandle)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('OFFSET_FAILED', `Offset operation failed: ${raw}`, e))\n }\n}\n"]}
1
+ {"version":3,"file":"topologyFns.js","sourceRoot":"","sources":["../../../src/api/brep-mirror/topologyFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;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;AAExD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAE5D,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAQ7C,SAAS,gBAAgB,CACvB,KAAkB;IAElB,IAAI,QAAQ,IAAI,KAAK,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAA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,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,aAAa,EAAE,CAAC,MAAM,CAAC,CAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;QAC1D,OAAO,EAAE,CAAC,CAA0B,CAAC,CAAA;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACtD,OAAO,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE,4BAA4B,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAChF,CAAC;AACH,CAAC","sourcesContent":["/**\n * Self-hosted compat-op implementations — topology transform family\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Each export is a \"brep-shaped\" implementation consumed by the generated\n * compat-op projection (defineOp + D11 arg normalization). Inputs are the\n * normalized positional arguments of the op's params table; shapes arrive as\n * faijs Shapes (or raw handles) and results are returned as BREP handles\n * (wrapped by `wrapBrepOne` → `fromHandle`).\n *\n * Semantics mirror the early brepjs fns (`topology/transformFns.ts`,\n * `topology/shapeFns.ts`) with the brepjs object model (castResultShape,\n * metadata propagation, evolution tracking) dropped: occt-wasm handles only.\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 { MatrixInput, Vec3 } from '../brepjs-compat/types'\nimport { brepHandleOf, composeAffine, IDENTITY_3X4, rotationMatrix, translationMatrix } from './brepHelpers'\nimport { getOcctKernel } from '../../occt-kernel/occtKernel'\n\nconst VALIDATION_FAILED = 'VALIDATION_FAILED'\n\n// ---------------------------------------------------------------------------\n// Matrix input parsing (brepjs `parseMatrixInput` / `det3x3`)\n// ---------------------------------------------------------------------------\n\ntype Linear3x3 = readonly [number, number, number, number, number, number, number, number, number]\n\nfunction parseMatrixInput(\n input: MatrixInput,\n): Result<{ linear: Linear3x3; translation: readonly [number, number, number] }> {\n if ('linear' in input) {\n return ok({ linear: input.linear, translation: input.translation })\n }\n const [r0, r1, r2, r3] = input\n const TOL = 1e-10\n if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL) {\n return err(\n validationError(\n VALIDATION_FAILED,\n `applyMatrix: invalid bottom row [${String(r3[0])}, ${String(r3[1])}, ${String(r3[2])}, ${String(r3[3])}]. Must be [0, 0, 0, 1] for an affine transform.`,\n ),\n )\n }\n return ok({\n linear: [r0[0], r0[1], r0[2], r1[0], r1[1], r1[2], r2[0], r2[1], r2[2]],\n translation: [r0[3], r1[3], r2[3]],\n })\n}\n\nfunction det3x3(m: Linear3x3): number {\n return (\n m[0] * (m[4] * m[8] - m[5] * m[7]) -\n m[1] * (m[3] * m[8] - m[5] * m[6]) +\n m[2] * (m[3] * m[7] - m[4] * m[6])\n )\n}\n\n// ---------------------------------------------------------------------------\n// applyMatrix\n// ---------------------------------------------------------------------------\n\nconst APPLY_MATRIX_PARAMS = { name: 'applyMatrix', params: ['shape', 'matrix'], formClass: 'A' as FormClass }\n\n/**\n * Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).\n *\n * The brepjs fn splits orthogonal (evolution-tracked) and non-orthogonal\n * (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`\n * (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since\n * `applyMatrix` carries identity naming and needs no face evolution.\n *\n * @param args - Resolved arguments (shape, matrix).\n * @returns The transformed shape as a `BrepHandle`.\n */\nexport function applyMatrixBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, matrix] = resolveArgs(args, APPLY_MATRIX_PARAMS)\n const parsed = parseMatrixInput(matrix as MatrixInput)\n if (!parsed.ok) return parsed\n const { linear, translation } = parsed.value\n if (Math.abs(det3x3(linear)) < 1e-12) {\n return err(\n validationError(\n VALIDATION_FAILED,\n 'applyMatrix: singular matrix (determinant ≈0). Cannot apply a non-invertible transform.',\n ),\n )\n }\n const kernel = getBrepApi()\n try {\n const m12 = [\n linear[0], linear[1], linear[2], translation[0],\n linear[3], linear[4], linear[5], translation[1],\n linear[6], linear[7], linear[8], translation[2],\n ]\n // GOTCHA (2026-09-25): occt-wasm's `located`/`generalTransform` return\n // TopLoc/GTrsf-referencing handles whose STEP export crashes\n // (\"memory access out of bounds\") — only the affine `transform`\n // (BRepBuilderAPI_Transform, deep-copy) is STEP-safe. A similar\n // transform (orthogonal rows, equal lengths) is affine and goes\n // through `transform`; genuinely non-affine matrices keep the\n // generalTransform path (no current caller, pre-existing behavior).\n const lin = linear as readonly [number, number, number, number, number, number, number, number, number]\n const s0 = Math.hypot(lin[0], lin[1], lin[2])\n const s1 = Math.hypot(lin[3], lin[4], lin[5])\n const s2 = Math.hypot(lin[6], lin[7], lin[8])\n const dot01 = Math.abs(lin[0] * lin[3] + lin[1] * lin[4] + lin[2] * lin[5])\n const dot02 = Math.abs(lin[0] * lin[6] + lin[1] * lin[7] + lin[2] * lin[8])\n const dot12 = Math.abs(lin[3] * lin[6] + lin[4] * lin[7] + lin[5] * lin[8])\n const TOL = 1e-9\n const similar =\n s0 > TOL && Math.abs(s1 - s0) < TOL && Math.abs(s2 - s0) < TOL &&\n dot01 < TOL && dot02 < TOL && dot12 < TOL\n return ok(similar ? kernel.transform(brepHandleOf(shape), m12) : kernel.generalTransform(brepHandleOf(shape), m12))\n } catch (e) {\n return err(\n kernelError(\n 'APPLY_MATRIX_FAILED',\n `applyMatrix: kernel transform failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// clone\n// ---------------------------------------------------------------------------\n\nconst CLONE_PARAMS = { name: 'clone', params: ['shape'], formClass: 'A' as FormClass }\n\n/**\n * Deep-copy a shape (`kernel.copyShape`).\n *\n * @param args - Resolved arguments (shape).\n * @returns The cloned shape as a `BrepHandle`.\n */\nexport function cloneBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape] = resolveArgs(args, CLONE_PARAMS)\n const kernel = getBrepApi()\n try {\n return ok(kernel.copyShape(brepHandleOf(shape)))\n } catch (e) {\n return err(\n kernelError(\n 'CLONE_FAILED',\n `clone: kernel copy failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// locate\n// ---------------------------------------------------------------------------\n\nconst LOCATE_PARAMS = { name: 'locate', params: ['shape', 'placement'], formClass: 'A' as FormClass }\n\ntype TransformOp =\n | { readonly type: 'translate'; readonly v: Vec3 }\n | { readonly type: 'rotate'; readonly angle: number; readonly axis?: Vec3; readonly center?: Vec3 }\n\nfunction opToMatrix(op: TransformOp): number[] {\n if (op.type === 'translate') return translationMatrix(op.v)\n const axis = op.axis ?? [0, 0, 1]\n const center = op.center ?? [0, 0, 0]\n return rotationMatrix(axis as Vec3, center as Vec3, op.angle)\n}\n\n/**\n * Placement-only rigid move (translate/rotate) via the kernel's cheap location\n * re-tag. Ops apply first-to-last (rotate then translate).\n *\n * @param args - Resolved arguments (shape, placement).\n * @returns The relocated shape as a `BrepHandle`.\n */\nexport function locateBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, placement] = resolveArgs(args, LOCATE_PARAMS)\n const ops: readonly TransformOp[] =\n placement !== null && typeof placement === 'object' && 'type' in (placement as object)\n ? [placement as TransformOp]\n : (placement as readonly TransformOp[])\n const kernel = getBrepApi()\n try {\n let acc: number[] = [...IDENTITY_3X4]\n for (const op of ops) acc = composeAffine(acc, opToMatrix(op))\n return ok(kernel.locate(brepHandleOf(shape), acc))\n } catch (e) {\n return err(\n kernelError(\n 'LOCATE_FAILED',\n `locate: kernel locate failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n// ---------------------------------------------------------------------------\n// mirror\n// ---------------------------------------------------------------------------\n\nconst MIRROR_PARAMS = { name: 'mirror', params: ['shape', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Mirror across a plane defined by `options.at` (origin) and `options.normal`.\n *\n * @param args - Resolved arguments (shape, mirror options).\n * @returns The mirrored shape as a `BrepHandle`.\n */\nexport function mirrorBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, options] = resolveArgs(args, MIRROR_PARAMS)\n const opts = (options ?? {}) as { normal?: Vec3; at?: Vec3 }\n const normal = opts.normal ?? [1, 0, 0]\n const at = opts.at ?? [0, 0, 0]\n const kernel = getBrepApi()\n try {\n return ok(kernel.mirror(brepHandleOf(shape), { x: at[0], y: at[1], z: at[2] }, { x: normal[0], y: normal[1], z: normal[2] }))\n } catch (e) {\n return err(\n kernelError(\n 'MIRROR_FAILED',\n `mirror: kernel mirror failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n ),\n )\n }\n}\n\n\n// ---------------------------------------------------------------------------\n// rotate — 绕轴旋转(brepjs topology/api.js#rotate + transformFns.ts#rotate)// ---------------------------------------------------------------------------\n\nconst ROTATE_PARAMS = { name: 'rotate', params: ['shape', 'angle', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Rotate the shape around an axis (brepjs topology/api.js#rotate + transformFns.ts#rotate).\n *\n * @param args - Resolved arguments (shape, angle in degrees, axis options).\n * @returns The rotated shape as a `BrepHandle`.\n */\nexport function rotateBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, angle, options] = resolveArgs(args, ROTATE_PARAMS)\n const s = brepHandleOf(shape)\n const { at = [0, 0, 0], axis = [0, 0, 1] } = (options ?? {}) as { at?: Vec3; axis?: Vec3 }\n try {\n // GOTCHA (2026-09-25): occt-wasm's native `rotate` returns a handle whose\n // STEP export crashes (\"memory access out of bounds\") — same family as\n // located/generalTransform. Rotation is affine, so build the Rodrigues\n // matrix and go through the STEP-safe `transform` (BRepBuilderAPI_Transform).\n // 2026-09-26: switched from getOcctKernel().transform to the L1 getBrepApi().transform\n // so the op is engine-neutral (brepkit transform = cloneAndTransform deep-copy,\n // same STEP-safe semantics) — see brepkit-batchA-fix.\n const [ax, ay, az] = axis as readonly [number, number, number]\n const alen = Math.hypot(ax, ay, az)\n if (alen < 1e-12) {\n return err(validationError('INVALID_AXIS', `rotate: axis must be non-zero, got [${ax}, ${ay}, ${az}]`))\n }\n const nx = ax / alen, ny = ay / alen, nz = az / alen\n const theta = (Number(angle) * Math.PI) / 180\n const c = Math.cos(theta), sTheta = Math.sin(theta), t = 1 - c\n // R = cI + sK + t·(n⊗n) (Rodrigues)\n const r00 = t * nx * nx + c, r01 = t * nx * ny - nz * sTheta, r02 = t * nx * nz + ny * sTheta\n const r10 = t * nx * ny + nz * sTheta, r11 = t * ny * ny + c, r12 = t * ny * nz - nx * sTheta\n const r20 = t * nx * nz - ny * sTheta, r21 = t * ny * nz + nx * sTheta, r22 = t * nz * nz + c\n const [px, py, pz] = at as readonly [number, number, number]\n // Pivot-preserving translation: p' = R·(p − at) + at ⇒ tx = at − R·at\n const tx = px - (r00 * px + r01 * py + r02 * pz)\n const ty = py - (r10 * px + r11 * py + r12 * pz)\n const tz = pz - (r20 * px + r21 * py + r22 * pz)\n const m12 = [r00, r01, r02, tx, r10, r11, r12, ty, r20, r21, r22, tz]\n return ok(getBrepApi().transform(s, m12))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('ROTATE_FAILED', `Rotate operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// shell — 去面掏空(brepjs topology/api.js#shell + modifierFns.ts#shell)// ---------------------------------------------------------------------------\n\nconst SHELL_PARAMS = { name: 'shell', params: ['shape', 'faces', 'thickness', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Shell — hollow the shape by removing faces (brepjs topology/api.js#shell + modifierFns.ts#shell).\n *\n * @param args - Resolved arguments (shape, faces, thickness, options).\n * @returns The shelled (hollowed) shape as a `BrepHandle`.\n */\nexport function shellBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, faces, thickness, options] = resolveArgs(args, SHELL_PARAMS)\n const kernel = getBrepApi()\n const s = brepHandleOf(shape)\n const t = Number(thickness)\n if (t <= 0) {\n return err(validationError('INVALID_THICKNESS', 'Shell thickness must be positive'))\n }\n if (!Array.isArray(faces) || faces.length === 0) {\n return err(validationError('NO_FACES', 'At least one face must be specified for shell'))\n }\n const faceHandles = (faces as unknown[]).map((f) => brepHandleOf(f))\n const tolerance = ((options ?? {}) as { tolerance?: number }).tolerance ?? 1e-3\n try {\n return ok(kernel.shell(s, faceHandles, t, tolerance))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('SHELL_FAILED', `Shell operation failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// offset — 全表面偏移(brepjs topology/api.js#offset + modifierFns.ts#offset)// ---------------------------------------------------------------------------\n\nconst OFFSET_PARAMS = { name: 'offset', params: ['shape', 'distance', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Offset all faces of the shape (brepjs topology/api.js#offset + modifierFns.ts#offset).\n *\n * @param args - Resolved arguments (shape, distance, options).\n * @returns The offset shape as a `BrepHandle`.\n */\nexport function offsetBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, distance, options] = resolveArgs(args, OFFSET_PARAMS)\n const s = brepHandleOf(shape)\n const d = Number(distance)\n if (Math.abs(d) < 1e-10) {\n return err(validationError('ZERO_OFFSET', 'Offset distance cannot be zero'))\n }\n const tolerance = ((options ?? {}) as { tolerance?: number }).tolerance ?? 1e-6\n try {\n const h = getOcctKernel().offset(s as never, d, tolerance)\n return ok(h as unknown as BrepHandle)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('OFFSET_FAILED', `Offset operation failed: ${raw}`, e))\n }\n}\n"]}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — boolean / section
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Brep-shaped implementation for `section`. Semantics mirror brepjs
8
+ * `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution
9
+ * from PlaneInput, kernel section via a planar tool, compound result) using the
10
+ * L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).
11
+ */
12
+ import type { BrepHandle } from '../../brep/engine/types.js';
13
+ import { type Result } from '../../result/result.js';
14
+ /**
15
+ * Section a shape with a plane (brepjs `section(shape, plane, options?)`).
16
+ *
17
+ * The plane is resolved from `PlaneInput` (named plane or explicit Plane); the
18
+ * L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and
19
+ * downcasts the result compound to edge/wire handles, which are re-combined
20
+ * into a compound to match the brepjs product shape. `options` (approximation
21
+ * / planeSize) is accepted for signature compatibility; the occt native
22
+ * section uses its default approximation.
23
+ *
24
+ * @param args - Resolved arguments (shape, plane).
25
+ * @returns The section result compound as a `BrepHandle`.
26
+ */
27
+ export declare function sectionBrep(...args: unknown[]): Result<BrepHandle>;
28
+ /**
29
+ * Fuse (union) two shapes into one.
30
+ * @param args - Resolved arguments (a, b).
31
+ * @returns The fused shape as a `BrepHandle`.
32
+ */
33
+ export declare function fuseBrep(...args: unknown[]): Result<BrepHandle>;
34
+ /**
35
+ * Split a shape with one or more tool shapes.
36
+ * @param args - Resolved arguments (shape, tools).
37
+ * @returns The split result as a `BrepHandle`.
38
+ */
39
+ export declare function splitBrep(...args: unknown[]): Result<BrepHandle>;
40
+ //# sourceMappingURL=booleanFns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"booleanFns.d.ts","sourceRoot":"","sources":["../../../src/api/brep-operations/booleanFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAU1D;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAiClE;AASD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAW/D;AAQD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAoBhE"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — boolean / section
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Brep-shaped implementation for `section`. Semantics mirror brepjs
8
+ * `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution
9
+ * from PlaneInput, kernel section via a planar tool, compound result) using the
10
+ * L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).
11
+ */
12
+ import { getBrepApi } from '../../brep/handle-bridge.js';
13
+ import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
14
+ import { ok, err } from '../../result/result.js';
15
+ import { kernelError } from '../../result/errors.js';
16
+ import { resolveArgs } from '../internal/dual-form-args.js';
17
+ import { resolvePlane } from '../geom-types/planeOps.js';
18
+ import { brepHandleOf } from './brepHelpers.js';
19
+ const SECTION_PARAMS = { name: 'section', params: ['shape', 'plane'], formClass: 'A' };
20
+ /**
21
+ * Section a shape with a plane (brepjs `section(shape, plane, options?)`).
22
+ *
23
+ * The plane is resolved from `PlaneInput` (named plane or explicit Plane); the
24
+ * L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and
25
+ * downcasts the result compound to edge/wire handles, which are re-combined
26
+ * into a compound to match the brepjs product shape. `options` (approximation
27
+ * / planeSize) is accepted for signature compatibility; the occt native
28
+ * section uses its default approximation.
29
+ *
30
+ * @param args - Resolved arguments (shape, plane).
31
+ * @returns The section result compound as a `BrepHandle`.
32
+ */
33
+ export function sectionBrep(...args) {
34
+ const [shape, plane] = resolveArgs(args, SECTION_PARAMS);
35
+ const kernel = getBrepApi();
36
+ const h = brepHandleOf(shape);
37
+ // NOTE: 2026-09-26 brepkit 降级——移除 getOcctKernel().IsNull 平台耦合。
38
+ // 空/坏句柄由下游 sectionByPlane 内核抛错并被下方 try/catch 捕获为 SECTION_FAILED
39
+ // (occt 的 sectionByPlane 对空结果本就返回 [],行为等价;brepkit 对坏句柄抛
40
+ // "invalid solid handle",诚实报错而非崩溃)。
41
+ const resolved = resolvePlane(plane);
42
+ if (!resolved.ok)
43
+ return resolved;
44
+ const p = resolved.value;
45
+ try {
46
+ const parts = kernel.sectionByPlane(h, { x: p.origin[0], y: p.origin[1], z: p.origin[2] }, { x: p.zDir[0], y: p.zDir[1], z: p.zDir[2] });
47
+ // 语义差异(如实登记):occt sectionByPlane 返回 edge/wire 句柄组(1D 剖面线);
48
+ // brepkit sectionByPlane 返回 face 句柄组(2D 剖面面)。两侧都包成 compound 产物,
49
+ // 下游 meshShape/wireframe 已按已知集合分发(brepkit makeCompound 对非 solid 子句柄走
50
+ // 虚拟 compound 路径)。
51
+ return ok(kernel.makeCompound(parts));
52
+ }
53
+ catch (e) {
54
+ return err(kernelError('SECTION_FAILED', `Section with plane failed: ${e instanceof Error ? e.message : String(e)}`, e, { operation: 'section' }, 'The cutting plane may not intersect the shape. Verify plane position relative to shape bounds.'));
55
+ }
56
+ }
57
+ // ---------------------------------------------------------------------------
58
+ // fuse — union two shapes (brepjs topology/booleanFns.ts#fuse)
59
+ // ---------------------------------------------------------------------------
60
+ const FUSE_PARAMS = { name: 'fuse', params: ['a', 'b', 'options'], formClass: 'A' };
61
+ /**
62
+ * Fuse (union) two shapes into one.
63
+ * @param args - Resolved arguments (a, b).
64
+ * @returns The fused shape as a `BrepHandle`.
65
+ */
66
+ export function fuseBrep(...args) {
67
+ const [a, b] = resolveArgs(args, FUSE_PARAMS);
68
+ const kernel = getBrepApi();
69
+ const ha = brepHandleOf(a);
70
+ const hb = brepHandleOf(b);
71
+ try {
72
+ return ok(kernel.fuse(ha, hb));
73
+ }
74
+ catch (e) {
75
+ const raw = e instanceof Error ? e.message : String(e);
76
+ return err(kernelError('FUSE_FAILED', `fuse failed: ${raw}`, e));
77
+ }
78
+ }
79
+ // ---------------------------------------------------------------------------
80
+ // split — split a shape with tool(s) (brepjs topology/api.ts#split → booleanFns.split)
81
+ // ---------------------------------------------------------------------------
82
+ const SPLIT_PARAMS = { name: 'split', params: ['shape', 'tools'], formClass: 'A' };
83
+ /**
84
+ * Split a shape with one or more tool shapes.
85
+ * @param args - Resolved arguments (shape, tools).
86
+ * @returns The split result as a `BrepHandle`.
87
+ */
88
+ export function splitBrep(...args) {
89
+ const [shape, toolsRaw] = resolveArgs(args, SPLIT_PARAMS);
90
+ const h = brepHandleOf(shape);
91
+ const tools = (toolsRaw ?? []);
92
+ if (tools.length === 0)
93
+ return ok(h);
94
+ const toolHandles = tools.map((t) => brepHandleOf(t));
95
+ try {
96
+ const result = getOcctKernel().split(h, toolHandles);
97
+ return ok(result);
98
+ }
99
+ catch (e) {
100
+ const raw = e instanceof Error ? e.message : String(e);
101
+ return err(kernelError('SPLIT_FAILED', `Split operation failed on ${tools.length} tool(s): ${raw}`, e, { operation: 'split', toolCount: tools.length }));
102
+ }
103
+ }
104
+ //# sourceMappingURL=booleanFns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"booleanFns.js","sourceRoot":"","sources":["../../../src/api/brep-operations/booleanFns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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,MAAM,qBAAqB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","sourcesContent":["/**\n * Self-hosted compat-op implementations — boolean / section\n * (core-decouple Phase 3, §5.4).\n *\n * @platform occt\n *\n * Brep-shaped implementation for `section`. Semantics mirror brepjs\n * `topology/booleanFns.ts` `section` (NULL_SHAPE_INPUT guard, plane resolution\n * from PlaneInput, kernel section via a planar tool, compound result) using the\n * L1 `sectionByPlane` (occt-wasm `BRepAlgoAPI_Section` + edge/wire downcast).\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 } from '../../result/errors'\nimport type { FormClass } from '../internal/dual-form-args'\nimport { resolveArgs } from '../internal/dual-form-args'\nimport type { PlaneInput } from '../geom-types/planeTypes'\nimport { resolvePlane } from '../geom-types/planeOps'\nimport { brepHandleOf } from './brepHelpers'\n\nconst SECTION_PARAMS = { name: 'section', params: ['shape', 'plane'], formClass: 'A' as FormClass }\n\n/**\n * Section a shape with a plane (brepjs `section(shape, plane, options?)`).\n *\n * The plane is resolved from `PlaneInput` (named plane or explicit Plane); the\n * L1 `sectionByPlane` builds the planar tool, runs `BRepAlgoAPI_Section`, and\n * downcasts the result compound to edge/wire handles, which are re-combined\n * into a compound to match the brepjs product shape. `options` (approximation\n * / planeSize) is accepted for signature compatibility; the occt native\n * section uses its default approximation.\n *\n * @param args - Resolved arguments (shape, plane).\n * @returns The section result compound as a `BrepHandle`.\n */\nexport function sectionBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, plane] = resolveArgs(args, SECTION_PARAMS)\n const kernel = getBrepApi()\n const h = brepHandleOf(shape)\n // NOTE: 2026-09-26 brepkit 降级——移除 getOcctKernel().IsNull 平台耦合。\n // 空/坏句柄由下游 sectionByPlane 内核抛错并被下方 try/catch 捕获为 SECTION_FAILED\n // (occt 的 sectionByPlane 对空结果本就返回 [],行为等价;brepkit 对坏句柄抛\n // \"invalid solid handle\",诚实报错而非崩溃)。\n const resolved = resolvePlane(plane as PlaneInput)\n if (!resolved.ok) return resolved\n const p = resolved.value\n try {\n const parts = kernel.sectionByPlane(\n h,\n { x: p.origin[0], y: p.origin[1], z: p.origin[2] },\n { x: p.zDir[0], y: p.zDir[1], z: p.zDir[2] },\n )\n // 语义差异(如实登记):occt sectionByPlane 返回 edge/wire 句柄组(1D 剖面线);\n // brepkit sectionByPlane 返回 face 句柄组(2D 剖面面)。两侧都包成 compound 产物,\n // 下游 meshShape/wireframe 已按已知集合分发(brepkit makeCompound 对非 solid 子句柄走\n // 虚拟 compound 路径)。\n return ok(kernel.makeCompound(parts))\n } catch (e) {\n return err(\n kernelError(\n 'SECTION_FAILED',\n `Section with plane failed: ${e instanceof Error ? e.message : String(e)}`,\n e,\n { operation: 'section' },\n 'The cutting plane may not intersect the shape. Verify plane position relative to shape bounds.',\n ),\n )\n }\n}\n\n\n// ---------------------------------------------------------------------------\n// fuse — union two shapes (brepjs topology/booleanFns.ts#fuse)\n// ---------------------------------------------------------------------------\n\nconst FUSE_PARAMS = { name: 'fuse', params: ['a', 'b', 'options'], formClass: 'A' as FormClass }\n\n/**\n * Fuse (union) two shapes into one.\n * @param args - Resolved arguments (a, b).\n * @returns The fused shape as a `BrepHandle`.\n */\nexport function fuseBrep(...args: unknown[]): Result<BrepHandle> {\n const [a, b] = resolveArgs(args, FUSE_PARAMS)\n const kernel = getBrepApi()\n const ha = brepHandleOf(a)\n const hb = brepHandleOf(b)\n try {\n return ok(kernel.fuse(ha, hb))\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(kernelError('FUSE_FAILED', `fuse failed: ${raw}`, e))\n }\n}\n\n// ---------------------------------------------------------------------------\n// split — split a shape with tool(s) (brepjs topology/api.ts#split → booleanFns.split)\n// ---------------------------------------------------------------------------\n\nconst SPLIT_PARAMS = { name: 'split', params: ['shape', 'tools'], formClass: 'A' as FormClass }\n\n/**\n * Split a shape with one or more tool shapes.\n * @param args - Resolved arguments (shape, tools).\n * @returns The split result as a `BrepHandle`.\n */\nexport function splitBrep(...args: unknown[]): Result<BrepHandle> {\n const [shape, toolsRaw] = resolveArgs(args, SPLIT_PARAMS)\n const h = brepHandleOf(shape)\n const tools = (toolsRaw ?? []) as unknown[]\n if (tools.length === 0) return ok(h)\n const toolHandles = tools.map((t) => brepHandleOf(t))\n try {\n const result = getOcctKernel().split(h as never, toolHandles as never)\n return ok(result as unknown as BrepHandle)\n } catch (e) {\n const raw = e instanceof Error ? e.message : String(e)\n return err(\n kernelError(\n 'SPLIT_FAILED',\n `Split operation failed on ${tools.length} tool(s): ${raw}`,\n e,\n { operation: 'split', toolCount: tools.length },\n ),\n )\n }\n}\n"]}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * brep-operations helpers — shared utilities for self-hosted compat-op implementations
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @module
6
+ */
7
+ import type { BrepHandle } from '../../brep/engine/types.js';
8
+ /**
9
+ * Extract a core BREP handle from an op argument.
10
+ *
11
+ * Accepts (in order of preference):
12
+ * - a raw branded number (BrepHandle),
13
+ * - a kernel handle object `{ id }`,
14
+ * - a shape wrapper object `{ wrapped }`,
15
+ * - a faijs Shape whose brep slot carries the handle.
16
+ *
17
+ * @param v - the op argument (positional, post D11 normalization).
18
+ * @returns the numeric BREP handle.
19
+ * @throws when no handle can be extracted (E_BREP_INPUT).
20
+ */
21
+ export declare function brepHandleOf(v: unknown): BrepHandle;
22
+ /** Identity 3×4 row-major affine matrix (12 elements). */
23
+ export declare const IDENTITY_3X4: readonly number[];
24
+ /**
25
+ * Compose two 3×4 row-major affine matrices: `a` applied first, then `b`
26
+ * (column-vector convention: p' = b·(a·p)).
27
+ *
28
+ * @param a - first matrix (12 elements).
29
+ * @param b - second matrix (12 elements).
30
+ * @returns the composed 12-element matrix.
31
+ */
32
+ export declare function composeAffine(a: readonly number[], b: readonly number[]): number[];
33
+ /**
34
+ * 3×4 translation matrix for a vector.
35
+ * @param v - Translation vector.
36
+ * @returns The 3×4 translation matrix.
37
+ */
38
+ export declare function translationMatrix(v: readonly [number, number, number]): number[];
39
+ /**
40
+ * 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)
41
+ * passing through `center`. Rodrigues formula, column-vector convention.
42
+ *
43
+ * @param axis - Rotation axis (unit-ized internally).
44
+ * @param center - Point the rotation passes through.
45
+ * @param angleDeg - Rotation angle in degrees.
46
+ * @returns The 3×4 rotation matrix.
47
+ */
48
+ export declare function rotationMatrix(axis: readonly [number, number, number], center: readonly [number, number, number], angleDeg: number): number[];
49
+ /**
50
+ * 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.
51
+ * @param axis - Target axis direction.
52
+ * @returns The 3×4 rotation matrix.
53
+ */
54
+ export declare function rotationZTo(axis: readonly [number, number, number]): number[];
55
+ //# sourceMappingURL=brepHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brepHelpers.d.ts","sourceRoot":"","sources":["../../../src/api/brep-operations/brepHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAUnD;AAED,0DAA0D;AAC1D,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAyC,CAAA;AAEnF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAWlF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACvC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACzC,QAAQ,EAAE,MAAM,GACf,MAAM,EAAE,CA4BV;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAsB7E"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * brep-operations helpers — shared utilities for self-hosted compat-op implementations
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @module
6
+ */
7
+ import { brepOf } from '../../shape.js';
8
+ /**
9
+ * Extract a core BREP handle from an op argument.
10
+ *
11
+ * Accepts (in order of preference):
12
+ * - a raw branded number (BrepHandle),
13
+ * - a kernel handle object `{ id }`,
14
+ * - a shape wrapper object `{ wrapped }`,
15
+ * - a faijs Shape whose brep slot carries the handle.
16
+ *
17
+ * @param v - the op argument (positional, post D11 normalization).
18
+ * @returns the numeric BREP handle.
19
+ * @throws when no handle can be extracted (E_BREP_INPUT).
20
+ */
21
+ export function brepHandleOf(v) {
22
+ if (typeof v === 'number')
23
+ return v;
24
+ if (v !== null && typeof v === 'object') {
25
+ const rec = v;
26
+ if (typeof rec.id === 'number')
27
+ return rec.id;
28
+ if ('wrapped' in rec)
29
+ return brepHandleOf(rec.wrapped);
30
+ const solid = brepOf(v);
31
+ if (typeof solid === 'number')
32
+ return solid;
33
+ }
34
+ throw new Error('[brep-operations] E_BREP_INPUT: argument carries no BREP handle');
35
+ }
36
+ /** Identity 3×4 row-major affine matrix (12 elements). */
37
+ export const IDENTITY_3X4 = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0];
38
+ /**
39
+ * Compose two 3×4 row-major affine matrices: `a` applied first, then `b`
40
+ * (column-vector convention: p' = b·(a·p)).
41
+ *
42
+ * @param a - first matrix (12 elements).
43
+ * @param b - second matrix (12 elements).
44
+ * @returns the composed 12-element matrix.
45
+ */
46
+ export function composeAffine(a, b) {
47
+ const out = new Array(12);
48
+ for (let r = 0; r < 3; r++) {
49
+ const a0 = a[r * 4], a1 = a[r * 4 + 1], a2 = a[r * 4 + 2], a3 = a[r * 4 + 3];
50
+ for (let c = 0; c < 3; c++)
51
+ out[r * 4 + c] = a0 * b[c] + a1 * b[4 + c] + a2 * b[8 + c];
52
+ out[r * 4 + 3] = a0 * b[3] + a1 * b[7] + a2 * b[11] + a3;
53
+ }
54
+ return out;
55
+ }
56
+ /**
57
+ * 3×4 translation matrix for a vector.
58
+ * @param v - Translation vector.
59
+ * @returns The 3×4 translation matrix.
60
+ */
61
+ export function translationMatrix(v) {
62
+ return [1, 0, 0, v[0], 0, 1, 0, v[1], 0, 0, 1, v[2]];
63
+ }
64
+ /**
65
+ * 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)
66
+ * passing through `center`. Rodrigues formula, column-vector convention.
67
+ *
68
+ * @param axis - Rotation axis (unit-ized internally).
69
+ * @param center - Point the rotation passes through.
70
+ * @param angleDeg - Rotation angle in degrees.
71
+ * @returns The 3×4 rotation matrix.
72
+ */
73
+ export function rotationMatrix(axis, center, angleDeg) {
74
+ let [ux, uy, uz] = axis;
75
+ const len = Math.hypot(ux, uy, uz);
76
+ if (len < 1e-12)
77
+ throw new Error('[brep-operations] rotation: zero-length axis');
78
+ ux /= len;
79
+ uy /= len;
80
+ uz /= len;
81
+ const th = (angleDeg * Math.PI) / 180;
82
+ const c = Math.cos(th);
83
+ const s = Math.sin(th);
84
+ const t = 1 - c;
85
+ const [cx, cy, cz] = center;
86
+ const r00 = t * ux * ux + c;
87
+ const r01 = t * ux * uy - s * uz;
88
+ const r02 = t * ux * uz + s * uy;
89
+ const r10 = t * ux * uy + s * uz;
90
+ const r11 = t * uy * uy + c;
91
+ const r12 = t * uy * uz - s * ux;
92
+ const r20 = t * ux * uz - s * uy;
93
+ const r21 = t * uy * uz + s * ux;
94
+ const r22 = t * uz * uz + c;
95
+ return [
96
+ r00, r01, r02, cx - r00 * cx - r01 * cy - r02 * cz,
97
+ r10, r11, r12, cy - r10 * cx - r11 * cy - r12 * cz,
98
+ r20, r21, r22, cz - r20 * cx - r21 * cy - r22 * cz,
99
+ ];
100
+ }
101
+ /**
102
+ * 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.
103
+ * @param axis - Target axis direction.
104
+ * @returns The 3×4 rotation matrix.
105
+ */
106
+ export function rotationZTo(axis) {
107
+ const [x, y, z] = axis;
108
+ const len = Math.hypot(x, y, z);
109
+ if (len < 1e-12)
110
+ throw new Error('[brep-operations] rotationZTo: zero-length axis');
111
+ const nx = x / len;
112
+ const ny = y / len;
113
+ const nz = z / len;
114
+ if (Math.abs(nz - 1) < 1e-9)
115
+ return [...IDENTITY_3X4];
116
+ // Rodrigues rotation from [0,0,1] to [nx,ny,nz].
117
+ const cross = [-ny, nx, 0]; // [0,0,1] × axis
118
+ const crossLen = Math.hypot(...cross);
119
+ const kx = cross[0] / crossLen;
120
+ const ky = cross[1] / crossLen;
121
+ const kz = cross[2] / crossLen;
122
+ const cosA = nz;
123
+ const sinA = Math.hypot(nx, ny);
124
+ const t = 1 - cosA;
125
+ return [
126
+ t * kx * kx + cosA, t * kx * ky - sinA * kz, t * kx * kz + sinA * ky, 0,
127
+ t * kx * ky + sinA * kz, t * ky * ky + cosA, t * ky * kz - sinA * kx, 0,
128
+ t * kx * kz - sinA * ky, t * ky * kz + sinA * kx, t * kz * kz + cosA, 0,
129
+ ];
130
+ }
131
+ //# sourceMappingURL=brepHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brepHelpers.js","sourceRoot":"","sources":["../../../src/api/brep-operations/brepHelpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,CAAU;IACrC,IAAI,OAAO,CAAC,KAAK,QAAQ;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,CAAC,CAAA;IAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IAClB,OAAO;QACL,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;QACvE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC;QACvE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;KACxE,CAAA;AACH,CAAC","sourcesContent":["/**\n * brep-operations helpers — shared utilities for self-hosted compat-op implementations\n * (core-decouple Phase 3, §5.4).\n *\n * @module\n */\n\nimport type { BrepHandle } from '../../brep/engine/types'\nimport { brepOf } from '../../shape'\n\n/**\n * Extract a core BREP handle from an op argument.\n *\n * Accepts (in order of preference):\n * - a raw branded number (BrepHandle),\n * - a kernel handle object `{ id }`,\n * - a shape wrapper object `{ wrapped }`,\n * - a faijs Shape whose brep slot carries the handle.\n *\n * @param v - the op argument (positional, post D11 normalization).\n * @returns the numeric BREP handle.\n * @throws when no handle can be extracted (E_BREP_INPUT).\n */\nexport function brepHandleOf(v: unknown): BrepHandle {\n if (typeof v === 'number') return v as BrepHandle\n if (v !== null && typeof v === 'object') {\n const rec = v as Record<string, unknown>\n if (typeof rec.id === 'number') return rec.id as BrepHandle\n if ('wrapped' in rec) return brepHandleOf(rec.wrapped)\n const solid = brepOf(v as never)\n if (typeof solid === 'number') return solid as BrepHandle\n }\n throw new Error('[brep-operations] E_BREP_INPUT: argument carries no BREP handle')\n}\n\n/** Identity 3×4 row-major affine matrix (12 elements). */\nexport const IDENTITY_3X4: readonly number[] = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]\n\n/**\n * Compose two 3×4 row-major affine matrices: `a` applied first, then `b`\n * (column-vector convention: p' = b·(a·p)).\n *\n * @param a - first matrix (12 elements).\n * @param b - second matrix (12 elements).\n * @returns the composed 12-element matrix.\n */\nexport function composeAffine(a: readonly number[], b: readonly number[]): number[] {\n const out = new Array<number>(12)\n for (let r = 0; r < 3; r++) {\n const a0 = a[r * 4],\n a1 = a[r * 4 + 1],\n a2 = a[r * 4 + 2],\n a3 = a[r * 4 + 3]\n for (let c = 0; c < 3; c++) out[r * 4 + c] = a0 * b[c] + a1 * b[4 + c] + a2 * b[8 + c]\n out[r * 4 + 3] = a0 * b[3] + a1 * b[7] + a2 * b[11] + a3\n }\n return out\n}\n\n/**\n * 3×4 translation matrix for a vector.\n * @param v - Translation vector.\n * @returns The 3×4 translation matrix.\n */\nexport function translationMatrix(v: readonly [number, number, number]): number[] {\n return [1, 0, 0, v[0], 0, 1, 0, v[1], 0, 0, 1, v[2]]\n}\n\n/**\n * 3×4 rotation matrix rotating `angleDeg` degrees around the axis (unit-ized)\n * passing through `center`. Rodrigues formula, column-vector convention.\n *\n * @param axis - Rotation axis (unit-ized internally).\n * @param center - Point the rotation passes through.\n * @param angleDeg - Rotation angle in degrees.\n * @returns The 3×4 rotation matrix.\n */\nexport function rotationMatrix(\n axis: readonly [number, number, number],\n center: readonly [number, number, number],\n angleDeg: number,\n): number[] {\n let [ux, uy, uz] = axis\n const len = Math.hypot(ux, uy, uz)\n if (len < 1e-12) throw new Error('[brep-operations] rotation: zero-length axis')\n ux /= len\n uy /= len\n uz /= len\n const th = (angleDeg * Math.PI) / 180\n const c = Math.cos(th)\n const s = Math.sin(th)\n const t = 1 - c\n const [cx, cy, cz] = center\n\n const r00 = t * ux * ux + c\n const r01 = t * ux * uy - s * uz\n const r02 = t * ux * uz + s * uy\n const r10 = t * ux * uy + s * uz\n const r11 = t * uy * uy + c\n const r12 = t * uy * uz - s * ux\n const r20 = t * ux * uz - s * uy\n const r21 = t * uy * uz + s * ux\n const r22 = t * uz * uz + c\n\n return [\n r00, r01, r02, cx - r00 * cx - r01 * cy - r02 * cz,\n r10, r11, r12, cy - r10 * cx - r11 * cy - r12 * cz,\n r20, r21, r22, cz - r20 * cx - r21 * cy - r22 * cz,\n ]\n}\n\n/**\n * 3×4 matrix rotating the +Z axis onto `axis` (unit-ized), origin-centered.\n * @param axis - Target axis direction.\n * @returns The 3×4 rotation matrix.\n */\nexport function rotationZTo(axis: readonly [number, number, number]): number[] {\n const [x, y, z] = axis\n const len = Math.hypot(x, y, z)\n if (len < 1e-12) throw new Error('[brep-operations] rotationZTo: zero-length axis')\n const nx = x / len\n const ny = y / len\n const nz = z / len\n if (Math.abs(nz - 1) < 1e-9) return [...IDENTITY_3X4]\n // Rodrigues rotation from [0,0,1] to [nx,ny,nz].\n const cross = [-ny, nx, 0] // [0,0,1] × axis\n const crossLen = Math.hypot(...cross)\n const kx = cross[0] / crossLen\n const ky = cross[1] / crossLen\n const kz = cross[2] / crossLen\n const cosA = nz\n const sinA = Math.hypot(nx, ny)\n const t = 1 - cosA\n return [\n t * kx * kx + cosA, t * kx * ky - sinA * kz, t * kx * kz + sinA * ky, 0,\n t * kx * ky + sinA * kz, t * ky * ky + cosA, t * ky * kz - sinA * kx, 0,\n t * kx * kz - sinA * ky, t * ky * kz + sinA * kx, t * kz * kz + cosA, 0,\n ]\n}\n"]}