@faicad/faijs 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/LICENSE +4 -5
  2. package/NOTICE +5 -6
  3. package/dist/api/api-namespace.d.ts.map +1 -1
  4. package/dist/api/api-namespace.js +19 -1
  5. package/dist/api/api-namespace.js.map +1 -1
  6. package/dist/api/assembly/entities.d.ts +1 -1
  7. package/dist/api/assembly/entities.d.ts.map +1 -1
  8. package/dist/api/assembly/entities.js.map +1 -1
  9. package/dist/api/assembly/joints.d.ts +2 -2
  10. package/dist/api/assembly/joints.d.ts.map +1 -1
  11. package/dist/api/assembly/joints.js +2 -2
  12. package/dist/api/assembly/joints.js.map +1 -1
  13. package/dist/api/assembly/lower.d.ts +1 -1
  14. package/dist/api/assembly/lower.d.ts.map +1 -1
  15. package/dist/api/assembly/lower.js.map +1 -1
  16. package/dist/api/assembly/pose.d.ts +3 -3
  17. package/dist/api/assembly/pose.d.ts.map +1 -1
  18. package/dist/api/assembly/pose.js +1 -1
  19. package/dist/api/assembly/pose.js.map +1 -1
  20. package/dist/api/assembly/preview.d.ts +1 -1
  21. package/dist/api/assembly/preview.d.ts.map +1 -1
  22. package/dist/api/assembly/preview.js +1 -1
  23. package/dist/api/assembly/preview.js.map +1 -1
  24. package/dist/api/assembly/solve.d.ts.map +1 -1
  25. package/dist/api/assembly/solve.js +3 -3
  26. package/dist/api/assembly/solve.js.map +1 -1
  27. package/dist/api/assembly/solvers/assembly-tree.d.ts +98 -0
  28. package/dist/api/assembly/solvers/assembly-tree.d.ts.map +1 -0
  29. package/dist/api/assembly/solvers/assembly-tree.js +130 -0
  30. package/dist/api/assembly/solvers/assembly-tree.js.map +1 -0
  31. package/dist/api/assembly/solvers/chain-solver.d.ts +27 -0
  32. package/dist/api/assembly/solvers/chain-solver.d.ts.map +1 -0
  33. package/dist/api/assembly/solvers/chain-solver.js +330 -0
  34. package/dist/api/assembly/solvers/chain-solver.js.map +1 -0
  35. package/dist/api/assembly/solvers/global-solver.js +2 -2
  36. package/dist/api/assembly/solvers/global-solver.js.map +1 -1
  37. package/dist/api/assembly/solvers/joints-kinematics.d.ts +308 -0
  38. package/dist/api/assembly/solvers/joints-kinematics.d.ts.map +1 -0
  39. package/dist/api/assembly/solvers/joints-kinematics.js +643 -0
  40. package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -0
  41. package/dist/api/assembly/solvers/quat.d.ts +35 -0
  42. package/dist/api/assembly/solvers/quat.d.ts.map +1 -0
  43. package/dist/api/assembly/solvers/quat.js +84 -0
  44. package/dist/api/assembly/solvers/quat.js.map +1 -0
  45. package/dist/api/assembly/solvers/types.d.ts +33 -0
  46. package/dist/api/assembly/solvers/types.d.ts.map +1 -1
  47. package/dist/api/assembly/solvers/types.js.map +1 -1
  48. package/dist/api/boolean.d.ts.map +1 -1
  49. package/dist/api/boolean.js +3 -4
  50. package/dist/api/boolean.js.map +1 -1
  51. package/dist/api/brep-mirror/booleanFns.d.ts +40 -0
  52. package/dist/api/brep-mirror/booleanFns.d.ts.map +1 -0
  53. package/dist/api/brep-mirror/booleanFns.js +99 -0
  54. package/dist/api/brep-mirror/booleanFns.js.map +1 -0
  55. package/dist/api/brep-mirror/brepHelpers.d.ts +55 -0
  56. package/dist/api/brep-mirror/brepHelpers.d.ts.map +1 -0
  57. package/dist/api/brep-mirror/brepHelpers.js +131 -0
  58. package/dist/api/brep-mirror/brepHelpers.js.map +1 -0
  59. package/dist/api/brep-mirror/compoundFns.d.ts +47 -0
  60. package/dist/api/brep-mirror/compoundFns.d.ts.map +1 -0
  61. package/dist/api/brep-mirror/compoundFns.js +300 -0
  62. package/dist/api/brep-mirror/compoundFns.js.map +1 -0
  63. package/dist/api/brep-mirror/healingFns.d.ts +78 -0
  64. package/dist/api/brep-mirror/healingFns.d.ts.map +1 -0
  65. package/dist/api/brep-mirror/healingFns.js +294 -0
  66. package/dist/api/brep-mirror/healingFns.js.map +1 -0
  67. package/dist/api/brep-mirror/hullFns.d.ts +20 -0
  68. package/dist/api/brep-mirror/hullFns.d.ts.map +1 -0
  69. package/dist/api/brep-mirror/hullFns.js +46 -0
  70. package/dist/api/brep-mirror/hullFns.js.map +1 -0
  71. package/dist/api/brep-mirror/patternFns.d.ts +43 -0
  72. package/dist/api/brep-mirror/patternFns.d.ts.map +1 -0
  73. package/dist/api/brep-mirror/patternFns.js +178 -0
  74. package/dist/api/brep-mirror/patternFns.js.map +1 -0
  75. package/dist/api/brep-mirror/primitiveFns.d.ts +42 -0
  76. package/dist/api/brep-mirror/primitiveFns.d.ts.map +1 -0
  77. package/dist/api/brep-mirror/primitiveFns.js +104 -0
  78. package/dist/api/brep-mirror/primitiveFns.js.map +1 -0
  79. package/dist/api/brep-mirror/roofFns.d.ts +24 -0
  80. package/dist/api/brep-mirror/roofFns.d.ts.map +1 -0
  81. package/dist/api/brep-mirror/roofFns.js +229 -0
  82. package/dist/api/brep-mirror/roofFns.js.map +1 -0
  83. package/dist/api/brep-mirror/straightSkeleton.d.ts +36 -0
  84. package/dist/api/brep-mirror/straightSkeleton.d.ts.map +1 -0
  85. package/dist/api/brep-mirror/straightSkeleton.js +443 -0
  86. package/dist/api/brep-mirror/straightSkeleton.js.map +1 -0
  87. package/dist/api/brep-mirror/sweepFns.d.ts +55 -0
  88. package/dist/api/brep-mirror/sweepFns.d.ts.map +1 -0
  89. package/dist/api/brep-mirror/sweepFns.js +200 -0
  90. package/dist/api/brep-mirror/sweepFns.js.map +1 -0
  91. package/dist/api/brep-mirror/threadFns.d.ts +15 -0
  92. package/dist/api/brep-mirror/threadFns.d.ts.map +1 -1
  93. package/dist/api/brep-mirror/threadFns.js +37 -2
  94. package/dist/api/brep-mirror/threadFns.js.map +1 -1
  95. package/dist/api/brep-mirror/topologyFns.d.ts +74 -0
  96. package/dist/api/brep-mirror/topologyFns.d.ts.map +1 -0
  97. package/dist/api/brep-mirror/topologyFns.js +273 -0
  98. package/dist/api/brep-mirror/topologyFns.js.map +1 -0
  99. package/dist/api/brep-topology.d.ts +190 -0
  100. package/dist/api/brep-topology.d.ts.map +1 -0
  101. package/dist/api/brep-topology.js +337 -0
  102. package/dist/api/brep-topology.js.map +1 -0
  103. package/dist/api/brepjs-compat/constants.d.ts +11 -0
  104. package/dist/api/brepjs-compat/constants.d.ts.map +1 -0
  105. package/dist/api/brepjs-compat/constants.js +11 -0
  106. package/dist/api/brepjs-compat/constants.js.map +1 -0
  107. package/dist/api/brepjs-compat/index.d.ts +19 -232
  108. package/dist/api/brepjs-compat/index.d.ts.map +1 -1
  109. package/dist/api/brepjs-compat/index.js +19 -286
  110. package/dist/api/brepjs-compat/index.js.map +1 -1
  111. package/dist/api/brepjs-compat/planeOps.d.ts +98 -0
  112. package/dist/api/brepjs-compat/planeOps.d.ts.map +1 -0
  113. package/dist/api/brepjs-compat/planeOps.js +170 -0
  114. package/dist/api/brepjs-compat/planeOps.js.map +1 -0
  115. package/dist/api/brepjs-compat/planeTypes.d.ts +24 -0
  116. package/dist/api/brepjs-compat/planeTypes.d.ts.map +1 -0
  117. package/dist/api/brepjs-compat/planeTypes.js +8 -0
  118. package/dist/api/brepjs-compat/planeTypes.js.map +1 -0
  119. package/dist/api/brepjs-compat/types.d.ts +64 -0
  120. package/dist/api/brepjs-compat/types.d.ts.map +1 -0
  121. package/dist/api/brepjs-compat/types.js +48 -0
  122. package/dist/api/brepjs-compat/types.js.map +1 -0
  123. package/dist/api/brepjs-compat/vecOps.d.ts +124 -0
  124. package/dist/api/brepjs-compat/vecOps.d.ts.map +1 -0
  125. package/dist/api/brepjs-compat/vecOps.js +202 -0
  126. package/dist/api/brepjs-compat/vecOps.js.map +1 -0
  127. package/dist/api/chamfer.d.ts +5 -0
  128. package/dist/api/chamfer.d.ts.map +1 -1
  129. package/dist/api/chamfer.js +13 -8
  130. package/dist/api/chamfer.js.map +1 -1
  131. package/dist/api/compound-geom.d.ts.map +1 -1
  132. package/dist/api/compound-geom.js +8 -2
  133. package/dist/api/compound-geom.js.map +1 -1
  134. package/dist/api/draft.d.ts +69 -0
  135. package/dist/api/draft.d.ts.map +1 -0
  136. package/dist/api/draft.js +109 -0
  137. package/dist/api/draft.js.map +1 -0
  138. package/dist/api/edge-ref.d.ts.map +1 -1
  139. package/dist/api/edge-ref.js +2 -2
  140. package/dist/api/edge-ref.js.map +1 -1
  141. package/dist/api/engrave.d.ts.map +1 -1
  142. package/dist/api/engrave.js +2 -3
  143. package/dist/api/engrave.js.map +1 -1
  144. package/dist/api/extrude.d.ts.map +1 -1
  145. package/dist/api/extrude.js +28 -13
  146. package/dist/api/extrude.js.map +1 -1
  147. package/dist/api/face-ref.d.ts.map +1 -1
  148. package/dist/api/face-ref.js +2 -2
  149. package/dist/api/face-ref.js.map +1 -1
  150. package/dist/api/feature-repair.d.ts +137 -0
  151. package/dist/api/feature-repair.d.ts.map +1 -0
  152. package/dist/api/feature-repair.js +221 -0
  153. package/dist/api/feature-repair.js.map +1 -0
  154. package/dist/api/fillet-variable.d.ts +35 -0
  155. package/dist/api/fillet-variable.d.ts.map +1 -0
  156. package/dist/api/fillet-variable.js +71 -0
  157. package/dist/api/fillet-variable.js.map +1 -0
  158. package/dist/api/fillet.d.ts +3 -0
  159. package/dist/api/fillet.d.ts.map +1 -1
  160. package/dist/api/fillet.js +7 -4
  161. package/dist/api/fillet.js.map +1 -1
  162. package/dist/api/generated/2d.d.ts +1 -13
  163. package/dist/api/generated/2d.d.ts.map +1 -1
  164. package/dist/api/generated/2d.js +6 -1
  165. package/dist/api/generated/2d.js.map +1 -1
  166. package/dist/api/generated/brepjs/index.d.ts +298 -298
  167. package/dist/api/generated/brepjs/index.d.ts.map +1 -1
  168. package/dist/api/generated/brepjs/index.js +183 -183
  169. package/dist/api/generated/brepjs/index.js.map +1 -1
  170. package/dist/api/generated/core.d.ts +3 -123
  171. package/dist/api/generated/core.d.ts.map +1 -1
  172. package/dist/api/generated/core.js +2 -81
  173. package/dist/api/generated/core.js.map +1 -1
  174. package/dist/api/generated/gear.d.ts +1 -15
  175. package/dist/api/generated/gear.d.ts.map +1 -1
  176. package/dist/api/generated/gear.js +6 -3
  177. package/dist/api/generated/gear.js.map +1 -1
  178. package/dist/api/generated/io.d.ts +1 -13
  179. package/dist/api/generated/io.d.ts.map +1 -1
  180. package/dist/api/generated/io.js +6 -1
  181. package/dist/api/generated/io.js.map +1 -1
  182. package/dist/api/generated/kernel.d.ts +1 -39
  183. package/dist/api/generated/kernel.d.ts.map +1 -1
  184. package/dist/api/generated/kernel.js +6 -4
  185. package/dist/api/generated/kernel.js.map +1 -1
  186. package/dist/api/generated/measurement.d.ts +53 -97
  187. package/dist/api/generated/measurement.d.ts.map +1 -1
  188. package/dist/api/generated/measurement.js +48 -143
  189. package/dist/api/generated/measurement.js.map +1 -1
  190. package/dist/api/generated/ns.d.ts +1 -10
  191. package/dist/api/generated/ns.d.ts.map +1 -1
  192. package/dist/api/generated/ns.js +2 -10
  193. package/dist/api/generated/ns.js.map +1 -1
  194. package/dist/api/generated/operations.d.ts +65 -110
  195. package/dist/api/generated/operations.d.ts.map +1 -1
  196. package/dist/api/generated/operations.js +132 -80
  197. package/dist/api/generated/operations.js.map +1 -1
  198. package/dist/api/generated/projection.d.ts +1 -8
  199. package/dist/api/generated/projection.d.ts.map +1 -1
  200. package/dist/api/generated/projection.js +6 -4
  201. package/dist/api/generated/projection.js.map +1 -1
  202. package/dist/api/generated/query.d.ts +1 -9
  203. package/dist/api/generated/query.d.ts.map +1 -1
  204. package/dist/api/generated/query.js +6 -1
  205. package/dist/api/generated/query.js.map +1 -1
  206. package/dist/api/generated/script-face-manifest.d.ts +2 -0
  207. package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
  208. package/dist/api/generated/script-face-manifest.js +34 -22
  209. package/dist/api/generated/script-face-manifest.js.map +1 -1
  210. package/dist/api/generated/script-face.d.ts +52 -27
  211. package/dist/api/generated/script-face.d.ts.map +1 -1
  212. package/dist/api/generated/script-face.js +18 -4
  213. package/dist/api/generated/script-face.js.map +1 -1
  214. package/dist/api/generated/sketching.d.ts +4 -7
  215. package/dist/api/generated/sketching.d.ts.map +1 -1
  216. package/dist/api/generated/sketching.js +10 -8
  217. package/dist/api/generated/sketching.js.map +1 -1
  218. package/dist/api/generated/text.d.ts +1 -6
  219. package/dist/api/generated/text.d.ts.map +1 -1
  220. package/dist/api/generated/text.js +6 -3
  221. package/dist/api/generated/text.js.map +1 -1
  222. package/dist/api/generated/topology.d.ts +77 -175
  223. package/dist/api/generated/topology.d.ts.map +1 -1
  224. package/dist/api/generated/topology.js +172 -131
  225. package/dist/api/generated/topology.js.map +1 -1
  226. package/dist/api/geom.d.ts.map +1 -1
  227. package/dist/api/geom.js +2 -2
  228. package/dist/api/geom.js.map +1 -1
  229. package/dist/api/helix.d.ts +51 -0
  230. package/dist/api/helix.d.ts.map +1 -0
  231. package/dist/api/helix.js +63 -0
  232. package/dist/api/helix.js.map +1 -0
  233. package/dist/api/import-step.d.ts.map +1 -1
  234. package/dist/api/import-step.js +6 -2
  235. package/dist/api/import-step.js.map +1 -1
  236. package/dist/api/index.d.ts +18 -5
  237. package/dist/api/index.d.ts.map +1 -1
  238. package/dist/api/index.js +29 -12
  239. package/dist/api/index.js.map +1 -1
  240. package/dist/api/internal/compat-op.d.ts +10 -0
  241. package/dist/api/internal/compat-op.d.ts.map +1 -1
  242. package/dist/api/internal/compat-op.js +9 -3
  243. package/dist/api/internal/compat-op.js.map +1 -1
  244. package/dist/api/internal/compat-projection.d.ts +4 -4
  245. package/dist/api/internal/compat-projection.js +7 -7
  246. package/dist/api/internal/compat-projection.js.map +1 -1
  247. package/dist/api/internal/l3-bridge.d.ts +75 -42
  248. package/dist/api/internal/l3-bridge.d.ts.map +1 -1
  249. package/dist/api/internal/l3-bridge.js +105 -50
  250. package/dist/api/internal/l3-bridge.js.map +1 -1
  251. package/dist/api/internal/profile-wire.d.ts +31 -0
  252. package/dist/api/internal/profile-wire.d.ts.map +1 -0
  253. package/dist/api/internal/profile-wire.js +37 -0
  254. package/dist/api/internal/profile-wire.js.map +1 -0
  255. package/dist/api/internal/replica-role-table.js +2 -2
  256. package/dist/api/internal/replica-role-table.js.map +1 -1
  257. package/dist/api/loft.d.ts +66 -0
  258. package/dist/api/loft.d.ts.map +1 -0
  259. package/dist/api/loft.js +111 -0
  260. package/dist/api/loft.js.map +1 -0
  261. package/dist/api/measurement/index.d.ts +51 -0
  262. package/dist/api/measurement/index.d.ts.map +1 -0
  263. package/dist/api/measurement/index.js +71 -0
  264. package/dist/api/measurement/index.js.map +1 -0
  265. package/dist/api/occt-kernel-bridge.d.ts +5 -8
  266. package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
  267. package/dist/api/occt-kernel-bridge.js +18 -14
  268. package/dist/api/occt-kernel-bridge.js.map +1 -1
  269. package/dist/api/pattern.d.ts.map +1 -1
  270. package/dist/api/pattern.js +3 -4
  271. package/dist/api/pattern.js.map +1 -1
  272. package/dist/api/place.d.ts.map +1 -1
  273. package/dist/api/place.js +2 -4
  274. package/dist/api/place.js.map +1 -1
  275. package/dist/api/primitives.d.ts.map +1 -1
  276. package/dist/api/primitives.js +3 -4
  277. package/dist/api/primitives.js.map +1 -1
  278. package/dist/api/replicate.d.ts +28 -1
  279. package/dist/api/replicate.d.ts.map +1 -1
  280. package/dist/api/replicate.js +29 -19
  281. package/dist/api/replicate.js.map +1 -1
  282. package/dist/api/result.d.ts +6 -11
  283. package/dist/api/result.d.ts.map +1 -1
  284. package/dist/api/result.js +6 -11
  285. package/dist/api/result.js.map +1 -1
  286. package/dist/api/revolve.d.ts.map +1 -1
  287. package/dist/api/revolve.js +15 -14
  288. package/dist/api/revolve.js.map +1 -1
  289. package/dist/api/screw.d.ts +3 -0
  290. package/dist/api/screw.d.ts.map +1 -1
  291. package/dist/api/screw.js +9 -4
  292. package/dist/api/screw.js.map +1 -1
  293. package/dist/api/sdf.d.ts +1 -1
  294. package/dist/api/section-by-plane.d.ts +42 -0
  295. package/dist/api/section-by-plane.d.ts.map +1 -0
  296. package/dist/api/section-by-plane.js +61 -0
  297. package/dist/api/section-by-plane.js.map +1 -0
  298. package/dist/api/shell.d.ts +45 -0
  299. package/dist/api/shell.d.ts.map +1 -0
  300. package/dist/api/shell.js +73 -0
  301. package/dist/api/shell.js.map +1 -0
  302. package/dist/api/sketch.d.ts +8 -1
  303. package/dist/api/sketch.d.ts.map +1 -1
  304. package/dist/api/sketch.js +12 -7
  305. package/dist/api/sketch.js.map +1 -1
  306. package/dist/api/split-by-plane.d.ts +41 -0
  307. package/dist/api/split-by-plane.d.ts.map +1 -0
  308. package/dist/api/split-by-plane.js +60 -0
  309. package/dist/api/split-by-plane.js.map +1 -0
  310. package/dist/api/split.d.ts +6 -1
  311. package/dist/api/split.d.ts.map +1 -1
  312. package/dist/api/split.js +23 -9
  313. package/dist/api/split.js.map +1 -1
  314. package/dist/api/surface/arg-spec.d.ts +22 -0
  315. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  316. package/dist/api/surface/arg-spec.js +723 -476
  317. package/dist/api/surface/arg-spec.js.map +1 -1
  318. package/dist/api/sweep.d.ts +55 -0
  319. package/dist/api/sweep.d.ts.map +1 -0
  320. package/dist/api/sweep.js +86 -0
  321. package/dist/api/sweep.js.map +1 -0
  322. package/dist/api/thicken.d.ts +36 -0
  323. package/dist/api/thicken.d.ts.map +1 -0
  324. package/dist/api/thicken.js +55 -0
  325. package/dist/api/thicken.js.map +1 -0
  326. package/dist/api/transform.d.ts +8 -0
  327. package/dist/api/transform.d.ts.map +1 -1
  328. package/dist/api/transform.js +15 -4
  329. package/dist/api/transform.js.map +1 -1
  330. package/dist/api/view/cameraFns.d.ts +48 -0
  331. package/dist/api/view/cameraFns.d.ts.map +1 -0
  332. package/dist/api/view/cameraFns.js +75 -0
  333. package/dist/api/view/cameraFns.js.map +1 -0
  334. package/dist/api/view/projectionPlanes.d.ts +25 -0
  335. package/dist/api/view/projectionPlanes.d.ts.map +1 -0
  336. package/dist/api/view/projectionPlanes.js +30 -0
  337. package/dist/api/view/projectionPlanes.js.map +1 -0
  338. package/dist/api/view/view-camera.d.ts +2 -2
  339. package/dist/api/view/view-camera.d.ts.map +1 -1
  340. package/dist/api/view/view-camera.js +3 -3
  341. package/dist/api/view/view-camera.js.map +1 -1
  342. package/dist/api/view/view-projection.d.ts +9 -6
  343. package/dist/api/view/view-projection.d.ts.map +1 -1
  344. package/dist/api/view/view-projection.js +132 -65
  345. package/dist/api/view/view-projection.js.map +1 -1
  346. package/dist/api/wire.d.ts +45 -0
  347. package/dist/api/wire.d.ts.map +1 -0
  348. package/dist/api/wire.js +96 -0
  349. package/dist/api/wire.js.map +1 -0
  350. package/dist/boolean/creased-normals.d.ts +50 -0
  351. package/dist/boolean/creased-normals.d.ts.map +1 -0
  352. package/dist/boolean/creased-normals.js +114 -0
  353. package/dist/boolean/creased-normals.js.map +1 -0
  354. package/dist/boolean/deriveNormals.d.ts +4 -1
  355. package/dist/boolean/deriveNormals.d.ts.map +1 -1
  356. package/dist/boolean/deriveNormals.js +5 -2
  357. package/dist/boolean/deriveNormals.js.map +1 -1
  358. package/dist/brep/brep-ops.d.ts +6 -0
  359. package/dist/brep/brep-ops.d.ts.map +1 -1
  360. package/dist/brep/brep-ops.js +11 -2
  361. package/dist/brep/brep-ops.js.map +1 -1
  362. package/dist/brep/brep-topology.d.ts +4 -0
  363. package/dist/brep/brep-topology.d.ts.map +1 -1
  364. package/dist/brep/brep-topology.js +4 -0
  365. package/dist/brep/brep-topology.js.map +1 -1
  366. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  367. package/dist/brep/engine/adapters/brep-mock.js +79 -59
  368. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  369. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  370. package/dist/brep/engine/adapters/brepkit.js +7 -1
  371. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  372. package/dist/brep/engine/adapters/occt.d.ts +15 -7
  373. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  374. package/dist/brep/engine/adapters/occt.js +52 -167
  375. package/dist/brep/engine/adapters/occt.js.map +1 -1
  376. package/dist/brep/engine/primitives.d.ts +93 -130
  377. package/dist/brep/engine/primitives.d.ts.map +1 -1
  378. package/dist/brep/engine/primitives.js +9 -7
  379. package/dist/brep/engine/primitives.js.map +1 -1
  380. package/dist/brep/engine/types.d.ts +14 -1
  381. package/dist/brep/engine/types.d.ts.map +1 -1
  382. package/dist/brep/engine/types.js +11 -1
  383. package/dist/brep/engine/types.js.map +1 -1
  384. package/dist/brep/export/step.d.ts +3 -0
  385. package/dist/brep/export/step.d.ts.map +1 -1
  386. package/dist/brep/export/step.js +7 -1
  387. package/dist/brep/export/step.js.map +1 -1
  388. package/dist/brep/face-evolution.d.ts +8 -0
  389. package/dist/brep/face-evolution.d.ts.map +1 -1
  390. package/dist/brep/face-evolution.js +15 -3
  391. package/dist/brep/face-evolution.js.map +1 -1
  392. package/dist/brep/handle-bridge.d.ts +20 -2
  393. package/dist/brep/handle-bridge.d.ts.map +1 -1
  394. package/dist/brep/handle-bridge.js +25 -2
  395. package/dist/brep/handle-bridge.js.map +1 -1
  396. package/dist/brepkit-kernel/brepkitKernel.d.ts +25 -5
  397. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  398. package/dist/brepkit-kernel/brepkitKernel.js +336 -144
  399. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  400. package/dist/cad-runtime/admit-compat-lib.d.ts +6 -1
  401. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  402. package/dist/cad-runtime/admit-compat-lib.js +5 -1
  403. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  404. package/dist/cad-runtime/backend-dispatch.d.ts +9 -3
  405. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  406. package/dist/cad-runtime/backend-dispatch.js +32 -2
  407. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  408. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  409. package/dist/cad-runtime/direct-executor.js +8 -2
  410. package/dist/cad-runtime/direct-executor.js.map +1 -1
  411. package/dist/cad-runtime/runtime.d.ts +3 -0
  412. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  413. package/dist/cad-runtime/runtime.js +3 -1
  414. package/dist/cad-runtime/runtime.js.map +1 -1
  415. package/dist/define-op.d.ts +18 -2
  416. package/dist/define-op.d.ts.map +1 -1
  417. package/dist/define-op.js +29 -1
  418. package/dist/define-op.js.map +1 -1
  419. package/dist/env-agnostic.d.ts +3 -0
  420. package/dist/env-agnostic.d.ts.map +1 -1
  421. package/dist/env-agnostic.js +7 -0
  422. package/dist/env-agnostic.js.map +1 -1
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +3 -4
  425. package/dist/index.js.map +1 -1
  426. package/dist/lang/symbol-table.generated.d.ts +28 -0
  427. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  428. package/dist/lang/symbol-table.generated.js +29 -1
  429. package/dist/lang/symbol-table.generated.js.map +1 -1
  430. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  431. package/dist/occt-kernel/highLevelApi.js +6 -3
  432. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  433. package/dist/occt-kernel/hullGeometry.d.ts +31 -0
  434. package/dist/occt-kernel/hullGeometry.d.ts.map +1 -0
  435. package/dist/occt-kernel/hullGeometry.js +319 -0
  436. package/dist/occt-kernel/hullGeometry.js.map +1 -0
  437. package/dist/occt-kernel/hullOps.d.ts +24 -0
  438. package/dist/occt-kernel/hullOps.d.ts.map +1 -0
  439. package/dist/occt-kernel/hullOps.js +52 -0
  440. package/dist/occt-kernel/hullOps.js.map +1 -0
  441. package/dist/occt-kernel/occt-primitives.d.ts +14 -0
  442. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -0
  443. package/dist/occt-kernel/occt-primitives.js +351 -0
  444. package/dist/occt-kernel/occt-primitives.js.map +1 -0
  445. package/dist/occt-kernel/occtKernel.d.ts +14 -6
  446. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  447. package/dist/occt-kernel/occtKernel.js +11 -3
  448. package/dist/occt-kernel/occtKernel.js.map +1 -1
  449. package/dist/occt-kernel/topologyExt.js +2 -2
  450. package/dist/occt-kernel/topologyExt.js.map +1 -1
  451. package/dist/primitives/brep-primitives.d.ts +4 -0
  452. package/dist/primitives/brep-primitives.d.ts.map +1 -1
  453. package/dist/primitives/brep-primitives.js +4 -0
  454. package/dist/primitives/brep-primitives.js.map +1 -1
  455. package/dist/result/bug.d.ts +22 -0
  456. package/dist/result/bug.d.ts.map +1 -0
  457. package/dist/result/bug.js +28 -0
  458. package/dist/result/bug.js.map +1 -0
  459. package/dist/result/errors.d.ts +270 -0
  460. package/dist/result/errors.d.ts.map +1 -0
  461. package/dist/result/errors.js +317 -0
  462. package/dist/result/errors.js.map +1 -0
  463. package/dist/result/kernelErrorTranslation.d.ts +21 -0
  464. package/dist/result/kernelErrorTranslation.d.ts.map +1 -0
  465. package/dist/result/kernelErrorTranslation.js +102 -0
  466. package/dist/result/kernelErrorTranslation.js.map +1 -0
  467. package/dist/result/result.d.ts +213 -0
  468. package/dist/result/result.d.ts.map +1 -0
  469. package/dist/result/result.js +336 -0
  470. package/dist/result/result.js.map +1 -0
  471. package/dist/result/vec3.d.ts +12 -0
  472. package/dist/result/vec3.d.ts.map +1 -0
  473. package/dist/result/vec3.js +14 -0
  474. package/dist/result/vec3.js.map +1 -0
  475. package/dist/runtime-state.d.ts +9 -0
  476. package/dist/runtime-state.d.ts.map +1 -1
  477. package/dist/runtime-state.js.map +1 -1
  478. package/dist/sdk.d.ts +3 -1
  479. package/dist/sdk.d.ts.map +1 -1
  480. package/dist/sdk.js +2 -1
  481. package/dist/sdk.js.map +1 -1
  482. package/dist/shape.d.ts +43 -1
  483. package/dist/shape.d.ts.map +1 -1
  484. package/dist/shape.js +57 -1
  485. package/dist/shape.js.map +1 -1
  486. package/dist/topology/naming/geom-hint.js +1 -1
  487. package/dist/topology/naming/geom-hint.js.map +1 -1
  488. package/dist/topology/naming/score.js +1 -1
  489. package/dist/topology/naming/score.js.map +1 -1
  490. package/package.json +6 -16
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Self-hosted compat-op implementations — topology transform family
3
+ * (core-decouple Phase 3, §5.4).
4
+ *
5
+ * @platform occt
6
+ *
7
+ * Each export is a "brep-shaped" implementation consumed by the generated
8
+ * compat-op projection (defineOp + D11 arg normalization). Inputs are the
9
+ * normalized positional arguments of the op's params table; shapes arrive as
10
+ * faijs Shapes (or raw handles) and results are returned as BREP handles
11
+ * (wrapped by `wrapBrepOne` → `fromHandle`).
12
+ *
13
+ * Semantics mirror the vendored brepjs fns (`topology/transformFns.ts`,
14
+ * `topology/shapeFns.ts`) with the brepjs object model (castResultShape,
15
+ * metadata propagation, evolution tracking) dropped: occt-wasm handles only.
16
+ */
17
+ import { getBrepApi } from '../../brep/handle-bridge.js';
18
+ import { ok, err } from '../../result/result.js';
19
+ import { kernelError, validationError } from '../../result/errors.js';
20
+ import { resolveArgs } from '../internal/dual-form-args.js';
21
+ import { brepHandleOf, composeAffine, IDENTITY_3X4, rotationMatrix, translationMatrix } from './brepHelpers.js';
22
+ import { getOcctKernel } from '../../occt-kernel/occtKernel.js';
23
+ const VALIDATION_FAILED = 'VALIDATION_FAILED';
24
+ function parseMatrixInput(input) {
25
+ if ('linear' in input) {
26
+ return ok({ linear: input.linear, translation: input.translation });
27
+ }
28
+ const [r0, r1, r2, r3] = input;
29
+ const TOL = 1e-10;
30
+ if (Math.abs(r3[0]) > TOL || Math.abs(r3[1]) > TOL || Math.abs(r3[2]) > TOL || Math.abs(r3[3] - 1) > TOL) {
31
+ return err(validationError(VALIDATION_FAILED, `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.`));
32
+ }
33
+ return ok({
34
+ linear: [r0[0], r0[1], r0[2], r1[0], r1[1], r1[2], r2[0], r2[1], r2[2]],
35
+ translation: [r0[3], r1[3], r2[3]],
36
+ });
37
+ }
38
+ function det3x3(m) {
39
+ return (m[0] * (m[4] * m[8] - m[5] * m[7]) -
40
+ m[1] * (m[3] * m[8] - m[5] * m[6]) +
41
+ m[2] * (m[3] * m[7] - m[4] * m[6]));
42
+ }
43
+ // ---------------------------------------------------------------------------
44
+ // applyMatrix
45
+ // ---------------------------------------------------------------------------
46
+ const APPLY_MATRIX_PARAMS = { name: 'applyMatrix', params: ['shape', 'matrix'], formClass: 'A' };
47
+ /**
48
+ * Apply a 4×4 affine matrix (OpenSCAD `multmatrix` equivalent).
49
+ *
50
+ * The vendored fn splits orthogonal (evolution-tracked) and non-orthogonal
51
+ * (`gp_GTrsf`) paths; the core path uses the single L1 `generalTransform`
52
+ * (occt-wasm `gp_GTrsf`, geometrically equivalent for both classes) since
53
+ * `applyMatrix` carries identity naming and needs no face evolution.
54
+ *
55
+ * @param args - Resolved arguments (shape, matrix).
56
+ * @returns The transformed shape as a `BrepHandle`.
57
+ */
58
+ export function applyMatrixBrep(...args) {
59
+ const [shape, matrix] = resolveArgs(args, APPLY_MATRIX_PARAMS);
60
+ const parsed = parseMatrixInput(matrix);
61
+ if (!parsed.ok)
62
+ return parsed;
63
+ const { linear, translation } = parsed.value;
64
+ if (Math.abs(det3x3(linear)) < 1e-12) {
65
+ return err(validationError(VALIDATION_FAILED, 'applyMatrix: singular matrix (determinant ≈0). Cannot apply a non-invertible transform.'));
66
+ }
67
+ const kernel = getBrepApi();
68
+ try {
69
+ const m12 = [
70
+ linear[0], linear[1], linear[2], translation[0],
71
+ linear[3], linear[4], linear[5], translation[1],
72
+ linear[6], linear[7], linear[8], translation[2],
73
+ ];
74
+ // GOTCHA (2026-09-25): occt-wasm's `located`/`generalTransform` return
75
+ // TopLoc/GTrsf-referencing handles whose STEP export crashes
76
+ // ("memory access out of bounds") — only the affine `transform`
77
+ // (BRepBuilderAPI_Transform, deep-copy) is STEP-safe. A similar
78
+ // transform (orthogonal rows, equal lengths) is affine and goes
79
+ // through `transform`; genuinely non-affine matrices keep the
80
+ // generalTransform path (no current caller, pre-existing behavior).
81
+ const lin = linear;
82
+ const s0 = Math.hypot(lin[0], lin[1], lin[2]);
83
+ const s1 = Math.hypot(lin[3], lin[4], lin[5]);
84
+ const s2 = Math.hypot(lin[6], lin[7], lin[8]);
85
+ const dot01 = Math.abs(lin[0] * lin[3] + lin[1] * lin[4] + lin[2] * lin[5]);
86
+ const dot02 = Math.abs(lin[0] * lin[6] + lin[1] * lin[7] + lin[2] * lin[8]);
87
+ const dot12 = Math.abs(lin[3] * lin[6] + lin[4] * lin[7] + lin[5] * lin[8]);
88
+ const TOL = 1e-9;
89
+ const similar = s0 > TOL && Math.abs(s1 - s0) < TOL && Math.abs(s2 - s0) < TOL &&
90
+ dot01 < TOL && dot02 < TOL && dot12 < TOL;
91
+ return ok(similar ? kernel.transform(brepHandleOf(shape), m12) : kernel.generalTransform(brepHandleOf(shape), m12));
92
+ }
93
+ catch (e) {
94
+ return err(kernelError('APPLY_MATRIX_FAILED', `applyMatrix: kernel transform failed: ${e instanceof Error ? e.message : String(e)}`, e));
95
+ }
96
+ }
97
+ // ---------------------------------------------------------------------------
98
+ // clone
99
+ // ---------------------------------------------------------------------------
100
+ const CLONE_PARAMS = { name: 'clone', params: ['shape'], formClass: 'A' };
101
+ /**
102
+ * Deep-copy a shape (`kernel.copyShape`).
103
+ *
104
+ * @param args - Resolved arguments (shape).
105
+ * @returns The cloned shape as a `BrepHandle`.
106
+ */
107
+ export function cloneBrep(...args) {
108
+ const [shape] = resolveArgs(args, CLONE_PARAMS);
109
+ const kernel = getBrepApi();
110
+ try {
111
+ return ok(kernel.copyShape(brepHandleOf(shape)));
112
+ }
113
+ catch (e) {
114
+ return err(kernelError('CLONE_FAILED', `clone: kernel copy failed: ${e instanceof Error ? e.message : String(e)}`, e));
115
+ }
116
+ }
117
+ // ---------------------------------------------------------------------------
118
+ // locate
119
+ // ---------------------------------------------------------------------------
120
+ const LOCATE_PARAMS = { name: 'locate', params: ['shape', 'placement'], formClass: 'A' };
121
+ function opToMatrix(op) {
122
+ if (op.type === 'translate')
123
+ return translationMatrix(op.v);
124
+ const axis = op.axis ?? [0, 0, 1];
125
+ const center = op.center ?? [0, 0, 0];
126
+ return rotationMatrix(axis, center, op.angle);
127
+ }
128
+ /**
129
+ * Placement-only rigid move (translate/rotate) via the kernel's cheap location
130
+ * re-tag. Ops apply first-to-last (rotate then translate).
131
+ *
132
+ * @param args - Resolved arguments (shape, placement).
133
+ * @returns The relocated shape as a `BrepHandle`.
134
+ */
135
+ export function locateBrep(...args) {
136
+ const [shape, placement] = resolveArgs(args, LOCATE_PARAMS);
137
+ const ops = placement !== null && typeof placement === 'object' && 'type' in placement
138
+ ? [placement]
139
+ : placement;
140
+ const kernel = getBrepApi();
141
+ try {
142
+ let acc = [...IDENTITY_3X4];
143
+ for (const op of ops)
144
+ acc = composeAffine(acc, opToMatrix(op));
145
+ return ok(kernel.locate(brepHandleOf(shape), acc));
146
+ }
147
+ catch (e) {
148
+ return err(kernelError('LOCATE_FAILED', `locate: kernel locate failed: ${e instanceof Error ? e.message : String(e)}`, e));
149
+ }
150
+ }
151
+ // ---------------------------------------------------------------------------
152
+ // mirror
153
+ // ---------------------------------------------------------------------------
154
+ const MIRROR_PARAMS = { name: 'mirror', params: ['shape', 'options'], formClass: 'A' };
155
+ /**
156
+ * Mirror across a plane defined by `options.at` (origin) and `options.normal`.
157
+ *
158
+ * @param args - Resolved arguments (shape, mirror options).
159
+ * @returns The mirrored shape as a `BrepHandle`.
160
+ */
161
+ export function mirrorBrep(...args) {
162
+ const [shape, options] = resolveArgs(args, MIRROR_PARAMS);
163
+ const opts = (options ?? {});
164
+ const normal = opts.normal ?? [1, 0, 0];
165
+ const at = opts.at ?? [0, 0, 0];
166
+ const kernel = getBrepApi();
167
+ try {
168
+ return ok(kernel.mirror(brepHandleOf(shape), { x: at[0], y: at[1], z: at[2] }, { x: normal[0], y: normal[1], z: normal[2] }));
169
+ }
170
+ catch (e) {
171
+ return err(kernelError('MIRROR_FAILED', `mirror: kernel mirror failed: ${e instanceof Error ? e.message : String(e)}`, e));
172
+ }
173
+ }
174
+ // ---------------------------------------------------------------------------
175
+ // rotate — 绕轴旋转(vendored topology/api.js#rotate + transformFns.ts#rotate)// ---------------------------------------------------------------------------
176
+ const ROTATE_PARAMS = { name: 'rotate', params: ['shape', 'angle', 'options'], formClass: 'A' };
177
+ /**
178
+ * Rotate the shape around an axis (vendored topology/api.js#rotate + transformFns.ts#rotate).
179
+ *
180
+ * @param args - Resolved arguments (shape, angle in degrees, axis options).
181
+ * @returns The rotated shape as a `BrepHandle`.
182
+ */
183
+ export function rotateBrep(...args) {
184
+ const [shape, angle, options] = resolveArgs(args, ROTATE_PARAMS);
185
+ const s = brepHandleOf(shape);
186
+ const { at = [0, 0, 0], axis = [0, 0, 1] } = (options ?? {});
187
+ try {
188
+ // GOTCHA (2026-09-25): occt-wasm's native `rotate` returns a handle whose
189
+ // STEP export crashes ("memory access out of bounds") — same family as
190
+ // located/generalTransform. Rotation is affine, so build the Rodrigues
191
+ // matrix and go through the STEP-safe `transform` (BRepBuilderAPI_Transform).
192
+ const [ax, ay, az] = axis;
193
+ const alen = Math.hypot(ax, ay, az);
194
+ if (alen < 1e-12) {
195
+ return err(validationError('INVALID_AXIS', `rotate: axis must be non-zero, got [${ax}, ${ay}, ${az}]`));
196
+ }
197
+ const nx = ax / alen, ny = ay / alen, nz = az / alen;
198
+ const theta = (Number(angle) * Math.PI) / 180;
199
+ const c = Math.cos(theta), sTheta = Math.sin(theta), t = 1 - c;
200
+ // R = cI + sK + t·(n⊗n) (Rodrigues)
201
+ const r00 = t * nx * nx + c, r01 = t * nx * ny - nz * sTheta, r02 = t * nx * nz + ny * sTheta;
202
+ const r10 = t * nx * ny + nz * sTheta, r11 = t * ny * ny + c, r12 = t * ny * nz - nx * sTheta;
203
+ const r20 = t * nx * nz - ny * sTheta, r21 = t * ny * nz + nx * sTheta, r22 = t * nz * nz + c;
204
+ const [px, py, pz] = at;
205
+ // Pivot-preserving translation: p' = R·(p − at) + at ⇒ tx = at − R·at
206
+ const tx = px - (r00 * px + r01 * py + r02 * pz);
207
+ const ty = py - (r10 * px + r11 * py + r12 * pz);
208
+ const tz = pz - (r20 * px + r21 * py + r22 * pz);
209
+ const m12 = [r00, r01, r02, tx, r10, r11, r12, ty, r20, r21, r22, tz];
210
+ return ok(getOcctKernel().transform(s, m12));
211
+ }
212
+ catch (e) {
213
+ const raw = e instanceof Error ? e.message : String(e);
214
+ return err(kernelError('ROTATE_FAILED', `Rotate operation failed: ${raw}`, e));
215
+ }
216
+ }
217
+ // ---------------------------------------------------------------------------
218
+ // shell — 去面掏空(vendored topology/api.js#shell + modifierFns.ts#shell)// ---------------------------------------------------------------------------
219
+ const SHELL_PARAMS = { name: 'shell', params: ['shape', 'faces', 'thickness', 'options'], formClass: 'A' };
220
+ /**
221
+ * Shell — hollow the shape by removing faces (vendored topology/api.js#shell + modifierFns.ts#shell).
222
+ *
223
+ * @param args - Resolved arguments (shape, faces, thickness, options).
224
+ * @returns The shelled (hollowed) shape as a `BrepHandle`.
225
+ */
226
+ export function shellBrep(...args) {
227
+ const [shape, faces, thickness, options] = resolveArgs(args, SHELL_PARAMS);
228
+ const kernel = getBrepApi();
229
+ const s = brepHandleOf(shape);
230
+ const t = Number(thickness);
231
+ if (t <= 0) {
232
+ return err(validationError('INVALID_THICKNESS', 'Shell thickness must be positive'));
233
+ }
234
+ if (!Array.isArray(faces) || faces.length === 0) {
235
+ return err(validationError('NO_FACES', 'At least one face must be specified for shell'));
236
+ }
237
+ const faceHandles = faces.map((f) => brepHandleOf(f));
238
+ const tolerance = (options ?? {}).tolerance ?? 1e-3;
239
+ try {
240
+ return ok(kernel.shell(s, faceHandles, t, tolerance));
241
+ }
242
+ catch (e) {
243
+ const raw = e instanceof Error ? e.message : String(e);
244
+ return err(kernelError('SHELL_FAILED', `Shell operation failed: ${raw}`, e));
245
+ }
246
+ }
247
+ // ---------------------------------------------------------------------------
248
+ // offset — 全表面偏移(vendored topology/api.js#offset + modifierFns.ts#offset)// ---------------------------------------------------------------------------
249
+ const OFFSET_PARAMS = { name: 'offset', params: ['shape', 'distance', 'options'], formClass: 'A' };
250
+ /**
251
+ * Offset all faces of the shape (vendored topology/api.js#offset + modifierFns.ts#offset).
252
+ *
253
+ * @param args - Resolved arguments (shape, distance, options).
254
+ * @returns The offset shape as a `BrepHandle`.
255
+ */
256
+ export function offsetBrep(...args) {
257
+ const [shape, distance, options] = resolveArgs(args, OFFSET_PARAMS);
258
+ const s = brepHandleOf(shape);
259
+ const d = Number(distance);
260
+ if (Math.abs(d) < 1e-10) {
261
+ return err(validationError('ZERO_OFFSET', 'Offset distance cannot be zero'));
262
+ }
263
+ const tolerance = (options ?? {}).tolerance ?? 1e-6;
264
+ try {
265
+ const h = getOcctKernel().offset(s, d, tolerance);
266
+ return ok(h);
267
+ }
268
+ catch (e) {
269
+ const raw = e instanceof Error ? e.message : String(e);
270
+ return err(kernelError('OFFSET_FAILED', `Offset operation failed: ${raw}`, e));
271
+ }
272
+ }
273
+ //# sourceMappingURL=topologyFns.js.map
@@ -0,0 +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;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,C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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 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(getOcctKernel().transform(s as never, m12) as unknown as BrepHandle)\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"]}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * brep-topology — faijs BREP 拓扑查询 / 构造面(core-decouple wrapup §2.2)
3
+ *
4
+ * @platform occt — `outerWire` / `normalAt`(带点路径)走 occt 原生面
5
+ * `getOcctKernel()`(occt-only 能力,未进 L1 中立契约);其余经 L1
6
+ * `BrepEngineApi`。sheetmetal 钣金库改写的消费面(原 §5.8)。
7
+ *
8
+ * faijs 风格(wrapup §0.1 判据):全部同步;`Shape` 进、`Shape` 家族
9
+ * (CurveShape/SolidShape)出——子形状可直接再喂回 faijs op(建模链
10
+ * `face(...)` → `extrude(...)` 零适配);曲面类型为内核中立串
11
+ * ('plane'/'cylinder'/…);错误用 faijs 第一方 `Result` + `BrepErrorCode`。
12
+ * **不提供 brepjs 兼容面**(裁决 9:brepjs 兼容层不由本 monorepo 提供),
13
+ * 不复刻 brepjs 符号名 / 法文枚举 / 包装句柄形态。
14
+ */
15
+ import type { Shape } from '../mesh/types.js';
16
+ import type { Vec3 } from './brepjs-compat/types.js';
17
+ import type { CurveShape, SolidShape } from '../shape.js';
18
+ import { type Result } from '../result/result.js';
19
+ /**
20
+ * Get all edges of a shape as faijs curve shapes.
21
+ *
22
+ * @param shape - a faijs Shape on the BREP chain.
23
+ * @returns the edge curve shapes of the shape.
24
+ */
25
+ export declare function getEdges(shape: Shape): CurveShape[];
26
+ /**
27
+ * Get all faces of a shape as faijs solid shapes.
28
+ *
29
+ * @param shape - a faijs Shape on the BREP chain.
30
+ * @returns the face shapes of the shape.
31
+ */
32
+ export declare function getFaces(shape: Shape): SolidShape[];
33
+ /**
34
+ * Get all solids of a shape as faijs solid shapes.
35
+ *
36
+ * Booleans (`cut`/`fuse`) and some sweeps return a compound wrapping the
37
+ * solid(s); use this to unwrap them without reaching into the kernel.
38
+ *
39
+ * @param shape - a faijs Shape on the BREP chain.
40
+ * @returns the solid shapes of the shape.
41
+ */
42
+ export declare function getSolids(shape: Shape): SolidShape[];
43
+ /**
44
+ * Check whether a shape is a solid.
45
+ *
46
+ * @param shape - a faijs Shape on the BREP chain.
47
+ * @returns true when the shape is a solid.
48
+ */
49
+ export declare function isSolid(shape: Shape): boolean;
50
+ /**
51
+ * Axis-aligned bounding box of a shape from the BREP kernel.
52
+ *
53
+ * 说明:`cad.boundingBox` 只读 mesh 载荷(positions),brep 产物(空载荷)
54
+ * 会得空盒;本出口直连引擎包围盒,供 sheetmetal 侧组合 `Bounds3D`。
55
+ *
56
+ * @param shape - a faijs Shape on the BREP chain.
57
+ * @returns the bounding box min/max corner points.
58
+ */
59
+ export declare function bounds3D(shape: Shape): {
60
+ min: Vec3;
61
+ max: Vec3;
62
+ };
63
+ /**
64
+ * Get the geometric surface type of a face (kernel neutral string).
65
+ *
66
+ * @param face - a faijs face Shape (from `getFaces`).
67
+ * @returns ok with the surface type ('plane' / 'cylinder' / 'sphere' / …).
68
+ */
69
+ export declare function getSurfaceType(face: Shape): Result<string>;
70
+ /**
71
+ * Get the start point of an edge or wire curve.
72
+ *
73
+ * @param shape - an edge/wire faijs Shape.
74
+ * @returns the curve start point.
75
+ */
76
+ export declare function curveStartPoint(shape: Shape): Vec3;
77
+ /**
78
+ * Get the end point of an edge or wire curve.
79
+ *
80
+ * @param shape - an edge/wire faijs Shape.
81
+ * @returns the curve end point.
82
+ */
83
+ export declare function curveEndPoint(shape: Shape): Vec3;
84
+ /**
85
+ * Get the center of mass of a face.
86
+ *
87
+ * @param face - a faijs face Shape (from `getFaces`).
88
+ * @returns the face center point.
89
+ */
90
+ export declare function faceCenter(face: Shape): Vec3;
91
+ /**
92
+ * Get the surface normal at a point (or at the UV-center when no point given).
93
+ *
94
+ * When a 3D point is given, it is projected to UV coordinates via the occt
95
+ * native `uvFromPoint` (occt-only; falls back to UV origin when the projection
96
+ * fails).
97
+ *
98
+ * @param face - a faijs face Shape (from `getFaces`).
99
+ * @param locationPoint - optional 3D point on the face.
100
+ * @returns the surface normal at the location.
101
+ */
102
+ export declare function normalAt(face: Shape, locationPoint?: Vec3): Vec3;
103
+ /**
104
+ * Get a point on a face surface at normalized UV coordinates (0-1 range).
105
+ *
106
+ * @param face - a faijs face Shape (from `getFaces`).
107
+ * @param u - normalized U parameter (0-1).
108
+ * @param v - normalized V parameter (0-1).
109
+ * @returns the surface point.
110
+ */
111
+ export declare function pointOnSurface(face: Shape, u: number, v: number): Vec3;
112
+ /**
113
+ * Get the edges shared by two faces.
114
+ *
115
+ * @param a - first faijs face Shape.
116
+ * @param b - second faijs face Shape.
117
+ * @returns the shared edge curve shapes.
118
+ */
119
+ export declare function sharedEdges(a: Shape, b: Shape): CurveShape[];
120
+ /**
121
+ * Get the outer wire of a face (occt native `BRepTools::OuterWire`).
122
+ *
123
+ * @param face - a faijs face Shape.
124
+ * @returns the outer wire curve shape.
125
+ */
126
+ export declare function outerWire(face: Shape): CurveShape;
127
+ /**
128
+ * Create a line edge between two points.
129
+ *
130
+ * @param from - start point.
131
+ * @param to - end point.
132
+ * @returns the edge curve shape.
133
+ */
134
+ export declare function line(from: Vec3, to: Vec3): CurveShape;
135
+ /**
136
+ * Check whether a wire is closed (forms a loop).
137
+ *
138
+ * @param wire - a faijs wire Shape.
139
+ * @returns true when the wire is closed.
140
+ */
141
+ export declare function isClosedWire(wire: Shape): boolean;
142
+ /**
143
+ * Assemble edges into a connected wire, open or closed (no closure check).
144
+ *
145
+ * Sheetmetal form cuts (louver U-cuts) are deliberately OPEN paths in the
146
+ * developed plane — the fabricator leaves the hinge side uncut — so the
147
+ * topology face must be able to produce a non-closed wire. {@link wireLoop}
148
+ * adds the closure contract on top of this primitive.
149
+ *
150
+ * @param edges - ordered edge curve shapes to assemble.
151
+ * @returns ok with the assembled wire shape, or WIRE_BUILD_FAILED.
152
+ */
153
+ export declare function assembleWire(edges: Shape[]): Result<CurveShape>;
154
+ /**
155
+ * Assemble edges into a connected wire, requiring the result to be closed.
156
+ *
157
+ * @param edges - ordered edge curve shapes to assemble.
158
+ * @returns ok with the closed wire shape, or WIRE_BUILD_FAILED /
159
+ * WIRE_NOT_CLOSED.
160
+ */
161
+ export declare function wireLoop(edges: Shape[]): Result<CurveShape>;
162
+ /**
163
+ * Check whether a wire is planar (all edges lie in a common plane).
164
+ *
165
+ * Strategy: try planar face construction; if it succeeds, verify the surface
166
+ * type. A failure to build the face means the wire is not planar.
167
+ *
168
+ * @param wire - a faijs wire Shape.
169
+ * @returns true when the wire is planar.
170
+ */
171
+ export declare function isPlanarWire(wire: Shape): boolean;
172
+ /**
173
+ * Create a planar face from a closed wire, optionally with holes.
174
+ *
175
+ * The result is a faijs solid Shape carrying the face BREP handle, ready for
176
+ * the modeling chain (`extrude` etc.).
177
+ *
178
+ * @param w - a closed planar wire Shape.
179
+ * @param holes - optional hole wire Shapes.
180
+ * @returns ok with the face shape, or FACE_BUILD_FAILED / FACE_NOT_PLANAR.
181
+ */
182
+ export declare function face(w: Shape, holes?: Shape[]): Result<SolidShape>;
183
+ /**
184
+ * Create a polygonal face from three or more coplanar points.
185
+ *
186
+ * @param points - three or more coplanar points.
187
+ * @returns ok with the face shape, or POLYGON_MIN_POINTS / wire / face errors.
188
+ */
189
+ export declare function polygon(points: Vec3[]): Result<SolidShape>;
190
+ //# sourceMappingURL=brep-topology.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brep-topology.d.ts","sourceRoot":"","sources":["../../src/api/brep-topology.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAyBvD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK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