@faicad/faijs 0.16.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (498) hide show
  1. package/LICENSE +4 -5
  2. package/NOTICE +5 -6
  3. package/dist/api/api-namespace.d.ts.map +1 -1
  4. package/dist/api/api-namespace.js +20 -2
  5. package/dist/api/api-namespace.js.map +1 -1
  6. package/dist/api/assembly/entities.d.ts +1 -1
  7. package/dist/api/assembly/entities.d.ts.map +1 -1
  8. package/dist/api/assembly/entities.js.map +1 -1
  9. package/dist/api/assembly/joints.d.ts +2 -2
  10. package/dist/api/assembly/joints.d.ts.map +1 -1
  11. package/dist/api/assembly/joints.js +2 -2
  12. package/dist/api/assembly/joints.js.map +1 -1
  13. package/dist/api/assembly/lower.d.ts +1 -1
  14. package/dist/api/assembly/lower.d.ts.map +1 -1
  15. package/dist/api/assembly/lower.js.map +1 -1
  16. package/dist/api/assembly/pose.d.ts +3 -3
  17. package/dist/api/assembly/pose.d.ts.map +1 -1
  18. package/dist/api/assembly/pose.js +1 -1
  19. package/dist/api/assembly/pose.js.map +1 -1
  20. package/dist/api/assembly/preview.d.ts +1 -1
  21. package/dist/api/assembly/preview.d.ts.map +1 -1
  22. package/dist/api/assembly/preview.js +1 -1
  23. package/dist/api/assembly/preview.js.map +1 -1
  24. package/dist/api/assembly/solve.d.ts.map +1 -1
  25. package/dist/api/assembly/solve.js +3 -3
  26. package/dist/api/assembly/solve.js.map +1 -1
  27. package/dist/api/assembly/solvers/assembly-tree.d.ts +98 -0
  28. package/dist/api/assembly/solvers/assembly-tree.d.ts.map +1 -0
  29. package/dist/api/assembly/solvers/assembly-tree.js +130 -0
  30. package/dist/api/assembly/solvers/assembly-tree.js.map +1 -0
  31. package/dist/api/assembly/solvers/chain-solver.d.ts +27 -0
  32. package/dist/api/assembly/solvers/chain-solver.d.ts.map +1 -0
  33. package/dist/api/assembly/solvers/chain-solver.js +330 -0
  34. package/dist/api/assembly/solvers/chain-solver.js.map +1 -0
  35. package/dist/api/assembly/solvers/global-solver.js +2 -2
  36. package/dist/api/assembly/solvers/global-solver.js.map +1 -1
  37. package/dist/api/assembly/solvers/joints-kinematics.d.ts +308 -0
  38. package/dist/api/assembly/solvers/joints-kinematics.d.ts.map +1 -0
  39. package/dist/api/assembly/solvers/joints-kinematics.js +643 -0
  40. package/dist/api/assembly/solvers/joints-kinematics.js.map +1 -0
  41. package/dist/api/assembly/solvers/quat.d.ts +35 -0
  42. package/dist/api/assembly/solvers/quat.d.ts.map +1 -0
  43. package/dist/api/assembly/solvers/quat.js +84 -0
  44. package/dist/api/assembly/solvers/quat.js.map +1 -0
  45. package/dist/api/assembly/solvers/types.d.ts +33 -0
  46. package/dist/api/assembly/solvers/types.d.ts.map +1 -1
  47. package/dist/api/assembly/solvers/types.js.map +1 -1
  48. package/dist/api/boolean.d.ts.map +1 -1
  49. package/dist/api/boolean.js +66 -29
  50. package/dist/api/boolean.js.map +1 -1
  51. package/dist/api/brep-mirror/booleanFns.d.ts +40 -0
  52. package/dist/api/brep-mirror/booleanFns.d.ts.map +1 -0
  53. package/dist/api/brep-mirror/booleanFns.js +104 -0
  54. package/dist/api/brep-mirror/booleanFns.js.map +1 -0
  55. package/dist/api/brep-mirror/brepHelpers.d.ts +55 -0
  56. package/dist/api/brep-mirror/brepHelpers.d.ts.map +1 -0
  57. package/dist/api/brep-mirror/brepHelpers.js +131 -0
  58. package/dist/api/brep-mirror/brepHelpers.js.map +1 -0
  59. package/dist/api/brep-mirror/compoundFns.d.ts +47 -0
  60. package/dist/api/brep-mirror/compoundFns.d.ts.map +1 -0
  61. package/dist/api/brep-mirror/compoundFns.js +300 -0
  62. package/dist/api/brep-mirror/compoundFns.js.map +1 -0
  63. package/dist/api/brep-mirror/healingFns.d.ts +78 -0
  64. package/dist/api/brep-mirror/healingFns.d.ts.map +1 -0
  65. package/dist/api/brep-mirror/healingFns.js +294 -0
  66. package/dist/api/brep-mirror/healingFns.js.map +1 -0
  67. package/dist/api/brep-mirror/hullFns.d.ts +20 -0
  68. package/dist/api/brep-mirror/hullFns.d.ts.map +1 -0
  69. package/dist/api/brep-mirror/hullFns.js +46 -0
  70. package/dist/api/brep-mirror/hullFns.js.map +1 -0
  71. package/dist/api/brep-mirror/patternFns.d.ts +43 -0
  72. package/dist/api/brep-mirror/patternFns.d.ts.map +1 -0
  73. package/dist/api/brep-mirror/patternFns.js +178 -0
  74. package/dist/api/brep-mirror/patternFns.js.map +1 -0
  75. package/dist/api/brep-mirror/primitiveFns.d.ts +42 -0
  76. package/dist/api/brep-mirror/primitiveFns.d.ts.map +1 -0
  77. package/dist/api/brep-mirror/primitiveFns.js +104 -0
  78. package/dist/api/brep-mirror/primitiveFns.js.map +1 -0
  79. package/dist/api/brep-mirror/roofFns.d.ts +24 -0
  80. package/dist/api/brep-mirror/roofFns.d.ts.map +1 -0
  81. package/dist/api/brep-mirror/roofFns.js +229 -0
  82. package/dist/api/brep-mirror/roofFns.js.map +1 -0
  83. package/dist/api/brep-mirror/straightSkeleton.d.ts +36 -0
  84. package/dist/api/brep-mirror/straightSkeleton.d.ts.map +1 -0
  85. package/dist/api/brep-mirror/straightSkeleton.js +443 -0
  86. package/dist/api/brep-mirror/straightSkeleton.js.map +1 -0
  87. package/dist/api/brep-mirror/sweepFns.d.ts +55 -0
  88. package/dist/api/brep-mirror/sweepFns.d.ts.map +1 -0
  89. package/dist/api/brep-mirror/sweepFns.js +200 -0
  90. package/dist/api/brep-mirror/sweepFns.js.map +1 -0
  91. package/dist/api/brep-mirror/threadFns.d.ts +15 -0
  92. package/dist/api/brep-mirror/threadFns.d.ts.map +1 -1
  93. package/dist/api/brep-mirror/threadFns.js +37 -2
  94. package/dist/api/brep-mirror/threadFns.js.map +1 -1
  95. package/dist/api/brep-mirror/topologyFns.d.ts +74 -0
  96. package/dist/api/brep-mirror/topologyFns.d.ts.map +1 -0
  97. package/dist/api/brep-mirror/topologyFns.js +276 -0
  98. package/dist/api/brep-mirror/topologyFns.js.map +1 -0
  99. package/dist/api/brep-topology.d.ts +190 -0
  100. package/dist/api/brep-topology.d.ts.map +1 -0
  101. package/dist/api/brep-topology.js +337 -0
  102. package/dist/api/brep-topology.js.map +1 -0
  103. package/dist/api/brepjs-compat/constants.d.ts +11 -0
  104. package/dist/api/brepjs-compat/constants.d.ts.map +1 -0
  105. package/dist/api/brepjs-compat/constants.js +11 -0
  106. package/dist/api/brepjs-compat/constants.js.map +1 -0
  107. package/dist/api/brepjs-compat/index.d.ts +19 -232
  108. package/dist/api/brepjs-compat/index.d.ts.map +1 -1
  109. package/dist/api/brepjs-compat/index.js +19 -286
  110. package/dist/api/brepjs-compat/index.js.map +1 -1
  111. package/dist/api/brepjs-compat/planeOps.d.ts +98 -0
  112. package/dist/api/brepjs-compat/planeOps.d.ts.map +1 -0
  113. package/dist/api/brepjs-compat/planeOps.js +170 -0
  114. package/dist/api/brepjs-compat/planeOps.js.map +1 -0
  115. package/dist/api/brepjs-compat/planeTypes.d.ts +24 -0
  116. package/dist/api/brepjs-compat/planeTypes.d.ts.map +1 -0
  117. package/dist/api/brepjs-compat/planeTypes.js +8 -0
  118. package/dist/api/brepjs-compat/planeTypes.js.map +1 -0
  119. package/dist/api/brepjs-compat/types.d.ts +64 -0
  120. package/dist/api/brepjs-compat/types.d.ts.map +1 -0
  121. package/dist/api/brepjs-compat/types.js +48 -0
  122. package/dist/api/brepjs-compat/types.js.map +1 -0
  123. package/dist/api/brepjs-compat/vecOps.d.ts +124 -0
  124. package/dist/api/brepjs-compat/vecOps.d.ts.map +1 -0
  125. package/dist/api/brepjs-compat/vecOps.js +202 -0
  126. package/dist/api/brepjs-compat/vecOps.js.map +1 -0
  127. package/dist/api/chamfer.d.ts +12 -3
  128. package/dist/api/chamfer.d.ts.map +1 -1
  129. package/dist/api/chamfer.js +54 -20
  130. package/dist/api/chamfer.js.map +1 -1
  131. package/dist/api/compound-geom.d.ts.map +1 -1
  132. package/dist/api/compound-geom.js +8 -2
  133. package/dist/api/compound-geom.js.map +1 -1
  134. package/dist/api/draft.d.ts +69 -0
  135. package/dist/api/draft.d.ts.map +1 -0
  136. package/dist/api/draft.js +109 -0
  137. package/dist/api/draft.js.map +1 -0
  138. package/dist/api/edge-ref.d.ts.map +1 -1
  139. package/dist/api/edge-ref.js +2 -2
  140. package/dist/api/edge-ref.js.map +1 -1
  141. package/dist/api/engrave.d.ts.map +1 -1
  142. package/dist/api/engrave.js +2 -3
  143. package/dist/api/engrave.js.map +1 -1
  144. package/dist/api/extrude.d.ts.map +1 -1
  145. package/dist/api/extrude.js +44 -14
  146. package/dist/api/extrude.js.map +1 -1
  147. package/dist/api/face-ref.d.ts.map +1 -1
  148. package/dist/api/face-ref.js +2 -2
  149. package/dist/api/face-ref.js.map +1 -1
  150. package/dist/api/feature-repair.d.ts +137 -0
  151. package/dist/api/feature-repair.d.ts.map +1 -0
  152. package/dist/api/feature-repair.js +221 -0
  153. package/dist/api/feature-repair.js.map +1 -0
  154. package/dist/api/fillet-variable.d.ts +35 -0
  155. package/dist/api/fillet-variable.d.ts.map +1 -0
  156. package/dist/api/fillet-variable.js +71 -0
  157. package/dist/api/fillet-variable.js.map +1 -0
  158. package/dist/api/fillet.d.ts +3 -0
  159. package/dist/api/fillet.d.ts.map +1 -1
  160. package/dist/api/fillet.js +7 -4
  161. package/dist/api/fillet.js.map +1 -1
  162. package/dist/api/generated/2d.d.ts +1 -13
  163. package/dist/api/generated/2d.d.ts.map +1 -1
  164. package/dist/api/generated/2d.js +6 -1
  165. package/dist/api/generated/2d.js.map +1 -1
  166. package/dist/api/generated/brepjs/index.d.ts +298 -298
  167. package/dist/api/generated/brepjs/index.d.ts.map +1 -1
  168. package/dist/api/generated/brepjs/index.js +183 -183
  169. package/dist/api/generated/brepjs/index.js.map +1 -1
  170. package/dist/api/generated/core.d.ts +3 -123
  171. package/dist/api/generated/core.d.ts.map +1 -1
  172. package/dist/api/generated/core.js +2 -81
  173. package/dist/api/generated/core.js.map +1 -1
  174. package/dist/api/generated/gear.d.ts +1 -15
  175. package/dist/api/generated/gear.d.ts.map +1 -1
  176. package/dist/api/generated/gear.js +6 -3
  177. package/dist/api/generated/gear.js.map +1 -1
  178. package/dist/api/generated/io.d.ts +1 -13
  179. package/dist/api/generated/io.d.ts.map +1 -1
  180. package/dist/api/generated/io.js +6 -1
  181. package/dist/api/generated/io.js.map +1 -1
  182. package/dist/api/generated/kernel.d.ts +1 -39
  183. package/dist/api/generated/kernel.d.ts.map +1 -1
  184. package/dist/api/generated/kernel.js +6 -4
  185. package/dist/api/generated/kernel.js.map +1 -1
  186. package/dist/api/generated/measurement.d.ts +53 -97
  187. package/dist/api/generated/measurement.d.ts.map +1 -1
  188. package/dist/api/generated/measurement.js +48 -143
  189. package/dist/api/generated/measurement.js.map +1 -1
  190. package/dist/api/generated/ns.d.ts +1 -10
  191. package/dist/api/generated/ns.d.ts.map +1 -1
  192. package/dist/api/generated/ns.js +2 -10
  193. package/dist/api/generated/ns.js.map +1 -1
  194. package/dist/api/generated/operations.d.ts +65 -110
  195. package/dist/api/generated/operations.d.ts.map +1 -1
  196. package/dist/api/generated/operations.js +132 -80
  197. package/dist/api/generated/operations.js.map +1 -1
  198. package/dist/api/generated/projection.d.ts +1 -8
  199. package/dist/api/generated/projection.d.ts.map +1 -1
  200. package/dist/api/generated/projection.js +6 -4
  201. package/dist/api/generated/projection.js.map +1 -1
  202. package/dist/api/generated/query.d.ts +1 -9
  203. package/dist/api/generated/query.d.ts.map +1 -1
  204. package/dist/api/generated/query.js +6 -1
  205. package/dist/api/generated/query.js.map +1 -1
  206. package/dist/api/generated/script-face-manifest.d.ts +2 -0
  207. package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
  208. package/dist/api/generated/script-face-manifest.js +22 -10
  209. package/dist/api/generated/script-face-manifest.js.map +1 -1
  210. package/dist/api/generated/script-face.d.ts +52 -27
  211. package/dist/api/generated/script-face.d.ts.map +1 -1
  212. package/dist/api/generated/script-face.js +18 -4
  213. package/dist/api/generated/script-face.js.map +1 -1
  214. package/dist/api/generated/sketching.d.ts +4 -7
  215. package/dist/api/generated/sketching.d.ts.map +1 -1
  216. package/dist/api/generated/sketching.js +10 -8
  217. package/dist/api/generated/sketching.js.map +1 -1
  218. package/dist/api/generated/text.d.ts +1 -6
  219. package/dist/api/generated/text.d.ts.map +1 -1
  220. package/dist/api/generated/text.js +6 -3
  221. package/dist/api/generated/text.js.map +1 -1
  222. package/dist/api/generated/topology.d.ts +77 -175
  223. package/dist/api/generated/topology.d.ts.map +1 -1
  224. package/dist/api/generated/topology.js +172 -131
  225. package/dist/api/generated/topology.js.map +1 -1
  226. package/dist/api/geom.d.ts.map +1 -1
  227. package/dist/api/geom.js +2 -2
  228. package/dist/api/geom.js.map +1 -1
  229. package/dist/api/helix.d.ts +51 -0
  230. package/dist/api/helix.d.ts.map +1 -0
  231. package/dist/api/helix.js +63 -0
  232. package/dist/api/helix.js.map +1 -0
  233. package/dist/api/import-step.d.ts.map +1 -1
  234. package/dist/api/import-step.js +6 -2
  235. package/dist/api/import-step.js.map +1 -1
  236. package/dist/api/index.d.ts +20 -6
  237. package/dist/api/index.d.ts.map +1 -1
  238. package/dist/api/index.js +30 -13
  239. package/dist/api/index.js.map +1 -1
  240. package/dist/api/internal/compat-op.d.ts +10 -0
  241. package/dist/api/internal/compat-op.d.ts.map +1 -1
  242. package/dist/api/internal/compat-op.js +9 -3
  243. package/dist/api/internal/compat-op.js.map +1 -1
  244. package/dist/api/internal/compat-projection.d.ts +4 -4
  245. package/dist/api/internal/compat-projection.js +7 -7
  246. package/dist/api/internal/compat-projection.js.map +1 -1
  247. package/dist/api/internal/l3-bridge.d.ts +75 -42
  248. package/dist/api/internal/l3-bridge.d.ts.map +1 -1
  249. package/dist/api/internal/l3-bridge.js +105 -50
  250. package/dist/api/internal/l3-bridge.js.map +1 -1
  251. package/dist/api/internal/profile-wire.d.ts +31 -0
  252. package/dist/api/internal/profile-wire.d.ts.map +1 -0
  253. package/dist/api/internal/profile-wire.js +37 -0
  254. package/dist/api/internal/profile-wire.js.map +1 -0
  255. package/dist/api/internal/replica-role-table.js +2 -2
  256. package/dist/api/internal/replica-role-table.js.map +1 -1
  257. package/dist/api/loft.d.ts +66 -0
  258. package/dist/api/loft.d.ts.map +1 -0
  259. package/dist/api/loft.js +111 -0
  260. package/dist/api/loft.js.map +1 -0
  261. package/dist/api/measurement/index.d.ts +51 -0
  262. package/dist/api/measurement/index.d.ts.map +1 -0
  263. package/dist/api/measurement/index.js +71 -0
  264. package/dist/api/measurement/index.js.map +1 -0
  265. package/dist/api/occt-kernel-bridge.d.ts +5 -8
  266. package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
  267. package/dist/api/occt-kernel-bridge.js +18 -14
  268. package/dist/api/occt-kernel-bridge.js.map +1 -1
  269. package/dist/api/pattern.d.ts.map +1 -1
  270. package/dist/api/pattern.js +3 -4
  271. package/dist/api/pattern.js.map +1 -1
  272. package/dist/api/place.d.ts.map +1 -1
  273. package/dist/api/place.js +2 -4
  274. package/dist/api/place.js.map +1 -1
  275. package/dist/api/primitives.d.ts.map +1 -1
  276. package/dist/api/primitives.js +3 -4
  277. package/dist/api/primitives.js.map +1 -1
  278. package/dist/api/profile.d.ts +89 -0
  279. package/dist/api/profile.d.ts.map +1 -0
  280. package/dist/api/profile.js +194 -0
  281. package/dist/api/profile.js.map +1 -0
  282. package/dist/api/replicate.d.ts +28 -1
  283. package/dist/api/replicate.d.ts.map +1 -1
  284. package/dist/api/replicate.js +34 -23
  285. package/dist/api/replicate.js.map +1 -1
  286. package/dist/api/result.d.ts +6 -11
  287. package/dist/api/result.d.ts.map +1 -1
  288. package/dist/api/result.js +6 -11
  289. package/dist/api/result.js.map +1 -1
  290. package/dist/api/revolve.d.ts.map +1 -1
  291. package/dist/api/revolve.js +15 -14
  292. package/dist/api/revolve.js.map +1 -1
  293. package/dist/api/screw.d.ts +3 -0
  294. package/dist/api/screw.d.ts.map +1 -1
  295. package/dist/api/screw.js +9 -4
  296. package/dist/api/screw.js.map +1 -1
  297. package/dist/api/sdf.d.ts +1 -1
  298. package/dist/api/section-by-plane.d.ts +42 -0
  299. package/dist/api/section-by-plane.d.ts.map +1 -0
  300. package/dist/api/section-by-plane.js +61 -0
  301. package/dist/api/section-by-plane.js.map +1 -0
  302. package/dist/api/shell.d.ts +45 -0
  303. package/dist/api/shell.d.ts.map +1 -0
  304. package/dist/api/shell.js +73 -0
  305. package/dist/api/shell.js.map +1 -0
  306. package/dist/api/sketch.d.ts +8 -1
  307. package/dist/api/sketch.d.ts.map +1 -1
  308. package/dist/api/sketch.js +12 -7
  309. package/dist/api/sketch.js.map +1 -1
  310. package/dist/api/split-by-plane.d.ts +41 -0
  311. package/dist/api/split-by-plane.d.ts.map +1 -0
  312. package/dist/api/split-by-plane.js +60 -0
  313. package/dist/api/split-by-plane.js.map +1 -0
  314. package/dist/api/split.d.ts +6 -1
  315. package/dist/api/split.d.ts.map +1 -1
  316. package/dist/api/split.js +23 -9
  317. package/dist/api/split.js.map +1 -1
  318. package/dist/api/surface/arg-spec.d.ts +22 -0
  319. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  320. package/dist/api/surface/arg-spec.js +729 -477
  321. package/dist/api/surface/arg-spec.js.map +1 -1
  322. package/dist/api/sweep.d.ts +55 -0
  323. package/dist/api/sweep.d.ts.map +1 -0
  324. package/dist/api/sweep.js +86 -0
  325. package/dist/api/sweep.js.map +1 -0
  326. package/dist/api/thicken.d.ts +36 -0
  327. package/dist/api/thicken.d.ts.map +1 -0
  328. package/dist/api/thicken.js +55 -0
  329. package/dist/api/thicken.js.map +1 -0
  330. package/dist/api/transform.d.ts +8 -0
  331. package/dist/api/transform.d.ts.map +1 -1
  332. package/dist/api/transform.js +15 -4
  333. package/dist/api/transform.js.map +1 -1
  334. package/dist/api/view/cameraFns.d.ts +48 -0
  335. package/dist/api/view/cameraFns.d.ts.map +1 -0
  336. package/dist/api/view/cameraFns.js +75 -0
  337. package/dist/api/view/cameraFns.js.map +1 -0
  338. package/dist/api/view/projectionPlanes.d.ts +25 -0
  339. package/dist/api/view/projectionPlanes.d.ts.map +1 -0
  340. package/dist/api/view/projectionPlanes.js +30 -0
  341. package/dist/api/view/projectionPlanes.js.map +1 -0
  342. package/dist/api/view/view-camera.d.ts +2 -2
  343. package/dist/api/view/view-camera.d.ts.map +1 -1
  344. package/dist/api/view/view-camera.js +3 -3
  345. package/dist/api/view/view-camera.js.map +1 -1
  346. package/dist/api/view/view-projection.d.ts +9 -6
  347. package/dist/api/view/view-projection.d.ts.map +1 -1
  348. package/dist/api/view/view-projection.js +132 -65
  349. package/dist/api/view/view-projection.js.map +1 -1
  350. package/dist/api/wire.d.ts +45 -0
  351. package/dist/api/wire.d.ts.map +1 -0
  352. package/dist/api/wire.js +96 -0
  353. package/dist/api/wire.js.map +1 -0
  354. package/dist/boolean/creased-normals.d.ts +50 -0
  355. package/dist/boolean/creased-normals.d.ts.map +1 -0
  356. package/dist/boolean/creased-normals.js +114 -0
  357. package/dist/boolean/creased-normals.js.map +1 -0
  358. package/dist/boolean/deriveNormals.d.ts +4 -1
  359. package/dist/boolean/deriveNormals.d.ts.map +1 -1
  360. package/dist/boolean/deriveNormals.js +5 -2
  361. package/dist/boolean/deriveNormals.js.map +1 -1
  362. package/dist/brep/brep-ops.d.ts +6 -0
  363. package/dist/brep/brep-ops.d.ts.map +1 -1
  364. package/dist/brep/brep-ops.js +11 -2
  365. package/dist/brep/brep-ops.js.map +1 -1
  366. package/dist/brep/brep-topology.d.ts +4 -0
  367. package/dist/brep/brep-topology.d.ts.map +1 -1
  368. package/dist/brep/brep-topology.js +4 -0
  369. package/dist/brep/brep-topology.js.map +1 -1
  370. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  371. package/dist/brep/engine/adapters/brep-mock.js +79 -59
  372. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  373. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  374. package/dist/brep/engine/adapters/brepkit.js +35 -2
  375. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  376. package/dist/brep/engine/adapters/occt.d.ts +15 -7
  377. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  378. package/dist/brep/engine/adapters/occt.js +64 -167
  379. package/dist/brep/engine/adapters/occt.js.map +1 -1
  380. package/dist/brep/engine/primitives.d.ts +93 -130
  381. package/dist/brep/engine/primitives.d.ts.map +1 -1
  382. package/dist/brep/engine/primitives.js +9 -7
  383. package/dist/brep/engine/primitives.js.map +1 -1
  384. package/dist/brep/engine/types.d.ts +14 -1
  385. package/dist/brep/engine/types.d.ts.map +1 -1
  386. package/dist/brep/engine/types.js +11 -1
  387. package/dist/brep/engine/types.js.map +1 -1
  388. package/dist/brep/export/step.d.ts +3 -0
  389. package/dist/brep/export/step.d.ts.map +1 -1
  390. package/dist/brep/export/step.js +7 -1
  391. package/dist/brep/export/step.js.map +1 -1
  392. package/dist/brep/face-evolution.d.ts +8 -0
  393. package/dist/brep/face-evolution.d.ts.map +1 -1
  394. package/dist/brep/face-evolution.js +15 -3
  395. package/dist/brep/face-evolution.js.map +1 -1
  396. package/dist/brep/handle-bridge.d.ts +20 -2
  397. package/dist/brep/handle-bridge.d.ts.map +1 -1
  398. package/dist/brep/handle-bridge.js +25 -2
  399. package/dist/brep/handle-bridge.js.map +1 -1
  400. package/dist/brepkit-kernel/brepkitKernel.d.ts +25 -5
  401. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  402. package/dist/brepkit-kernel/brepkitKernel.js +782 -218
  403. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  404. package/dist/brepkit-kernel/multi-version-test.d.ts +40 -0
  405. package/dist/brepkit-kernel/multi-version-test.d.ts.map +1 -0
  406. package/dist/brepkit-kernel/multi-version-test.js +89 -0
  407. package/dist/brepkit-kernel/multi-version-test.js.map +1 -0
  408. package/dist/cad-runtime/admit-compat-lib.d.ts +6 -1
  409. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  410. package/dist/cad-runtime/admit-compat-lib.js +5 -1
  411. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  412. package/dist/cad-runtime/backend-dispatch.d.ts +9 -3
  413. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  414. package/dist/cad-runtime/backend-dispatch.js +32 -2
  415. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  416. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  417. package/dist/cad-runtime/direct-executor.js +8 -2
  418. package/dist/cad-runtime/direct-executor.js.map +1 -1
  419. package/dist/cad-runtime/runtime.d.ts +3 -0
  420. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  421. package/dist/cad-runtime/runtime.js +3 -1
  422. package/dist/cad-runtime/runtime.js.map +1 -1
  423. package/dist/define-op.d.ts +18 -2
  424. package/dist/define-op.d.ts.map +1 -1
  425. package/dist/define-op.js +29 -1
  426. package/dist/define-op.js.map +1 -1
  427. package/dist/env-agnostic.d.ts +3 -0
  428. package/dist/env-agnostic.d.ts.map +1 -1
  429. package/dist/env-agnostic.js +7 -0
  430. package/dist/env-agnostic.js.map +1 -1
  431. package/dist/index.d.ts.map +1 -1
  432. package/dist/index.js +3 -4
  433. package/dist/index.js.map +1 -1
  434. package/dist/lang/symbol-table.generated.d.ts +29 -1
  435. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  436. package/dist/lang/symbol-table.generated.js +30 -2
  437. package/dist/lang/symbol-table.generated.js.map +1 -1
  438. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  439. package/dist/occt-kernel/highLevelApi.js +6 -3
  440. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  441. package/dist/occt-kernel/hullGeometry.d.ts +31 -0
  442. package/dist/occt-kernel/hullGeometry.d.ts.map +1 -0
  443. package/dist/occt-kernel/hullGeometry.js +319 -0
  444. package/dist/occt-kernel/hullGeometry.js.map +1 -0
  445. package/dist/occt-kernel/hullOps.d.ts +24 -0
  446. package/dist/occt-kernel/hullOps.d.ts.map +1 -0
  447. package/dist/occt-kernel/hullOps.js +52 -0
  448. package/dist/occt-kernel/hullOps.js.map +1 -0
  449. package/dist/occt-kernel/occt-primitives.d.ts +14 -0
  450. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -0
  451. package/dist/occt-kernel/occt-primitives.js +351 -0
  452. package/dist/occt-kernel/occt-primitives.js.map +1 -0
  453. package/dist/occt-kernel/occtKernel.d.ts +14 -6
  454. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  455. package/dist/occt-kernel/occtKernel.js +11 -3
  456. package/dist/occt-kernel/occtKernel.js.map +1 -1
  457. package/dist/occt-kernel/topologyExt.js +2 -2
  458. package/dist/occt-kernel/topologyExt.js.map +1 -1
  459. package/dist/primitives/brep-primitives.d.ts +4 -0
  460. package/dist/primitives/brep-primitives.d.ts.map +1 -1
  461. package/dist/primitives/brep-primitives.js +4 -0
  462. package/dist/primitives/brep-primitives.js.map +1 -1
  463. package/dist/result/bug.d.ts +22 -0
  464. package/dist/result/bug.d.ts.map +1 -0
  465. package/dist/result/bug.js +28 -0
  466. package/dist/result/bug.js.map +1 -0
  467. package/dist/result/errors.d.ts +270 -0
  468. package/dist/result/errors.d.ts.map +1 -0
  469. package/dist/result/errors.js +317 -0
  470. package/dist/result/errors.js.map +1 -0
  471. package/dist/result/kernelErrorTranslation.d.ts +21 -0
  472. package/dist/result/kernelErrorTranslation.d.ts.map +1 -0
  473. package/dist/result/kernelErrorTranslation.js +102 -0
  474. package/dist/result/kernelErrorTranslation.js.map +1 -0
  475. package/dist/result/result.d.ts +213 -0
  476. package/dist/result/result.d.ts.map +1 -0
  477. package/dist/result/result.js +336 -0
  478. package/dist/result/result.js.map +1 -0
  479. package/dist/result/vec3.d.ts +12 -0
  480. package/dist/result/vec3.d.ts.map +1 -0
  481. package/dist/result/vec3.js +14 -0
  482. package/dist/result/vec3.js.map +1 -0
  483. package/dist/runtime-state.d.ts +9 -0
  484. package/dist/runtime-state.d.ts.map +1 -1
  485. package/dist/runtime-state.js.map +1 -1
  486. package/dist/sdk.d.ts +3 -1
  487. package/dist/sdk.d.ts.map +1 -1
  488. package/dist/sdk.js +2 -1
  489. package/dist/sdk.js.map +1 -1
  490. package/dist/shape.d.ts +43 -1
  491. package/dist/shape.d.ts.map +1 -1
  492. package/dist/shape.js +57 -1
  493. package/dist/shape.js.map +1 -1
  494. package/dist/topology/naming/geom-hint.js +1 -1
  495. package/dist/topology/naming/geom-hint.js.map +1 -1
  496. package/dist/topology/naming/score.js +1 -1
  497. package/dist/topology/naming/score.js.map +1 -1
  498. package/package.json +6 -16
@@ -0,0 +1,337 @@
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 { getBrepApi } from '../brep/handle-bridge.js';
16
+ import { getOcctKernel } from '../occt-kernel/occtKernel.js';
17
+ import { fromBrep, fromBrepCurve } from '../shape.js';
18
+ import { brepHandleOf } from './brep-mirror/brepHelpers.js';
19
+ import { ok, err } from '../result/result.js';
20
+ import { kernelError, validationError } from '../result/errors.js';
21
+ /** An empty mesh payload for shapes that only carry a BREP handle. */
22
+ const EMPTY_MESH = { positions: new Float32Array(0), indices: new Uint32Array(0) };
23
+ /** Wrap an engine handle as a faijs curve shape (edge / wire, no mesh payload). */
24
+ const wrapCurve = (h) => fromBrepCurve(EMPTY_MESH, { solid: h });
25
+ /** Wrap an engine handle as a faijs solid shape (face etc., no mesh payload). */
26
+ const wrapSolid = (h) => fromBrep(EMPTY_MESH, { solid: h });
27
+ /** Convert an array Vec3 to the engine's object Vec3. */
28
+ const v3 = (v) => ({ x: v[0], y: v[1], z: v[2] });
29
+ /** Convert an engine object Vec3 to an array Vec3. */
30
+ const v3a = (v) => [v.x, v.y, v.z];
31
+ /** Extract the BREP handle from a faijs Shape (建模链产物,brepOf 提句柄). */
32
+ const asHandle = (shape) => brepHandleOf(shape);
33
+ // ---------------------------------------------------------------------------
34
+ // 拓扑查询(同步)
35
+ // ---------------------------------------------------------------------------
36
+ /**
37
+ * Get all edges of a shape as faijs curve shapes.
38
+ *
39
+ * @param shape - a faijs Shape on the BREP chain.
40
+ * @returns the edge curve shapes of the shape.
41
+ */
42
+ export function getEdges(shape) {
43
+ return getBrepApi().getSubShapes(asHandle(shape), 'edge').map(wrapCurve);
44
+ }
45
+ /**
46
+ * Get all faces of a shape as faijs solid shapes.
47
+ *
48
+ * @param shape - a faijs Shape on the BREP chain.
49
+ * @returns the face shapes of the shape.
50
+ */
51
+ export function getFaces(shape) {
52
+ return getBrepApi().getSubShapes(asHandle(shape), 'face').map(wrapSolid);
53
+ }
54
+ /**
55
+ * Get all solids of a shape as faijs solid shapes.
56
+ *
57
+ * Booleans (`cut`/`fuse`) and some sweeps return a compound wrapping the
58
+ * solid(s); use this to unwrap them without reaching into the kernel.
59
+ *
60
+ * @param shape - a faijs Shape on the BREP chain.
61
+ * @returns the solid shapes of the shape.
62
+ */
63
+ export function getSolids(shape) {
64
+ return getBrepApi().getSubShapes(asHandle(shape), 'solid').map(wrapSolid);
65
+ }
66
+ /**
67
+ * Check whether a shape is a solid.
68
+ *
69
+ * @param shape - a faijs Shape on the BREP chain.
70
+ * @returns true when the shape is a solid.
71
+ */
72
+ export function isSolid(shape) {
73
+ return getBrepApi().isSolid(asHandle(shape));
74
+ }
75
+ /**
76
+ * Axis-aligned bounding box of a shape from the BREP kernel.
77
+ *
78
+ * 说明:`cad.boundingBox` 只读 mesh 载荷(positions),brep 产物(空载荷)
79
+ * 会得空盒;本出口直连引擎包围盒,供 sheetmetal 侧组合 `Bounds3D`。
80
+ *
81
+ * @param shape - a faijs Shape on the BREP chain.
82
+ * @returns the bounding box min/max corner points.
83
+ */
84
+ export function bounds3D(shape) {
85
+ const b = getBrepApi().getBoundingBox(asHandle(shape));
86
+ return {
87
+ min: [b.xmin, b.ymin, b.zmin],
88
+ max: [b.xmax, b.ymax, b.zmax],
89
+ };
90
+ }
91
+ /**
92
+ * Get the geometric surface type of a face (kernel neutral string).
93
+ *
94
+ * @param face - a faijs face Shape (from `getFaces`).
95
+ * @returns ok with the surface type ('plane' / 'cylinder' / 'sphere' / …).
96
+ */
97
+ export function getSurfaceType(face) {
98
+ return ok(getBrepApi().surfaceType(asHandle(face)));
99
+ }
100
+ // ---------------------------------------------------------------------------
101
+ // 曲线 / 曲面求值(同步)
102
+ // ---------------------------------------------------------------------------
103
+ /**
104
+ * Get the start point of an edge or wire curve.
105
+ *
106
+ * @param shape - an edge/wire faijs Shape.
107
+ * @returns the curve start point.
108
+ */
109
+ export function curveStartPoint(shape) {
110
+ const h = asHandle(shape);
111
+ const { first } = getBrepApi().curveParameters(h);
112
+ return v3a(getBrepApi().curvePointAtParam(h, first));
113
+ }
114
+ /**
115
+ * Get the end point of an edge or wire curve.
116
+ *
117
+ * @param shape - an edge/wire faijs Shape.
118
+ * @returns the curve end point.
119
+ */
120
+ export function curveEndPoint(shape) {
121
+ const h = asHandle(shape);
122
+ const { last } = getBrepApi().curveParameters(h);
123
+ return v3a(getBrepApi().curvePointAtParam(h, last));
124
+ }
125
+ /**
126
+ * Get the center of mass of a face.
127
+ *
128
+ * @param face - a faijs face Shape (from `getFaces`).
129
+ * @returns the face center point.
130
+ */
131
+ export function faceCenter(face) {
132
+ return v3a(getBrepApi().surfaceCenterOfMass(asHandle(face)));
133
+ }
134
+ /**
135
+ * Get the surface normal at a point (or at the UV-center when no point given).
136
+ *
137
+ * When a 3D point is given, it is projected to UV coordinates via the occt
138
+ * native `uvFromPoint` (occt-only; falls back to UV origin when the projection
139
+ * fails).
140
+ *
141
+ * @param face - a faijs face Shape (from `getFaces`).
142
+ * @param locationPoint - optional 3D point on the face.
143
+ * @returns the surface normal at the location.
144
+ */
145
+ export function normalAt(face, locationPoint) {
146
+ const h = asHandle(face);
147
+ let u;
148
+ let v;
149
+ if (locationPoint === undefined) {
150
+ const bounds = getBrepApi().uvBounds(h);
151
+ u = 0.5 * (bounds.uMin + bounds.uMax);
152
+ v = 0.5 * (bounds.vMin + bounds.vMax);
153
+ }
154
+ else {
155
+ const uv = getOcctKernel().uvFromPoint(h, v3(locationPoint));
156
+ if (uv === undefined || uv === null || typeof uv.u !== 'number') {
157
+ return v3a(getBrepApi().surfaceNormal(h, 0, 0));
158
+ }
159
+ u = uv.u;
160
+ v = uv.v;
161
+ }
162
+ return v3a(getBrepApi().surfaceNormal(h, u, v));
163
+ }
164
+ /**
165
+ * Get a point on a face surface at normalized UV coordinates (0-1 range).
166
+ *
167
+ * @param face - a faijs face Shape (from `getFaces`).
168
+ * @param u - normalized U parameter (0-1).
169
+ * @param v - normalized V parameter (0-1).
170
+ * @returns the surface point.
171
+ */
172
+ export function pointOnSurface(face, u, v) {
173
+ const h = asHandle(face);
174
+ const bounds = getBrepApi().uvBounds(h);
175
+ const absU = u * (bounds.uMax - bounds.uMin) + bounds.uMin;
176
+ const absV = v * (bounds.vMax - bounds.vMin) + bounds.vMin;
177
+ return v3a(getBrepApi().pointOnSurface(h, absU, absV));
178
+ }
179
+ /**
180
+ * Get the edges shared by two faces.
181
+ *
182
+ * @param a - first faijs face Shape.
183
+ * @param b - second faijs face Shape.
184
+ * @returns the shared edge curve shapes.
185
+ */
186
+ export function sharedEdges(a, b) {
187
+ return getBrepApi().sharedEdges(asHandle(a), asHandle(b)).map(wrapCurve);
188
+ }
189
+ /**
190
+ * Get the outer wire of a face (occt native `BRepTools::OuterWire`).
191
+ *
192
+ * @param face - a faijs face Shape.
193
+ * @returns the outer wire curve shape.
194
+ */
195
+ export function outerWire(face) {
196
+ return wrapCurve(getOcctKernel().outerWire(asHandle(face)));
197
+ }
198
+ // ---------------------------------------------------------------------------
199
+ // 构造(同步)
200
+ // ---------------------------------------------------------------------------
201
+ /**
202
+ * Create a line edge between two points.
203
+ *
204
+ * @param from - start point.
205
+ * @param to - end point.
206
+ * @returns the edge curve shape.
207
+ */
208
+ export function line(from, to) {
209
+ return wrapCurve(getBrepApi().makeLineEdge(v3(from), v3(to)));
210
+ }
211
+ /**
212
+ * Check whether a wire is closed (forms a loop).
213
+ *
214
+ * @param wire - a faijs wire Shape.
215
+ * @returns true when the wire is closed.
216
+ */
217
+ export function isClosedWire(wire) {
218
+ return getBrepApi().curveIsClosed(asHandle(wire));
219
+ }
220
+ /**
221
+ * Assemble edges into a connected wire, open or closed (no closure check).
222
+ *
223
+ * Sheetmetal form cuts (louver U-cuts) are deliberately OPEN paths in the
224
+ * developed plane — the fabricator leaves the hinge side uncut — so the
225
+ * topology face must be able to produce a non-closed wire. {@link wireLoop}
226
+ * adds the closure contract on top of this primitive.
227
+ *
228
+ * @param edges - ordered edge curve shapes to assemble.
229
+ * @returns ok with the assembled wire shape, or WIRE_BUILD_FAILED.
230
+ */
231
+ export function assembleWire(edges) {
232
+ let w;
233
+ try {
234
+ w = getBrepApi().makeWire(edges.map(asHandle));
235
+ }
236
+ catch (e) {
237
+ return err(kernelError('WIRE_BUILD_FAILED', `Failed to build the wire: ${e instanceof Error ? e.message : 'unknown error'}`, e));
238
+ }
239
+ return ok(wrapCurve(w));
240
+ }
241
+ /**
242
+ * Assemble edges into a connected wire, requiring the result to be closed.
243
+ *
244
+ * @param edges - ordered edge curve shapes to assemble.
245
+ * @returns ok with the closed wire shape, or WIRE_BUILD_FAILED /
246
+ * WIRE_NOT_CLOSED.
247
+ */
248
+ export function wireLoop(edges) {
249
+ let w;
250
+ try {
251
+ w = getBrepApi().makeWire(edges.map(asHandle));
252
+ }
253
+ catch (e) {
254
+ return err(kernelError('WIRE_BUILD_FAILED', `Failed to build the wire: ${e instanceof Error ? e.message : 'unknown error'}`, e));
255
+ }
256
+ if (!getBrepApi().curveIsClosed(w)) {
257
+ return err(validationError('WIRE_NOT_CLOSED', 'Assembled wire is not closed: start and end points do not coincide'));
258
+ }
259
+ return ok(wrapCurve(w));
260
+ }
261
+ /**
262
+ * Check whether a wire is planar (all edges lie in a common plane).
263
+ *
264
+ * Strategy: try planar face construction; if it succeeds, verify the surface
265
+ * type. A failure to build the face means the wire is not planar.
266
+ *
267
+ * @param wire - a faijs wire Shape.
268
+ * @returns true when the wire is planar.
269
+ */
270
+ export function isPlanarWire(wire) {
271
+ try {
272
+ const f = getBrepApi().makeFace(asHandle(wire));
273
+ const type = getBrepApi().surfaceType(f);
274
+ try {
275
+ getBrepApi().dispose(f);
276
+ }
277
+ catch {
278
+ /* best-effort cleanup */
279
+ }
280
+ return type === 'plane';
281
+ }
282
+ catch {
283
+ return false;
284
+ }
285
+ }
286
+ /**
287
+ * Create a planar face from a closed wire, optionally with holes.
288
+ *
289
+ * The result is a faijs solid Shape carrying the face BREP handle, ready for
290
+ * the modeling chain (`extrude` etc.).
291
+ *
292
+ * @param w - a closed planar wire Shape.
293
+ * @param holes - optional hole wire Shapes.
294
+ * @returns ok with the face shape, or FACE_BUILD_FAILED / FACE_NOT_PLANAR.
295
+ */
296
+ export function face(w, holes) {
297
+ let f;
298
+ try {
299
+ f = getBrepApi().makeFace(asHandle(w));
300
+ if (holes !== undefined && holes.length > 0) {
301
+ f = getBrepApi().addHolesInFace(f, holes.map(asHandle));
302
+ }
303
+ }
304
+ catch (e) {
305
+ return err(kernelError('FACE_BUILD_FAILED', 'Failed to build the face. Your wire might be non planar.', e));
306
+ }
307
+ if (getBrepApi().surfaceType(f) !== 'plane') {
308
+ return err(validationError('FACE_NOT_PLANAR', 'makeFace produced a non-planar face — wire may not be truly planar'));
309
+ }
310
+ return ok(wrapSolid(f));
311
+ }
312
+ /**
313
+ * Create a polygonal face from three or more coplanar points.
314
+ *
315
+ * @param points - three or more coplanar points.
316
+ * @returns ok with the face shape, or POLYGON_MIN_POINTS / wire / face errors.
317
+ */
318
+ export function polygon(points) {
319
+ if (points.length < 3) {
320
+ return err(validationError('POLYGON_MIN_POINTS', 'You need at least 3 points to make a polygon'));
321
+ }
322
+ const edges = [];
323
+ for (let i = 0; i < points.length; i++) {
324
+ const p1 = points[i];
325
+ const p2 = points[(i + 1) % points.length];
326
+ edges.push(line(p1, p2));
327
+ }
328
+ const wire = wireLoop(edges);
329
+ if (!wire.ok)
330
+ return wire;
331
+ return face(wire.value);
332
+ }
333
+ // ---------------------------------------------------------------------------
334
+ // 测量(faijs 既有:api/generated/measurement.ts 的 measureVolume /
335
+ // measureArea / measureLength 已在 api/index.ts 平铺;本面不重复导出)
336
+ // ---------------------------------------------------------------------------
337
+ //# sourceMappingURL=brep-topology.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brep-topology.js","sourceRoot":"","sources":["../../src/api/brep-topology.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAGzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAe,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAE/D,sEAAsE;AACtE,MAAM,UAAU,GAAU,EAAE,SAAS,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,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IAAI,UAAU,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC5C,OAAO,GAAG,CACR,eAAe,CAAC,iBAAiB,EAAE,oEAAoE,CAAC,CACzG,CAAA;IACH,CAAC;IACD,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC,eAAe,CAAC,oBAAoB,EAAE,8CAA8C,CAAC,CAAC,CAAA;IACnG,CAAC;IACD,MAAM,KAAK,GAAiB,EAAE,CAAA;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;QAC1C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAC1B,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAA;IACzB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,8EAA8E;AAC9E,6DAA6D;AAC7D,4DAA4D;AAC5D,8EAA8E","sourcesContent":["/**\n * brep-topology — faijs BREP 拓扑查询 / 构造面(core-decouple wrapup §2.2)\n *\n * @platform occt — `outerWire` / `normalAt`(带点路径)走 occt 原生面\n * `getOcctKernel()`(occt-only 能力,未进 L1 中立契约);其余经 L1\n * `BrepEngineApi`。sheetmetal 钣金库改写的消费面(原 §5.8)。\n *\n * faijs 风格(wrapup §0.1 判据):全部同步;`Shape` 进、`Shape` 家族\n * (CurveShape/SolidShape)出——子形状可直接再喂回 faijs op(建模链\n * `face(...)` → `extrude(...)` 零适配);曲面类型为内核中立串\n * ('plane'/'cylinder'/…);错误用 faijs 第一方 `Result` + `BrepErrorCode`。\n * **不提供 brepjs 兼容面**(裁决 9:brepjs 兼容层不由本 monorepo 提供),\n * 不复刻 brepjs 符号名 / 法文枚举 / 包装句柄形态。\n */\n\nimport { getBrepApi } from '../brep/handle-bridge'\nimport type { BrepHandle } from '../brep/engine/types'\nimport { getOcctKernel } from '../occt-kernel/occtKernel'\nimport type { Shape } from '../mesh/types'\nimport type { Vec3 } from './brepjs-compat/types'\nimport { fromBrep, fromBrepCurve } from '../shape'\nimport type { CurveShape, SolidShape } from '../shape'\nimport { brepHandleOf } from './brep-mirror/brepHelpers'\nimport { ok, err, type Result } from '../result/result'\nimport { kernelError, validationError } from '../result/errors'\n\n/** An empty mesh payload for shapes that only carry a BREP handle. */\nconst EMPTY_MESH: Shape = { positions: new Float32Array(0), indices: new Uint32Array(0) }\n\n/** Wrap an engine handle as a faijs curve shape (edge / wire, no mesh payload). */\nconst wrapCurve = (h: BrepHandle): CurveShape => fromBrepCurve(EMPTY_MESH, { solid: h })\n\n/** Wrap an engine handle as a faijs solid shape (face etc., no mesh payload). */\nconst wrapSolid = (h: BrepHandle): SolidShape => fromBrep(EMPTY_MESH, { solid: h })\n\n/** Convert an array Vec3 to the engine's object Vec3. */\nconst v3 = (v: Vec3): { x: number; y: number; z: number } => ({ x: v[0], y: v[1], z: v[2] })\n\n/** Convert an engine object Vec3 to an array Vec3. */\nconst v3a = (v: { x: number; y: number; z: number }): Vec3 => [v.x, v.y, v.z]\n\n/** Extract the BREP handle from a faijs Shape (建模链产物,brepOf 提句柄). */\nconst asHandle = (shape: Shape): BrepHandle => brepHandleOf(shape)\n\n// ---------------------------------------------------------------------------\n// 拓扑查询(同步)\n// ---------------------------------------------------------------------------\n\n/**\n * Get all edges of a shape as faijs curve shapes.\n *\n * @param shape - a faijs Shape on the BREP chain.\n * @returns the edge curve shapes of the shape.\n */\nexport function getEdges(shape: Shape): CurveShape[] {\n return getBrepApi().getSubShapes(asHandle(shape), 'edge').map(wrapCurve)\n}\n\n/**\n * Get all faces of a shape as faijs solid shapes.\n *\n * @param shape - a faijs Shape on the BREP chain.\n * @returns the face shapes of the shape.\n */\nexport function getFaces(shape: Shape): SolidShape[] {\n return getBrepApi().getSubShapes(asHandle(shape), 'face').map(wrapSolid)\n}\n\n/**\n * Get all solids of a shape as faijs solid shapes.\n *\n * Booleans (`cut`/`fuse`) and some sweeps return a compound wrapping the\n * solid(s); use this to unwrap them without reaching into the kernel.\n *\n * @param shape - a faijs Shape on the BREP chain.\n * @returns the solid shapes of the shape.\n */\nexport function getSolids(shape: Shape): SolidShape[] {\n return getBrepApi().getSubShapes(asHandle(shape), 'solid').map(wrapSolid)\n}\n\n/**\n * Check whether a shape is a solid.\n *\n * @param shape - a faijs Shape on the BREP chain.\n * @returns true when the shape is a solid.\n */\nexport function isSolid(shape: Shape): boolean {\n return getBrepApi().isSolid(asHandle(shape))\n}\n\n/**\n * Axis-aligned bounding box of a shape from the BREP kernel.\n *\n * 说明:`cad.boundingBox` 只读 mesh 载荷(positions),brep 产物(空载荷)\n * 会得空盒;本出口直连引擎包围盒,供 sheetmetal 侧组合 `Bounds3D`。\n *\n * @param shape - a faijs Shape on the BREP chain.\n * @returns the bounding box min/max corner points.\n */\nexport function bounds3D(shape: Shape): { min: Vec3; max: Vec3 } {\n const b = getBrepApi().getBoundingBox(asHandle(shape))\n return {\n min: [b.xmin, b.ymin, b.zmin],\n max: [b.xmax, b.ymax, b.zmax],\n }\n}\n\n/**\n * Get the geometric surface type of a face (kernel neutral string).\n *\n * @param face - a faijs face Shape (from `getFaces`).\n * @returns ok with the surface type ('plane' / 'cylinder' / 'sphere' / …).\n */\nexport function getSurfaceType(face: Shape): Result<string> {\n return ok(getBrepApi().surfaceType(asHandle(face)))\n}\n\n// ---------------------------------------------------------------------------\n// 曲线 / 曲面求值(同步)\n// ---------------------------------------------------------------------------\n\n/**\n * Get the start point of an edge or wire curve.\n *\n * @param shape - an edge/wire faijs Shape.\n * @returns the curve start point.\n */\nexport function curveStartPoint(shape: Shape): Vec3 {\n const h = asHandle(shape)\n const { first } = getBrepApi().curveParameters(h)\n return v3a(getBrepApi().curvePointAtParam(h, first))\n}\n\n/**\n * Get the end point of an edge or wire curve.\n *\n * @param shape - an edge/wire faijs Shape.\n * @returns the curve end point.\n */\nexport function curveEndPoint(shape: Shape): Vec3 {\n const h = asHandle(shape)\n const { last } = getBrepApi().curveParameters(h)\n return v3a(getBrepApi().curvePointAtParam(h, last))\n}\n\n/**\n * Get the center of mass of a face.\n *\n * @param face - a faijs face Shape (from `getFaces`).\n * @returns the face center point.\n */\nexport function faceCenter(face: Shape): Vec3 {\n return v3a(getBrepApi().surfaceCenterOfMass(asHandle(face)))\n}\n\n/**\n * Get the surface normal at a point (or at the UV-center when no point given).\n *\n * When a 3D point is given, it is projected to UV coordinates via the occt\n * native `uvFromPoint` (occt-only; falls back to UV origin when the projection\n * fails).\n *\n * @param face - a faijs face Shape (from `getFaces`).\n * @param locationPoint - optional 3D point on the face.\n * @returns the surface normal at the location.\n */\nexport function normalAt(face: Shape, locationPoint?: Vec3): Vec3 {\n const h = asHandle(face)\n let u: number\n let v: number\n if (locationPoint === undefined) {\n const bounds = getBrepApi().uvBounds(h)\n u = 0.5 * (bounds.uMin + bounds.uMax)\n v = 0.5 * (bounds.vMin + bounds.vMax)\n } else {\n const uv = getOcctKernel().uvFromPoint(h as never, v3(locationPoint) as never)\n if (uv === undefined || uv === null || typeof uv.u !== 'number') {\n return v3a(getBrepApi().surfaceNormal(h, 0, 0))\n }\n u = uv.u\n v = uv.v\n }\n return v3a(getBrepApi().surfaceNormal(h, u, v))\n}\n\n/**\n * Get a point on a face surface at normalized UV coordinates (0-1 range).\n *\n * @param face - a faijs face Shape (from `getFaces`).\n * @param u - normalized U parameter (0-1).\n * @param v - normalized V parameter (0-1).\n * @returns the surface point.\n */\nexport function pointOnSurface(face: Shape, u: number, v: number): Vec3 {\n const h = asHandle(face)\n const bounds = getBrepApi().uvBounds(h)\n const absU = u * (bounds.uMax - bounds.uMin) + bounds.uMin\n const absV = v * (bounds.vMax - bounds.vMin) + bounds.vMin\n return v3a(getBrepApi().pointOnSurface(h, absU, absV))\n}\n\n/**\n * Get the edges shared by two faces.\n *\n * @param a - first faijs face Shape.\n * @param b - second faijs face Shape.\n * @returns the shared edge curve shapes.\n */\nexport function sharedEdges(a: Shape, b: Shape): CurveShape[] {\n return getBrepApi().sharedEdges(asHandle(a), asHandle(b)).map(wrapCurve)\n}\n\n/**\n * Get the outer wire of a face (occt native `BRepTools::OuterWire`).\n *\n * @param face - a faijs face Shape.\n * @returns the outer wire curve shape.\n */\nexport function outerWire(face: Shape): CurveShape {\n return wrapCurve(getOcctKernel().outerWire(asHandle(face) as never) as unknown as BrepHandle)\n}\n\n// ---------------------------------------------------------------------------\n// 构造(同步)\n// ---------------------------------------------------------------------------\n\n/**\n * Create a line edge between two points.\n *\n * @param from - start point.\n * @param to - end point.\n * @returns the edge curve shape.\n */\nexport function line(from: Vec3, to: Vec3): CurveShape {\n return wrapCurve(getBrepApi().makeLineEdge(v3(from), v3(to)))\n}\n\n/**\n * Check whether a wire is closed (forms a loop).\n *\n * @param wire - a faijs wire Shape.\n * @returns true when the wire is closed.\n */\nexport function isClosedWire(wire: Shape): boolean {\n return getBrepApi().curveIsClosed(asHandle(wire))\n}\n\n/**\n * Assemble edges into a connected wire, open or closed (no closure check).\n *\n * Sheetmetal form cuts (louver U-cuts) are deliberately OPEN paths in the\n * developed plane — the fabricator leaves the hinge side uncut — so the\n * topology face must be able to produce a non-closed wire. {@link wireLoop}\n * adds the closure contract on top of this primitive.\n *\n * @param edges - ordered edge curve shapes to assemble.\n * @returns ok with the assembled wire shape, or WIRE_BUILD_FAILED.\n */\nexport function assembleWire(edges: Shape[]): Result<CurveShape> {\n let w: BrepHandle\n try {\n w = getBrepApi().makeWire(edges.map(asHandle))\n } catch (e) {\n return err(\n kernelError(\n 'WIRE_BUILD_FAILED',\n `Failed to build the wire: ${e instanceof Error ? e.message : 'unknown error'}`,\n e\n )\n )\n }\n return ok(wrapCurve(w))\n}\n\n/**\n * Assemble edges into a connected wire, requiring the result to be closed.\n *\n * @param edges - ordered edge curve shapes to assemble.\n * @returns ok with the closed wire shape, or WIRE_BUILD_FAILED /\n * WIRE_NOT_CLOSED.\n */\nexport function wireLoop(edges: Shape[]): Result<CurveShape> {\n let w: BrepHandle\n try {\n w = getBrepApi().makeWire(edges.map(asHandle))\n } catch (e) {\n return err(\n kernelError(\n 'WIRE_BUILD_FAILED',\n `Failed to build the wire: ${e instanceof Error ? e.message : 'unknown error'}`,\n e\n )\n )\n }\n if (!getBrepApi().curveIsClosed(w)) {\n return err(\n validationError(\n 'WIRE_NOT_CLOSED',\n 'Assembled wire is not closed: start and end points do not coincide'\n )\n )\n }\n return ok(wrapCurve(w))\n}\n\n/**\n * Check whether a wire is planar (all edges lie in a common plane).\n *\n * Strategy: try planar face construction; if it succeeds, verify the surface\n * type. A failure to build the face means the wire is not planar.\n *\n * @param wire - a faijs wire Shape.\n * @returns true when the wire is planar.\n */\nexport function isPlanarWire(wire: Shape): boolean {\n try {\n const f = getBrepApi().makeFace(asHandle(wire))\n const type = getBrepApi().surfaceType(f)\n try {\n getBrepApi().dispose(f)\n } catch {\n /* best-effort cleanup */\n }\n return type === 'plane'\n } catch {\n return false\n }\n}\n\n/**\n * Create a planar face from a closed wire, optionally with holes.\n *\n * The result is a faijs solid Shape carrying the face BREP handle, ready for\n * the modeling chain (`extrude` etc.).\n *\n * @param w - a closed planar wire Shape.\n * @param holes - optional hole wire Shapes.\n * @returns ok with the face shape, or FACE_BUILD_FAILED / FACE_NOT_PLANAR.\n */\nexport function face(w: Shape, holes?: Shape[]): Result<SolidShape> {\n let f: BrepHandle\n try {\n f = getBrepApi().makeFace(asHandle(w))\n if (holes !== undefined && holes.length > 0) {\n f = getBrepApi().addHolesInFace(f, holes.map(asHandle))\n }\n } catch (e) {\n return err(\n kernelError('FACE_BUILD_FAILED', 'Failed to build the face. Your wire might be non planar.', e)\n )\n }\n if (getBrepApi().surfaceType(f) !== 'plane') {\n return err(\n validationError('FACE_NOT_PLANAR', 'makeFace produced a non-planar face — wire may not be truly planar')\n )\n }\n return ok(wrapSolid(f))\n}\n\n/**\n * Create a polygonal face from three or more coplanar points.\n *\n * @param points - three or more coplanar points.\n * @returns ok with the face shape, or POLYGON_MIN_POINTS / wire / face errors.\n */\nexport function polygon(points: Vec3[]): Result<SolidShape> {\n if (points.length < 3) {\n return err(validationError('POLYGON_MIN_POINTS', 'You need at least 3 points to make a polygon'))\n }\n const edges: CurveShape[] = []\n for (let i = 0; i < points.length; i++) {\n const p1 = points[i]\n const p2 = points[(i + 1) % points.length]\n edges.push(line(p1, p2))\n }\n const wire = wireLoop(edges)\n if (!wire.ok) return wire\n return face(wire.value)\n}\n\n// ---------------------------------------------------------------------------\n// 测量(faijs 既有:api/generated/measurement.ts 的 measureVolume /\n// measureArea / measureLength 已在 api/index.ts 平铺;本面不重复导出)\n// ---------------------------------------------------------------------------\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 第一方模块(2026-09-25 core-decouple Phase 1):复制自 brepjs
3
+ * `src/core/constants.ts`(同源复制,签名不变)。
4
+ */
5
+ /** Maximum hash code value for kernel shape hashing (2^31 - 1). */
6
+ export declare const HASH_CODE_MAX = 2147483647;
7
+ /** Multiply degrees by this constant to convert to radians. */
8
+ export declare const DEG2RAD: number;
9
+ /** Multiply radians by this constant to convert to degrees. */
10
+ export declare const RAD2DEG: number;
11
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/api/brepjs-compat/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,eAAO,MAAM,aAAa,aAAa,CAAC;AAExC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,QAAgB,CAAC;AAErC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,QAAgB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 第一方模块(2026-09-25 core-decouple Phase 1):复制自 brepjs
3
+ * `src/core/constants.ts`(同源复制,签名不变)。
4
+ */
5
+ /** Maximum hash code value for kernel shape hashing (2^31 - 1). */
6
+ export const HASH_CODE_MAX = 2147483647;
7
+ /** Multiply degrees by this constant to convert to radians. */
8
+ export const DEG2RAD = Math.PI / 180;
9
+ /** Multiply radians by this constant to convert to degrees. */
10
+ export const RAD2DEG = 180 / Math.PI;
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/api/brepjs-compat/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AAExC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAErC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC","sourcesContent":["/**\n * 第一方模块(2026-09-25 core-decouple Phase 1):复制自 brepjs\n * `src/core/constants.ts`(同源复制,签名不变)。\n */\n\n/** Maximum hash code value for kernel shape hashing (2^31 - 1). */\nexport const HASH_CODE_MAX = 2147483647;\n\n/** Multiply degrees by this constant to convert to radians. */\nexport const DEG2RAD = Math.PI / 180;\n\n/** Multiply radians by this constant to convert to degrees. */\nexport const RAD2DEG = 180 / Math.PI;\n"]}