@faicad/faijs 0.14.1 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/api/api-namespace.d.ts +7 -0
  2. package/dist/api/api-namespace.d.ts.map +1 -1
  3. package/dist/api/api-namespace.js +23 -22
  4. package/dist/api/api-namespace.js.map +1 -1
  5. package/dist/api/boolean.d.ts.map +1 -1
  6. package/dist/api/boolean.js +26 -8
  7. package/dist/api/boolean.js.map +1 -1
  8. package/dist/api/chamfer.d.ts.map +1 -1
  9. package/dist/api/chamfer.js +4 -1
  10. package/dist/api/chamfer.js.map +1 -1
  11. package/dist/api/generated/cad/script-face.d.ts +1 -1
  12. package/dist/api/generated/cad/script-face.d.ts.map +1 -1
  13. package/dist/api/generated/cad/script-face.js +1 -2
  14. package/dist/api/generated/cad/script-face.js.map +1 -1
  15. package/dist/api/generated/operations.js +16 -16
  16. package/dist/api/generated/operations.js.map +1 -1
  17. package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
  18. package/dist/api/generated/script-face-manifest.js +0 -1
  19. package/dist/api/generated/script-face-manifest.js.map +1 -1
  20. package/dist/api/generated/script-face.d.ts +1 -4
  21. package/dist/api/generated/script-face.d.ts.map +1 -1
  22. package/dist/api/generated/script-face.js +2 -3
  23. package/dist/api/generated/script-face.js.map +1 -1
  24. package/dist/api/generated/sketching.js +1 -1
  25. package/dist/api/generated/sketching.js.map +1 -1
  26. package/dist/api/generated/topology.d.ts +0 -8
  27. package/dist/api/generated/topology.d.ts.map +1 -1
  28. package/dist/api/generated/topology.js +19 -26
  29. package/dist/api/generated/topology.js.map +1 -1
  30. package/dist/api/index.d.ts +1 -10
  31. package/dist/api/index.d.ts.map +1 -1
  32. package/dist/api/index.js +10 -18
  33. package/dist/api/index.js.map +1 -1
  34. package/dist/api/internal/compat-projection.d.ts +3 -1
  35. package/dist/api/internal/compat-projection.d.ts.map +1 -1
  36. package/dist/api/internal/compat-projection.js +8 -5
  37. package/dist/api/internal/compat-projection.js.map +1 -1
  38. package/dist/api/internal/replica-role-table.d.ts +36 -0
  39. package/dist/api/internal/replica-role-table.d.ts.map +1 -0
  40. package/dist/api/internal/replica-role-table.js +73 -0
  41. package/dist/api/internal/replica-role-table.js.map +1 -0
  42. package/dist/api/internal/result-unwrap.d.ts +3 -1
  43. package/dist/api/internal/result-unwrap.d.ts.map +1 -1
  44. package/dist/api/internal/result-unwrap.js +2 -2
  45. package/dist/api/internal/result-unwrap.js.map +1 -1
  46. package/dist/api/occt-kernel-bridge.d.ts +105 -27
  47. package/dist/api/occt-kernel-bridge.d.ts.map +1 -1
  48. package/dist/api/occt-kernel-bridge.js +255 -41
  49. package/dist/api/occt-kernel-bridge.js.map +1 -1
  50. package/dist/api/pattern.d.ts.map +1 -1
  51. package/dist/api/pattern.js +25 -61
  52. package/dist/api/pattern.js.map +1 -1
  53. package/dist/api/replicate.d.ts +145 -0
  54. package/dist/api/replicate.d.ts.map +1 -0
  55. package/dist/api/replicate.js +351 -0
  56. package/dist/api/replicate.js.map +1 -0
  57. package/dist/api/revolve.d.ts +36 -0
  58. package/dist/api/revolve.d.ts.map +1 -0
  59. package/dist/api/revolve.js +165 -0
  60. package/dist/api/revolve.js.map +1 -0
  61. package/dist/api/surface/arg-spec.d.ts +8 -0
  62. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  63. package/dist/api/surface/arg-spec.js +37 -36
  64. package/dist/api/surface/arg-spec.js.map +1 -1
  65. package/dist/api/surface/projection-overrides.d.ts.map +1 -1
  66. package/dist/api/surface/projection-overrides.js +6 -0
  67. package/dist/api/surface/projection-overrides.js.map +1 -1
  68. package/dist/boolean/deriveNormals.d.ts +5 -4
  69. package/dist/boolean/deriveNormals.d.ts.map +1 -1
  70. package/dist/boolean/deriveNormals.js +24 -7
  71. package/dist/boolean/deriveNormals.js.map +1 -1
  72. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  73. package/dist/brep/engine/adapters/brep-mock.js +58 -0
  74. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  75. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  76. package/dist/brep/engine/adapters/brepkit.js +39 -1
  77. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  78. package/dist/brep/engine/adapters/occt.d.ts +1 -5
  79. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  80. package/dist/brep/engine/adapters/occt.js +232 -18
  81. package/dist/brep/engine/adapters/occt.js.map +1 -1
  82. package/dist/brep/engine/primitives.d.ts +79 -0
  83. package/dist/brep/engine/primitives.d.ts.map +1 -1
  84. package/dist/brep/engine/primitives.js.map +1 -1
  85. package/dist/brep/engine/types.d.ts +18 -1
  86. package/dist/brep/engine/types.d.ts.map +1 -1
  87. package/dist/brep/engine/types.js.map +1 -1
  88. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  89. package/dist/brepkit-kernel/brepkitKernel.js +81 -11
  90. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  91. package/dist/browser.d.ts +6 -28
  92. package/dist/browser.d.ts.map +1 -1
  93. package/dist/browser.js +6 -17
  94. package/dist/browser.js.map +1 -1
  95. package/dist/cad-runtime/admit-compat-lib.d.ts +13 -18
  96. package/dist/cad-runtime/admit-compat-lib.d.ts.map +1 -1
  97. package/dist/cad-runtime/admit-compat-lib.js +25 -18
  98. package/dist/cad-runtime/admit-compat-lib.js.map +1 -1
  99. package/dist/cad-runtime/backend-dispatch.d.ts +4 -2
  100. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  101. package/dist/cad-runtime/backend-dispatch.js +2 -0
  102. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  103. package/dist/cad-runtime/browser-lib-loader.d.ts +4 -6
  104. package/dist/cad-runtime/browser-lib-loader.d.ts.map +1 -1
  105. package/dist/cad-runtime/browser-lib-loader.js +4 -9
  106. package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
  107. package/dist/cad-runtime/ports.d.ts +0 -7
  108. package/dist/cad-runtime/ports.d.ts.map +1 -1
  109. package/dist/cad-runtime/ports.js.map +1 -1
  110. package/dist/cad-runtime/runtime.d.ts +1 -3
  111. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  112. package/dist/cad-runtime/runtime.js +13 -18
  113. package/dist/cad-runtime/runtime.js.map +1 -1
  114. package/dist/env-agnostic.d.ts +38 -0
  115. package/dist/env-agnostic.d.ts.map +1 -0
  116. package/dist/env-agnostic.js +29 -0
  117. package/dist/env-agnostic.js.map +1 -0
  118. package/dist/fcstd/codegen.d.ts.map +1 -1
  119. package/dist/fcstd/codegen.js +8 -1
  120. package/dist/fcstd/codegen.js.map +1 -1
  121. package/dist/fcstd/expressions.d.ts +24 -0
  122. package/dist/fcstd/expressions.d.ts.map +1 -1
  123. package/dist/fcstd/expressions.js +91 -0
  124. package/dist/fcstd/expressions.js.map +1 -1
  125. package/dist/fcstd/feature-translate.d.ts.map +1 -1
  126. package/dist/fcstd/feature-translate.js +16 -2
  127. package/dist/fcstd/feature-translate.js.map +1 -1
  128. package/dist/fcstd/structural-types.d.ts.map +1 -1
  129. package/dist/fcstd/structural-types.js +5 -0
  130. package/dist/fcstd/structural-types.js.map +1 -1
  131. package/dist/index.d.ts +7 -24
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +10 -16
  134. package/dist/index.js.map +1 -1
  135. package/dist/lang/determinism-scanner.d.ts +9 -0
  136. package/dist/lang/determinism-scanner.d.ts.map +1 -1
  137. package/dist/lang/determinism-scanner.js +7 -1
  138. package/dist/lang/determinism-scanner.js.map +1 -1
  139. package/dist/lang/symbol-table.d.ts +31 -0
  140. package/dist/lang/symbol-table.d.ts.map +1 -1
  141. package/dist/lang/symbol-table.generated.d.ts +6 -16
  142. package/dist/lang/symbol-table.generated.d.ts.map +1 -1
  143. package/dist/lang/symbol-table.generated.js +6 -16
  144. package/dist/lang/symbol-table.generated.js.map +1 -1
  145. package/dist/lang/symbol-table.js +50 -1
  146. package/dist/lang/symbol-table.js.map +1 -1
  147. package/dist/mesh/creased-normals.d.ts +50 -0
  148. package/dist/mesh/creased-normals.d.ts.map +1 -0
  149. package/dist/mesh/creased-normals.js +114 -0
  150. package/dist/mesh/creased-normals.js.map +1 -0
  151. package/dist/mesh/decoration-provider.d.ts +53 -0
  152. package/dist/mesh/decoration-provider.d.ts.map +1 -0
  153. package/dist/mesh/decoration-provider.js +21 -0
  154. package/dist/mesh/decoration-provider.js.map +1 -0
  155. package/dist/mesh/engrave.d.ts +4 -0
  156. package/dist/mesh/engrave.d.ts.map +1 -1
  157. package/dist/mesh/engrave.js +22 -31
  158. package/dist/mesh/engrave.js.map +1 -1
  159. package/dist/mesh/index.d.ts +5 -14
  160. package/dist/mesh/index.d.ts.map +1 -1
  161. package/dist/mesh/index.js +7 -19
  162. package/dist/mesh/index.js.map +1 -1
  163. package/dist/mesh/io.d.ts +2 -1
  164. package/dist/mesh/io.d.ts.map +1 -1
  165. package/dist/mesh/io.js +5 -7
  166. package/dist/mesh/io.js.map +1 -1
  167. package/dist/mesh/primitives.d.ts +5 -18
  168. package/dist/mesh/primitives.d.ts.map +1 -1
  169. package/dist/mesh/primitives.js +4 -48
  170. package/dist/mesh/primitives.js.map +1 -1
  171. package/dist/mesh/stl-loader.d.ts +23 -0
  172. package/dist/mesh/stl-loader.d.ts.map +1 -0
  173. package/dist/mesh/stl-loader.js +139 -0
  174. package/dist/mesh/stl-loader.js.map +1 -0
  175. package/dist/module-resolver/parse-imports.d.ts +37 -0
  176. package/dist/module-resolver/parse-imports.d.ts.map +1 -0
  177. package/dist/module-resolver/parse-imports.js +39 -0
  178. package/dist/module-resolver/parse-imports.js.map +1 -0
  179. package/dist/module-resolver/resolver.d.ts +1 -1
  180. package/dist/module-resolver/resolver.js +2 -2
  181. package/dist/module-resolver/resolver.js.map +1 -1
  182. package/dist/node-host/cli.d.ts.map +1 -1
  183. package/dist/node-host/cli.js +1 -22
  184. package/dist/node-host/cli.js.map +1 -1
  185. package/dist/primitives/text/cjk-font.d.ts +42 -0
  186. package/dist/primitives/text/cjk-font.d.ts.map +1 -0
  187. package/dist/primitives/text/cjk-font.js +86 -0
  188. package/dist/primitives/text/cjk-font.js.map +1 -0
  189. package/dist/sdk.d.ts +2 -2
  190. package/dist/sdk.js +2 -2
  191. package/dist/sdk.js.map +1 -1
  192. package/dist/symbol-table.d.ts +15 -0
  193. package/dist/symbol-table.d.ts.map +1 -0
  194. package/dist/symbol-table.js +14 -0
  195. package/dist/symbol-table.js.map +1 -0
  196. package/dist/topology/naming/lineage-resolve.js +1 -1
  197. package/dist/topology/naming/lineage-resolve.js.map +1 -1
  198. package/dist/vendored/brepjs/kernel/index.d.ts +5 -0
  199. package/dist/vendored/brepjs/kernel/index.d.ts.map +1 -1
  200. package/dist/vendored/brepjs/kernel/index.js +11 -0
  201. package/dist/vendored/brepjs/kernel/index.js.map +1 -1
  202. package/dist/weapp.d.ts +3 -3
  203. package/dist/weapp.d.ts.map +1 -1
  204. package/dist/weapp.js +6 -3
  205. package/dist/weapp.js.map +1 -1
  206. package/package.json +16 -14
  207. package/dist/api/compat/index.d.ts +0 -173
  208. package/dist/api/compat/index.d.ts.map +0 -1
  209. package/dist/api/compat/index.js +0 -222
  210. package/dist/api/compat/index.js.map +0 -1
  211. package/dist/api/compound.d.ts +0 -110
  212. package/dist/api/compound.d.ts.map +0 -1
  213. package/dist/api/compound.js +0 -164
  214. package/dist/api/compound.js.map +0 -1
  215. package/dist/api/copy.d.ts +0 -40
  216. package/dist/api/copy.d.ts.map +0 -1
  217. package/dist/api/copy.js +0 -83
  218. package/dist/api/copy.js.map +0 -1
  219. package/dist/api/fai_drill.d.ts +0 -46
  220. package/dist/api/fai_drill.d.ts.map +0 -1
  221. package/dist/api/fai_drill.js +0 -243
  222. package/dist/api/fai_drill.js.map +0 -1
  223. package/dist/api/fai_extrude.d.ts +0 -36
  224. package/dist/api/fai_extrude.d.ts.map +0 -1
  225. package/dist/api/fai_extrude.js +0 -79
  226. package/dist/api/fai_extrude.js.map +0 -1
  227. package/dist/api/fai_split.d.ts +0 -46
  228. package/dist/api/fai_split.d.ts.map +0 -1
  229. package/dist/api/fai_split.js +0 -254
  230. package/dist/api/fai_split.js.map +0 -1
  231. package/dist/api/load.d.ts +0 -41
  232. package/dist/api/load.d.ts.map +0 -1
  233. package/dist/api/load.js +0 -84
  234. package/dist/api/load.js.map +0 -1
  235. package/dist/api/svgExtrude.d.ts +0 -32
  236. package/dist/api/svgExtrude.d.ts.map +0 -1
  237. package/dist/api/svgExtrude.js +0 -74
  238. package/dist/api/svgExtrude.js.map +0 -1
  239. package/dist/api/text.d.ts +0 -34
  240. package/dist/api/text.d.ts.map +0 -1
  241. package/dist/api/text.js +0 -101
  242. package/dist/api/text.js.map +0 -1
  243. package/dist/brep/text/fontTestHelper.d.ts +0 -30
  244. package/dist/brep/text/fontTestHelper.d.ts.map +0 -1
  245. package/dist/brep/text/fontTestHelper.js +0 -57
  246. package/dist/brep/text/fontTestHelper.js.map +0 -1
  247. package/dist/cad-runtime/module-executor.d.ts +0 -271
  248. package/dist/cad-runtime/module-executor.d.ts.map +0 -1
  249. package/dist/cad-runtime/module-executor.js +0 -630
  250. package/dist/cad-runtime/module-executor.js.map +0 -1
  251. package/dist/cad-runtime/terminal-dag.d.ts +0 -65
  252. package/dist/cad-runtime/terminal-dag.d.ts.map +0 -1
  253. package/dist/cad-runtime/terminal-dag.js +0 -167
  254. package/dist/cad-runtime/terminal-dag.js.map +0 -1
  255. package/dist/faqts/browser.d.ts +0 -16
  256. package/dist/faqts/browser.d.ts.map +0 -1
  257. package/dist/faqts/browser.js +0 -13
  258. package/dist/faqts/browser.js.map +0 -1
  259. package/dist/faqts/exec-blob.d.ts +0 -14
  260. package/dist/faqts/exec-blob.d.ts.map +0 -1
  261. package/dist/faqts/exec-blob.js +0 -22
  262. package/dist/faqts/exec-blob.js.map +0 -1
  263. package/dist/faqts/exec-node.d.ts +0 -15
  264. package/dist/faqts/exec-node.d.ts.map +0 -1
  265. package/dist/faqts/exec-node.js +0 -29
  266. package/dist/faqts/exec-node.js.map +0 -1
  267. package/dist/faqts/imports.d.ts +0 -74
  268. package/dist/faqts/imports.d.ts.map +0 -1
  269. package/dist/faqts/imports.js +0 -95
  270. package/dist/faqts/imports.js.map +0 -1
  271. package/dist/faqts/index.d.ts +0 -22
  272. package/dist/faqts/index.d.ts.map +0 -1
  273. package/dist/faqts/index.js +0 -21
  274. package/dist/faqts/index.js.map +0 -1
  275. package/dist/faqts/node.d.ts +0 -23
  276. package/dist/faqts/node.d.ts.map +0 -1
  277. package/dist/faqts/node.js +0 -23
  278. package/dist/faqts/node.js.map +0 -1
  279. package/dist/faqts/run.d.ts +0 -62
  280. package/dist/faqts/run.d.ts.map +0 -1
  281. package/dist/faqts/run.js +0 -62
  282. package/dist/faqts/run.js.map +0 -1
  283. package/dist/faqts/transform.d.ts +0 -43
  284. package/dist/faqts/transform.d.ts.map +0 -1
  285. package/dist/faqts/transform.js +0 -35
  286. package/dist/faqts/transform.js.map +0 -1
  287. package/dist/lang/compile.d.ts +0 -50
  288. package/dist/lang/compile.d.ts.map +0 -1
  289. package/dist/lang/compile.js +0 -368
  290. package/dist/lang/compile.js.map +0 -1
  291. package/dist/lang/keep.d.ts +0 -109
  292. package/dist/lang/keep.d.ts.map +0 -1
  293. package/dist/lang/keep.js +0 -226
  294. package/dist/lang/keep.js.map +0 -1
  295. package/dist/lang/parser.d.ts +0 -91
  296. package/dist/lang/parser.d.ts.map +0 -1
  297. package/dist/lang/parser.js +0 -1594
  298. package/dist/lang/parser.js.map +0 -1
  299. package/dist/mesh/drill-hole/DrillHoleCore.d.ts +0 -90
  300. package/dist/mesh/drill-hole/DrillHoleCore.d.ts.map +0 -1
  301. package/dist/mesh/drill-hole/DrillHoleCore.js +0 -287
  302. package/dist/mesh/drill-hole/DrillHoleCore.js.map +0 -1
  303. package/dist/mesh/drill-hole/drill-types.d.ts +0 -34
  304. package/dist/mesh/drill-hole/drill-types.d.ts.map +0 -1
  305. package/dist/mesh/drill-hole/drill-types.js +0 -7
  306. package/dist/mesh/drill-hole/drill-types.js.map +0 -1
  307. package/dist/mesh/fai_drill.d.ts +0 -21
  308. package/dist/mesh/fai_drill.d.ts.map +0 -1
  309. package/dist/mesh/fai_drill.js +0 -92
  310. package/dist/mesh/fai_drill.js.map +0 -1
  311. package/dist/mesh/fai_extrude.d.ts +0 -24
  312. package/dist/mesh/fai_extrude.d.ts.map +0 -1
  313. package/dist/mesh/fai_extrude.js +0 -42
  314. package/dist/mesh/fai_extrude.js.map +0 -1
  315. package/dist/mesh/fai_split.d.ts +0 -164
  316. package/dist/mesh/fai_split.d.ts.map +0 -1
  317. package/dist/mesh/fai_split.js +0 -269
  318. package/dist/mesh/fai_split.js.map +0 -1
  319. package/dist/primitives/svg-extrude.d.ts +0 -43
  320. package/dist/primitives/svg-extrude.d.ts.map +0 -1
  321. package/dist/primitives/svg-extrude.js +0 -78
  322. package/dist/primitives/svg-extrude.js.map +0 -1
  323. package/dist/primitives/text/cjk.d.ts +0 -61
  324. package/dist/primitives/text/cjk.d.ts.map +0 -1
  325. package/dist/primitives/text/cjk.js +0 -215
  326. package/dist/primitives/text/cjk.js.map +0 -1
  327. package/dist/primitives/text-geometry.d.ts +0 -47
  328. package/dist/primitives/text-geometry.d.ts.map +0 -1
  329. package/dist/primitives/text-geometry.js +0 -127
  330. package/dist/primitives/text-geometry.js.map +0 -1
  331. package/dist/test-helpers.d.ts +0 -31
  332. package/dist/test-helpers.d.ts.map +0 -1
  333. package/dist/test-helpers.js +0 -55
  334. package/dist/test-helpers.js.map +0 -1
  335. package/dist/vendored/brepjs/core/kernelReentrancy.d.ts +0 -41
  336. package/dist/vendored/brepjs/core/kernelReentrancy.d.ts.map +0 -1
  337. package/dist/vendored/brepjs/core/kernelReentrancy.js +0 -68
  338. package/dist/vendored/brepjs/core/kernelReentrancy.js.map +0 -1
@@ -11,10 +11,15 @@
11
11
  * 接触 occt-wasm 类型。
12
12
  */
13
13
  import { registerBrepEngine, hasBrepEngine, isBrepEngineRegistered } from '../registry.js';
14
+ import { OcctWasmAdapter } from '../../../vendored/brepjs/kernel/occtWasm/occtWasmAdapter.js';
14
15
  import { initOcctWasm } from '../../../occt-kernel/occtKernel.js';
15
- import { bindOcctKernel } from '../../../api/occt-kernel-bridge.js';
16
+ import { injectCurrentBrepEngineAsKernel } from '../../../api/occt-kernel-bridge.js';
16
17
  /** OCCT 引擎注册 id(默认 BREP 引擎;首个注册自动成为默认)。 */
17
18
  export const OCCT_BREP_ENGINE_ID = 'occt';
19
+ // Phase 2 幂等护栏:occt-wasm 是进程级单例,registerOcctBrepEngine 可能被多次调用
20
+ // (测试重置注册表后重注册)。pattern 三方法只覆写一次——重复覆写会捕获到上一轮
21
+ // 覆写版(返回 BrepHandle[]),把它当 compound 拆 → getSubShapes: Invalid shape ID: 0。
22
+ let occtPatternWired = false;
18
23
  /**
19
24
  * OCCT 实际提供的 `*WithHistory` 核函数名(Phase 0.2:逐核函数如实声明)。
20
25
  *
@@ -23,37 +28,245 @@ export const OCCT_BREP_ENGINE_ID = 'occt';
23
28
  * 冒烟测试(`brep/engine/evolution-bindings.test.ts`——因 `initOcctWasm` 的返回类型
24
29
  * 被 `as unknown as` 硬断言,编译期守卫是空转的,只有运行时测试能证明它们真在)。
25
30
  */
26
- const OCCT_EVOLUTION_KINDS = [
31
+ /**
32
+ * 非演化内核方法全集(BrepMethodKind)——occt-wasm 是参考内核,vendored
33
+ * occtWasmAdapter 提供全部方法(occt-kernel/initOcctWasm 包装同一实例),
34
+ * 逐核如实声明(Phase 1,P2 缺口补齐)。
35
+ *
36
+ * ⚠️ Phase 2 修正(能力声明=可执行语义):
37
+ * - 保留 `gridPattern`:occt-wasm 无原生 gridPattern,但 vendored gridPattern
38
+ * 有回退路径(嵌套 linearPattern,patternFns.ts)且本适配器新增组合实现
39
+ * ——occt 下 gridPattern op 可执行,声明成立;
40
+ * - 移除 `rectangularPattern`:occt-wasm 无此内核方法,vendored rectangularPattern
41
+ * 是纯 JS 组合(compoundOpsFns.ts translate+fuseAll,不调内核)——无 op 依赖
42
+ * 该能力名,声明即虚假(capability-map 实证 36 op 无一依赖)。
43
+ */
44
+ const OCCT_METHOD_KINDS = [
45
+ 'linearPattern',
46
+ 'circularPattern',
47
+ 'gridPattern',
48
+ 'mirror',
49
+ 'rotate',
50
+ 'translate',
51
+ 'scale',
52
+ 'makeRectangle',
53
+ 'shell',
54
+ 'extrude',
55
+ 'loft',
56
+ 'loftAdvanced',
57
+ 'section',
58
+ 'sweepPipeShell',
59
+ 'simplePipe',
60
+ 'revolveVec',
61
+ 'buildExtrusionLaw',
27
62
  'fuse',
28
63
  'cut',
29
64
  'intersect',
30
- 'fillet',
65
+ 'fuseAll',
66
+ 'makeArcEdge',
67
+ 'makeBezierEdge',
68
+ 'makeCylinder',
69
+ 'makeEllipsoid',
70
+ 'makeFace',
71
+ 'makeFaceOnSurface',
72
+ 'makeLineEdge',
73
+ 'makeTorus',
74
+ 'makeVertex',
75
+ 'makeWireFromMixed',
76
+ 'buildEdgeOnSurface',
77
+ 'addHolesInFace',
78
+ 'buildTriFace',
79
+ 'sew',
80
+ 'sewAndSolidify',
81
+ 'healFace',
82
+ 'healSolid',
83
+ 'healWire',
84
+ 'fixShape',
85
+ 'fixSelfIntersection',
86
+ 'isValid',
87
+ 'removeDegenerateEdges',
88
+ 'simplify',
89
+ 'split',
90
+ 'boundingBox',
91
+ 'curveParameters',
92
+ 'curvePointAtParam',
93
+ 'curveTangent',
94
+ 'hullFromPoints',
95
+ 'isNull',
96
+ 'iterShapes',
97
+ 'locate',
98
+ 'shapeType',
99
+ 'surfaceCenterOfMass',
100
+ 'surfaceNormal',
101
+ 'surfaceType',
102
+ 'uvBounds',
103
+ 'composeTransform',
104
+ 'applyComposedTransformWithHistory',
105
+ 'generalTransformNonOrthogonal',
106
+ 'generalTransformWithHistory',
107
+ 'importStl',
108
+ 'createXCAFDocument',
109
+ 'importXCAFFromSTEP',
110
+ 'copyShape',
111
+ 'dispose',
112
+ 'downcast',
113
+ 'hashCode',
114
+ // Phase 2:chamfer/fillet 基础方法(directEdit 族逐核真名;occt-wasm 原生提供,
115
+ // brepkit 无——chamfer op 静态判定执行前报错)
31
116
  'chamfer',
32
- 'translate',
33
- 'rotate',
34
- 'mirror',
35
- 'scale',
36
- 'shell',
37
- 'offset',
38
- 'thicken',
117
+ 'chamferDistAngle',
118
+ 'fillet',
119
+ 'filletVariable',
120
+ ];
121
+ const OCCT_EVOLUTION_KINDS = [
122
+ 'fuseWithHistory',
123
+ 'cutWithHistory',
124
+ 'intersectWithHistory',
125
+ 'filletWithHistory',
126
+ 'chamferWithHistory',
127
+ 'translateWithHistory',
128
+ 'rotateWithHistory',
129
+ 'mirrorWithHistory',
130
+ 'scaleWithHistory',
131
+ 'shellWithHistory',
132
+ 'offsetWithHistory',
133
+ 'thickenWithHistory',
39
134
  ];
40
135
  /**
41
- * 装配 OCCT BREP 引擎(宿主启动时调用一次,幂等)。
42
- *
43
- * 预初始化 initOcctWasm():wasm 加载完成后立即注册——保证注册返回后
44
- * getKernel() 立即可用(occt-kernel 单例已就绪),provider 直接返回预初始化实例。
45
- * 幂等:已注册(含运行时默认装配或宿主先行注册)则跳过注册,仅确保 wasm 预初始化。
136
+ * 装配 OCCT BREP 引擎(幂等;pattern 三方法仅首次覆写,见上方长注释)。
46
137
  */
47
138
  export async function registerOcctBrepEngine() {
48
139
  const primitives = await initOcctWasm();
49
140
  if (isBrepEngineRegistered(OCCT_BREP_ENGINE_ID))
50
141
  return;
142
+ // Phase 2:occt-wasm 原生 linearPattern/circularPattern 返回 compound(含全部副本),
143
+ // BrepEngineApi 契约要求 BrepHandle[](各份副本)→ 在此拆 compound(getSubShapes)。
144
+ // gridPattern 无原生内核函数 → 组合实现(嵌套 linearPattern + fuseAll,与 vendored
145
+ // 回退路径同构);拆出的子句柄由调用方 release,compound 容器拆完即释放。
146
+ // ⚠️ initOcctWasm 的返回类型在 occtKernel.ts 被硬断言为 BrepEngineApi(linearPattern
147
+ // 签名 BrepHandle[]),但运行时 occt-wasm 的 linearPattern/circularPattern 返回**单个
148
+ // compound 句柄**(含全部副本)——类型撒谎。此处以运行时原始形态(OcctPatternRaw)
149
+ // 调用,再经 getSubShapes 拆成数组(与 vendored transformOps.linearPattern 同构)。
150
+ // 不能使用对象展开({ ...primitives }):OcctKernel 的方法在原型上(class 实例),
151
+ // 展开只拷自有属性 → makeBoxFromCorners 等全部原型方法丢失(consume-input.test 实证)。
152
+ // 直接覆盖单例实例的 pattern 三方法(occt-wasm 单例,无共享状态风险)。
153
+ // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern
154
+ // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。
155
+ const raw = primitives;
156
+ // ⚠️ 幂等护栏:occt-wasm 是进程级单例,宿主可能多次调用本注册(测试重置注册表后
157
+ // 重注册)。重复覆写会捕获到上一轮覆写版(返回 BrepHandle[]),把它当 compound 拆
158
+ // → `getSubShapes: Invalid shape ID: 0`(engine-switch-p2 parity 实证)。只覆写一次,
159
+ // raw 与 occtApi 指向同一单例,后续注册直接复用覆写结果。
160
+ if (!occtPatternWired) {
161
+ // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern
162
+ // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。
163
+ const nativeLinearPattern = raw.linearPattern.bind(raw);
164
+ const nativeCircularPattern = raw.circularPattern.bind(raw);
165
+ const occtApi = primitives;
166
+ occtApi.linearPattern = (shape, direction, spacing, count) => {
167
+ const compound = nativeLinearPattern(shape, direction, spacing, count);
168
+ const parts = raw.getSubShapes(compound, 'solid');
169
+ raw.release(compound);
170
+ return parts.map((h) => h);
171
+ };
172
+ occtApi.circularPattern = (shape, center, axis, angleStep, count) => {
173
+ const compound = nativeCircularPattern(shape, center, axis, angleStep, count);
174
+ const parts = raw.getSubShapes(compound, 'solid');
175
+ raw.release(compound);
176
+ return parts.map((h) => h);
177
+ };
178
+ occtApi.gridPattern = (shape, directionX, directionY, spacingX, spacingY, countX, countY) => {
179
+ // ⚠️ 内部必须用捕获的 nativeLinearPattern:此时 raw.linearPattern 已被覆写为
180
+ // BrepHandle[] 语义,误用会把数组当 compound 拆(同上红线实证)。
181
+ const colCompound = nativeLinearPattern(shape, directionX, spacingX, countX);
182
+ const cols = raw.getSubShapes(colCompound, 'solid');
183
+ raw.release(colCompound);
184
+ const all = [];
185
+ try {
186
+ for (const c of cols) {
187
+ const rowCompound = nativeLinearPattern(c, directionY, spacingY, countY);
188
+ try {
189
+ all.push(...raw.getSubShapes(rowCompound, 'solid'));
190
+ }
191
+ finally {
192
+ raw.release(rowCompound);
193
+ }
194
+ }
195
+ }
196
+ finally {
197
+ for (const c of cols)
198
+ raw.release(c);
199
+ }
200
+ return raw.fuseAll(all);
201
+ };
202
+ // ═══ Phase 3:能力表 33 个登记方法接线(capability-map 64 方法收口) ═══
203
+ // 原则:能力表声明了(OCCT_METHOD_KINDS 含全部 33)→ 实例必须可实现,否则静态
204
+ // 判定放行后运行时崩(红线)。18 个 occt-wasm 原生导出直接绑定(签名与
205
+ // BrepEngineApi 一致:Vec3=BrepVec3、ShapeHandle=BrepHandle);15 个组合方法
206
+ // (occt-wasm 无原生导出)经 vendored OcctWasmAdapter 组合面代理 + 形态转换。
207
+ // 只接线一次(occtPatternWired 护栏内);重复注册复用覆写结果,不重复捕获。
208
+ const k = primitives;
209
+ occtApi.buildExtrusionLaw = k.buildExtrusionLaw.bind(primitives);
210
+ occtApi.composeTransform = k.composeTransform.bind(primitives);
211
+ occtApi.downcast = k.downcast.bind(primitives);
212
+ occtApi.healFace = k.healFace.bind(primitives);
213
+ occtApi.healWire = k.healWire.bind(primitives);
214
+ occtApi.isNull = k.isNull.bind(primitives);
215
+ occtApi.iterShapes = k.iterShapes.bind(primitives);
216
+ occtApi.makeEllipsoid = k.makeEllipsoid.bind(primitives);
217
+ occtApi.makeFaceOnSurface = k.makeFaceOnSurface.bind(primitives);
218
+ occtApi.makeTorus = k.makeTorus.bind(primitives);
219
+ occtApi.makeVertex = k.makeVertex.bind(primitives);
220
+ occtApi.mirror = k.mirror.bind(primitives);
221
+ occtApi.sew = k.sew.bind(primitives);
222
+ occtApi.shell = k.shell.bind(primitives);
223
+ occtApi.simplePipe = k.simplePipe.bind(primitives);
224
+ occtApi.simplify = k.simplify.bind(primitives);
225
+ occtApi.split = k.split.bind(primitives);
226
+ occtApi.sweepPipeShell = k.sweepPipeShell.bind(primitives);
227
+ const vendor = OcctWasmAdapter.fromKernel(primitives);
228
+ occtApi.boundingBox = (shape) => {
229
+ const b = vendor.boundingBox(shape);
230
+ return { xmin: b.min[0], ymin: b.min[1], zmin: b.min[2], xmax: b.max[0], ymax: b.max[1], zmax: b.max[2] };
231
+ };
232
+ occtApi.shapeType = (shape) => vendor.shapeType(shape);
233
+ occtApi.surfaceCenterOfMass = (face) => {
234
+ const v = vendor.surfaceCenterOfMass(face);
235
+ return { x: v[0], y: v[1], z: v[2] };
236
+ };
237
+ occtApi.locate = (shape, matrix) => vendor.locate(shape, matrix);
238
+ occtApi.copyShape = (shape) => vendor.copyShape(shape);
239
+ occtApi.fixSelfIntersection = (wire) => vendor.fixSelfIntersection(wire);
240
+ occtApi.hullFromPoints = (points, tolerance) => vendor.hullFromPoints(points, tolerance);
241
+ occtApi.loftAdvanced = (wires, options) => vendor.loftAdvanced(wires, options);
242
+ occtApi.makeWireFromMixed = (items) => vendor.makeWireFromMixed(items);
243
+ occtApi.revolveVec = (shape, center, direction, angleDeg) => vendor.revolveVec(shape, [center.x, center.y, center.z], [direction.x, direction.y, direction.z], angleDeg);
244
+ occtApi.buildEdgeOnSurface = (curve, surface) => vendor.buildEdgeOnSurface(curve, surface);
245
+ occtApi.dispose = (shape) => { if (shape !== undefined)
246
+ raw.release(shape); };
247
+ occtApi.generalTransformNonOrthogonal = (shape, matrix) => vendor.generalTransformNonOrthogonal(shape, matrix.slice(0, 9), matrix.slice(9, 12));
248
+ const toEvolution = (op) => {
249
+ const segments = (m) => {
250
+ const out = [];
251
+ for (const [inHash, outHashes] of m)
252
+ out.push(inHash, outHashes.length, ...outHashes);
253
+ return out;
254
+ };
255
+ return { result: op.shape, modified: segments(op.evolution.modified), generated: segments(op.evolution.generated), deleted: [...op.evolution.deleted] };
256
+ };
257
+ occtApi.generalTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) => toEvolution(vendor.generalTransformWithHistory(shape, matrix.slice(0, 9), matrix.slice(9, 12), false, inputFaceHashes, hashUpperBound));
258
+ occtApi.applyComposedTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) => toEvolution(vendor.applyComposedTransformWithHistory(shape, matrix, inputFaceHashes, hashUpperBound));
259
+ occtPatternWired = true;
260
+ }
261
+ const occtApi = primitives;
51
262
  registerBrepEngine(OCCT_BREP_ENGINE_ID, async () => ({
52
263
  id: OCCT_BREP_ENGINE_ID,
53
- primitives,
264
+ primitives: occtApi,
54
265
  capabilities: {
55
266
  // 面演化:逐核函数名单(不是族级布尔——见 BrepEvolutionKind)。
56
267
  evolution: OCCT_EVOLUTION_KINDS,
268
+ // 非演化内核方法:逐核如实声明(Phase 1,P2 缺口补齐;op 声明按此静态判定)。
269
+ methods: OCCT_METHOD_KINDS,
57
270
  heal: true,
58
271
  directEdit: true,
59
272
  advSurface: true,
@@ -65,9 +278,10 @@ export async function registerOcctBrepEngine() {
65
278
  tessellationModel: 'extract-time',
66
279
  },
67
280
  }));
68
- // P7-②:同一装配点把移植内核注册表绑定到同一个 occt-wasm 实例(D10 单实例 + 冻结)。
281
+ // P7-②:同一装配点把移植内核注册表注入到当前 BREP 引擎(Phase 2 P2-5:取代旧的
282
+ // bindOcctKernel() 固定绑定,改为引擎中立的 injectCurrentBrepEngineAsKernel)。
69
283
  // 使 L3 调移植 L2 的 op 在宿主装配后立即可用;幂等,重复调用安全。
70
- bindOcctKernel();
284
+ await injectCurrentBrepEngineAsKernel();
71
285
  }
72
286
  /**
73
287
  * 内置默认 BREP 引擎装配(OCCT):宿主未注册任何引擎时的缺省值。
@@ -1 +1 @@
1
- {"version":3,"file":"occt.js","sourceRoot":"","sources":["../../../../src/brep/engine/adapters/occt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAmB,MAAM,aAAa,CAAA;AAGxG,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAEzC;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG;IAC3B,MAAM;IACN,KAAK;IACL,WAAW;IACX,QAAQ;IACR,SAAS;IACT,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,SAAS;CACsC,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,MAAM,UAAU,GAAG,MAAM,YAAY,EAAE,CAAA;IACvC,IAAI,sBAAsB,CAAC,mBAAmB,CAAC;QAAE,OAAM;IACvD,kBAAkB,CAAC,mBAAmB,EAAE,KAAK,IAAyB,EAAE,CAAC,CAAC;QACxE,EAAE,EAAE,mBAAmB;QACvB,UAAU;QACV,YAAY,EAAE;YACZ,2CAA2C;YAC3C,SAAS,EAAE,oBAAoB;YAC/B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,kEAAkE;YAClE,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,cAAc;SAClC;KACF,CAAC,CAAC,CAAA;IACH,uDAAuD;IACvD,yCAAyC;IACzC,cAAc,EAAE,CAAA;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,IAAI,aAAa,EAAE;QAAE,OAAM;IAC3B,MAAM,sBAAsB,EAAE,CAAA;AAChC,CAAC","sourcesContent":["/**\n * engine/adapters/occt — OCCT BREP 引擎适配器(槽位 1 的默认实现)\n *\n *\n * 本文件是「occt 引擎实现」的注册入口:把 occt-kernel 的 initOcctWasm 包装为\n * BrepEngine 注册进注册表。业务层(runtime/brep ops/stdlib)只经注册表取引擎,\n * 不直接 import occt 初始化函数——引擎本体可整体替换(换一个适配器即换引擎)。\n *\n * OCCT 类型耦合(import 'occt-wasm')只存在于 occt-kernel/occtKernel.ts(A1 验收\n * 允许的唯一耦合区);本文件经 initOcctWasm 函数边界获得 BrepEngineApi,不直接\n * 接触 occt-wasm 类型。\n */\n\nimport { registerBrepEngine, hasBrepEngine, isBrepEngineRegistered, type BrepEngine } from '../registry'\nimport type { AssertSatisfiesBrepEngineApi } from '../primitives'\nimport type { BrepEvolutionKind } from '../types'\nimport { initOcctWasm } from '../../../occt-kernel/occtKernel'\nimport { bindOcctKernel } from '../../../api/occt-kernel-bridge'\n\n/** OCCT 引擎注册 id(默认 BREP 引擎;首个注册自动成为默认)。 */\nexport const OCCT_BREP_ENGINE_ID = 'occt'\n\n/**\n * OCCT 实际提供的 `*WithHistory` 核函数名(Phase 0.2:逐核函数如实声明)。\n *\n * 12 个全部由 `occt-wasm@3.8.4` 提供(`dist/index.d.ts` 的 `*WithHistory` 声明),\n * 且 faijs 侧已全部绑定(`brep/engine/primitives.ts` 的 `BrepEngineApi`)并有运行时\n * 冒烟测试(`brep/engine/evolution-bindings.test.ts`——因 `initOcctWasm` 的返回类型\n * 被 `as unknown as` 硬断言,编译期守卫是空转的,只有运行时测试能证明它们真在)。\n */\nconst OCCT_EVOLUTION_KINDS = [\n 'fuse',\n 'cut',\n 'intersect',\n 'fillet',\n 'chamfer',\n 'translate',\n 'rotate',\n 'mirror',\n 'scale',\n 'shell',\n 'offset',\n 'thicken',\n] as const satisfies readonly BrepEvolutionKind[]\n\n/**\n * 装配 OCCT BREP 引擎(宿主启动时调用一次,幂等)。\n *\n * 预初始化 initOcctWasm():wasm 加载完成后立即注册——保证注册返回后\n * getKernel() 立即可用(occt-kernel 单例已就绪),provider 直接返回预初始化实例。\n * 幂等:已注册(含运行时默认装配或宿主先行注册)则跳过注册,仅确保 wasm 预初始化。\n */\nexport async function registerOcctBrepEngine(): Promise<void> {\n const primitives = await initOcctWasm()\n if (isBrepEngineRegistered(OCCT_BREP_ENGINE_ID)) return\n registerBrepEngine(OCCT_BREP_ENGINE_ID, async (): Promise<BrepEngine> => ({\n id: OCCT_BREP_ENGINE_ID,\n primitives,\n capabilities: {\n // 面演化:逐核函数名单(不是族级布尔——见 BrepEvolutionKind)。\n evolution: OCCT_EVOLUTION_KINDS,\n heal: true,\n directEdit: true,\n advSurface: true,\n assembly: true,\n // P7 并入(D4):OCCT 是精确 B-rep 内核——如实声明 brepjs KernelCapabilities 字段。\n exact: true,\n brepExport: true,\n exactMeasurement: true,\n tessellationModel: 'extract-time',\n },\n }))\n // P7-②:同一装配点把移植内核注册表绑定到同一个 occt-wasm 实例(D10 单实例 + 冻结)。\n // 使 L3 调移植 L2 的 op 在宿主装配后立即可用;幂等,重复调用安全。\n bindOcctKernel()\n}\n\n/**\n * 内置默认 BREP 引擎装配(OCCT):宿主未注册任何引擎时的缺省值。\n *\n * OCCT 是 faijs 的默认 BREP 引擎——低频率、静态的替换:换引擎 = 宿主在\n * 装配期显式注册其它引擎(首个注册者为默认),或改本处默认。宿主无需为\n * 每次使用自行提供引擎;本函数幂等,已注册任何引擎则 no-op。\n */\nexport async function ensureOcctDefaultEngine(): Promise<void> {\n if (hasBrepEngine()) return\n await registerOcctBrepEngine()\n}\n\n// §7.8 编译期守卫:initOcctWasm 的返回类型必须满足 BrepEngineApi。\n// 若未来 occt-kernel 的导出类型不再满足接口(如接口新增方法)→ tsc 报错列出缺失。\ntype _AssertOcctApi = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n"]}
1
+ {"version":3,"file":"occt.js","sourceRoot":"","sources":["../../../../src/brep/engine/adapters/occt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAmB,MAAM,aAAa,CAAA;AAIxG,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAA;AAEjF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAEzC,+DAA+D;AAC/D,8CAA8C;AAC9C,2EAA2E;AAC3E,IAAI,gBAAgB,GAAG,KAAK,CAAA;AAE5B;;;;;;;GAOG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,iBAAiB,GAAG;IACxB,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,eAAe;IACf,OAAO;IACP,SAAS;IACT,MAAM;IACN,cAAc;IACd,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,MAAM;IACN,KAAK;IACL,WAAW;IACX,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,UAAU;IACV,mBAAmB;IACnB,cAAc;IACd,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,KAAK;IACL,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,UAAU;IACV,UAAU;IACV,qBAAqB;IACrB,SAAS;IACT,uBAAuB;IACvB,UAAU;IACV,OAAO;IACP,aAAa;IACb,iBAAiB;IAC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QACnB,YAAY,EAAE;YACZ,2CAA2C;YAC3C,SAAS,EAAE,oBAAoB;YAC/B,+CAA+C;YAC/C,OAAO,EAAE,iBAAiB;YAC1B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,kEAAkE;YAClE,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,cAAc;SAClC;KACF,CAAC,CAAC,CAAA;IACH,oDAAoD;IACpD,kEAAkE;IAClE,yCAAyC;IACzC,MAAM,+BAA+B,EAAE,CAAA;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB;IAC3C,IAAI,aAAa,EAAE;QAAE,OAAM;IAC3B,MAAM,sBAAsB,EAAE,CAAA;AAChC,CAAC","sourcesContent":["/**\n * engine/adapters/occt — OCCT BREP 引擎适配器(槽位 1 的默认实现)\n *\n *\n * 本文件是「occt 引擎实现」的注册入口:把 occt-kernel 的 initOcctWasm 包装为\n * BrepEngine 注册进注册表。业务层(runtime/brep ops/stdlib)只经注册表取引擎,\n * 不直接 import occt 初始化函数——引擎本体可整体替换(换一个适配器即换引擎)。\n *\n * OCCT 类型耦合(import 'occt-wasm')只存在于 occt-kernel/occtKernel.ts(A1 验收\n * 允许的唯一耦合区);本文件经 initOcctWasm 函数边界获得 BrepEngineApi,不直接\n * 接触 occt-wasm 类型。\n */\n\nimport { registerBrepEngine, hasBrepEngine, isBrepEngineRegistered, type BrepEngine } from '../registry'\nimport type { AssertSatisfiesBrepEngineApi, BrepEngineApi } from '../primitives'\nimport type { BrepEvolutionKind, BrepMethodKind } from '../types'\nimport type { BrepEvolutionData, BrepHandle, BrepSubShapeType, BrepVec3 } from '../types'\nimport { OcctWasmAdapter } from '../../../vendored/brepjs/kernel/occtWasm/occtWasmAdapter'\nimport { initOcctWasm } from '../../../occt-kernel/occtKernel'\nimport { injectCurrentBrepEngineAsKernel } from '../../../api/occt-kernel-bridge'\n\n/** OCCT 引擎注册 id(默认 BREP 引擎;首个注册自动成为默认)。 */\nexport const OCCT_BREP_ENGINE_ID = 'occt'\n\n// Phase 2 幂等护栏:occt-wasm 是进程级单例,registerOcctBrepEngine 可能被多次调用\n// (测试重置注册表后重注册)。pattern 三方法只覆写一次——重复覆写会捕获到上一轮\n// 覆写版(返回 BrepHandle[]),把它当 compound 拆 → getSubShapes: Invalid shape ID: 0。\nlet occtPatternWired = false\n\n/**\n * OCCT 实际提供的 `*WithHistory` 核函数名(Phase 0.2:逐核函数如实声明)。\n *\n * 12 个全部由 `occt-wasm@3.8.4` 提供(`dist/index.d.ts` 的 `*WithHistory` 声明),\n * 且 faijs 侧已全部绑定(`brep/engine/primitives.ts` 的 `BrepEngineApi`)并有运行时\n * 冒烟测试(`brep/engine/evolution-bindings.test.ts`——因 `initOcctWasm` 的返回类型\n * 被 `as unknown as` 硬断言,编译期守卫是空转的,只有运行时测试能证明它们真在)。\n */\n/**\n * 非演化内核方法全集(BrepMethodKind)——occt-wasm 是参考内核,vendored\n * occtWasmAdapter 提供全部方法(occt-kernel/initOcctWasm 包装同一实例),\n * 逐核如实声明(Phase 1,P2 缺口补齐)。\n *\n * ⚠️ Phase 2 修正(能力声明=可执行语义):\n * - 保留 `gridPattern`:occt-wasm 无原生 gridPattern,但 vendored gridPattern\n * 有回退路径(嵌套 linearPattern,patternFns.ts)且本适配器新增组合实现\n * ——occt 下 gridPattern op 可执行,声明成立;\n * - 移除 `rectangularPattern`:occt-wasm 无此内核方法,vendored rectangularPattern\n * 是纯 JS 组合(compoundOpsFns.ts translate+fuseAll,不调内核)——无 op 依赖\n * 该能力名,声明即虚假(capability-map 实证 36 op 无一依赖)。\n */\nconst OCCT_METHOD_KINDS = [\n 'linearPattern',\n 'circularPattern',\n 'gridPattern',\n 'mirror',\n 'rotate',\n 'translate',\n 'scale',\n 'makeRectangle',\n 'shell',\n 'extrude',\n 'loft',\n 'loftAdvanced',\n 'section',\n 'sweepPipeShell',\n 'simplePipe',\n 'revolveVec',\n 'buildExtrusionLaw',\n 'fuse',\n 'cut',\n 'intersect',\n 'fuseAll',\n 'makeArcEdge',\n 'makeBezierEdge',\n 'makeCylinder',\n 'makeEllipsoid',\n 'makeFace',\n 'makeFaceOnSurface',\n 'makeLineEdge',\n 'makeTorus',\n 'makeVertex',\n 'makeWireFromMixed',\n 'buildEdgeOnSurface',\n 'addHolesInFace',\n 'buildTriFace',\n 'sew',\n 'sewAndSolidify',\n 'healFace',\n 'healSolid',\n 'healWire',\n 'fixShape',\n 'fixSelfIntersection',\n 'isValid',\n 'removeDegenerateEdges',\n 'simplify',\n 'split',\n 'boundingBox',\n 'curveParameters',\n 'curvePointAtParam',\n 'curveTangent',\n 'hullFromPoints',\n 'isNull',\n 'iterShapes',\n 'locate',\n 'shapeType',\n 'surfaceCenterOfMass',\n 'surfaceNormal',\n 'surfaceType',\n 'uvBounds',\n 'composeTransform',\n 'applyComposedTransformWithHistory',\n 'generalTransformNonOrthogonal',\n 'generalTransformWithHistory',\n 'importStl',\n 'createXCAFDocument',\n 'importXCAFFromSTEP',\n 'copyShape',\n 'dispose',\n 'downcast',\n 'hashCode',\n // Phase 2:chamfer/fillet 基础方法(directEdit 族逐核真名;occt-wasm 原生提供,\n // brepkit 无——chamfer op 静态判定执行前报错)\n 'chamfer',\n 'chamferDistAngle',\n 'fillet',\n 'filletVariable',\n] as const satisfies readonly BrepMethodKind[]\n\nconst OCCT_EVOLUTION_KINDS = [\n 'fuseWithHistory',\n 'cutWithHistory',\n 'intersectWithHistory',\n 'filletWithHistory',\n 'chamferWithHistory',\n 'translateWithHistory',\n 'rotateWithHistory',\n 'mirrorWithHistory',\n 'scaleWithHistory',\n 'shellWithHistory',\n 'offsetWithHistory',\n 'thickenWithHistory',\n] as const satisfies readonly BrepEvolutionKind[]\n\n/**\n * 装配 OCCT BREP 引擎(宿主启动时调用一次,幂等)。\n *\n * 预初始化 initOcctWasm():wasm 加载完成后立即注册——保证注册返回后\n * getKernel() 立即可用(occt-kernel 单例已就绪),provider 直接返回预初始化实例。\n * 幂等:已注册(含运行时默认装配或宿主先行注册)则跳过注册,仅确保 wasm 预初始化。\n */\n/** occt-wasm 运行时原始 pattern 形态(initOcctWasm 返回类型被硬断言,此处如实还原)。 */\ninterface OcctPatternRaw {\n // occt-wasm 原生签名(dist/index.d.ts:230-231 实证):方向/中心/轴是 **Vec3 对象**\n // ({x,y,z}),4/5 参数形态。⚠️ vendored transformOps.ts 的分量式调用(6/9 参数)\n // 是 brepjs 内部 OcctKernelWasm 的假定面,对真实 occt-wasm 不成立(运行实证崩),\n // Phase 3 全量收敛时单独处置。\n linearPattern(shape: number, direction: { x: number; y: number; z: number }, spacing: number, count: number): number\n circularPattern(shape: number, center: { x: number; y: number; z: number }, axis: { x: number; y: number; z: number }, angleStep: number, count: number): number\n getSubShapes(shape: number, type: 'solid'): number[]\n release(shape: number): void\n fuseAll(shapes: number[]): number\n}\n\n/**\n * 装配 OCCT BREP 引擎(幂等;pattern 三方法仅首次覆写,见上方长注释)。\n */\nexport async function registerOcctBrepEngine(): Promise<void> {\n const primitives = await initOcctWasm()\n if (isBrepEngineRegistered(OCCT_BREP_ENGINE_ID)) return\n // Phase 2:occt-wasm 原生 linearPattern/circularPattern 返回 compound(含全部副本),\n // BrepEngineApi 契约要求 BrepHandle[](各份副本)→ 在此拆 compound(getSubShapes)。\n // gridPattern 无原生内核函数 → 组合实现(嵌套 linearPattern + fuseAll,与 vendored\n // 回退路径同构);拆出的子句柄由调用方 release,compound 容器拆完即释放。\n // ⚠️ initOcctWasm 的返回类型在 occtKernel.ts 被硬断言为 BrepEngineApi(linearPattern\n // 签名 BrepHandle[]),但运行时 occt-wasm 的 linearPattern/circularPattern 返回**单个\n // compound 句柄**(含全部副本)——类型撒谎。此处以运行时原始形态(OcctPatternRaw)\n // 调用,再经 getSubShapes 拆成数组(与 vendored transformOps.linearPattern 同构)。\n // 不能使用对象展开({ ...primitives }):OcctKernel 的方法在原型上(class 实例),\n // 展开只拷自有属性 → makeBoxFromCorners 等全部原型方法丢失(consume-input.test 实证)。\n // 直接覆盖单例实例的 pattern 三方法(occt-wasm 单例,无共享状态风险)。\n // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern\n // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。\n const raw = primitives as unknown as OcctPatternRaw\n // ⚠️ 幂等护栏:occt-wasm 是进程级单例,宿主可能多次调用本注册(测试重置注册表后\n // 重注册)。重复覆写会捕获到上一轮覆写版(返回 BrepHandle[]),把它当 compound 拆\n // → `getSubShapes: Invalid shape ID: 0`(engine-switch-p2 parity 实证)。只覆写一次,\n // raw 与 occtApi 指向同一单例,后续注册直接复用覆写结果。\n if (!occtPatternWired) {\n // ⚠️ 覆盖前必须先捕获原生 linearPattern/circularPattern:覆盖后 raw.linearPattern\n // 会指向 occtApi.linearPattern 自身 → 无限递归(Maximum call stack size exceeded 实证)。\n const nativeLinearPattern = raw.linearPattern.bind(raw)\n const nativeCircularPattern = raw.circularPattern.bind(raw)\n const occtApi = primitives as BrepEngineApi\n occtApi.linearPattern = (shape, direction, spacing, count) => {\n const compound = nativeLinearPattern(shape, direction, spacing, count)\n const parts = raw.getSubShapes(compound, 'solid')\n raw.release(compound)\n return parts.map((h) => h as BrepHandle)\n }\n occtApi.circularPattern = (shape, center, axis, angleStep, count) => {\n const compound = nativeCircularPattern(shape, center, axis, angleStep, count)\n const parts = raw.getSubShapes(compound, 'solid')\n raw.release(compound)\n return parts.map((h) => h as BrepHandle)\n }\n occtApi.gridPattern = (shape, directionX, directionY, spacingX, spacingY, countX, countY) => {\n // ⚠️ 内部必须用捕获的 nativeLinearPattern:此时 raw.linearPattern 已被覆写为\n // BrepHandle[] 语义,误用会把数组当 compound 拆(同上红线实证)。\n const colCompound = nativeLinearPattern(shape, directionX, spacingX, countX)\n const cols = raw.getSubShapes(colCompound, 'solid')\n raw.release(colCompound)\n const all: number[] = []\n try {\n for (const c of cols) {\n const rowCompound = nativeLinearPattern(c, directionY, spacingY, countY)\n try {\n all.push(...raw.getSubShapes(rowCompound, 'solid'))\n } finally {\n raw.release(rowCompound)\n }\n }\n } finally {\n for (const c of cols) raw.release(c)\n }\n return raw.fuseAll(all) as BrepHandle\n }\n\n // ═══ Phase 3:能力表 33 个登记方法接线(capability-map 64 方法收口) ═══\n // 原则:能力表声明了(OCCT_METHOD_KINDS 含全部 33)→ 实例必须可实现,否则静态\n // 判定放行后运行时崩(红线)。18 个 occt-wasm 原生导出直接绑定(签名与\n // BrepEngineApi 一致:Vec3=BrepVec3、ShapeHandle=BrepHandle);15 个组合方法\n // (occt-wasm 无原生导出)经 vendored OcctWasmAdapter 组合面代理 + 形态转换。\n // 只接线一次(occtPatternWired 护栏内);重复注册复用覆写结果,不重复捕获。\n const k = primitives as unknown as {\n buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle\n composeTransform(m1: number[], m2: number[]): number[]\n downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle\n healFace(shape: BrepHandle, tolerance?: number): BrepHandle\n healWire(shape: BrepHandle, tolerance?: number): BrepHandle\n isNull(shape: BrepHandle): boolean\n iterShapes(shape: BrepHandle): BrepHandle[]\n makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n makeVertex(x: number, y: number, z: number): BrepHandle\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle\n simplify(shape: BrepHandle): BrepHandle\n split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle\n sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle\n }\n occtApi.buildExtrusionLaw = k.buildExtrusionLaw.bind(primitives)\n occtApi.composeTransform = k.composeTransform.bind(primitives)\n occtApi.downcast = k.downcast.bind(primitives)\n occtApi.healFace = k.healFace.bind(primitives)\n occtApi.healWire = k.healWire.bind(primitives)\n occtApi.isNull = k.isNull.bind(primitives)\n occtApi.iterShapes = k.iterShapes.bind(primitives)\n occtApi.makeEllipsoid = k.makeEllipsoid.bind(primitives)\n occtApi.makeFaceOnSurface = k.makeFaceOnSurface.bind(primitives)\n occtApi.makeTorus = k.makeTorus.bind(primitives)\n occtApi.makeVertex = k.makeVertex.bind(primitives)\n occtApi.mirror = k.mirror.bind(primitives)\n occtApi.sew = k.sew.bind(primitives)\n occtApi.shell = k.shell.bind(primitives)\n occtApi.simplePipe = k.simplePipe.bind(primitives)\n occtApi.simplify = k.simplify.bind(primitives)\n occtApi.split = k.split.bind(primitives)\n occtApi.sweepPipeShell = k.sweepPipeShell.bind(primitives)\n const vendor = OcctWasmAdapter.fromKernel(primitives as never)\n occtApi.boundingBox = (shape) => {\n const b = vendor.boundingBox(shape as never)\n return { xmin: b.min[0], ymin: b.min[1], zmin: b.min[2], xmax: b.max[0], ymax: b.max[1], zmax: b.max[2] }\n }\n occtApi.shapeType = (shape) => vendor.shapeType(shape as never) as BrepSubShapeType\n occtApi.surfaceCenterOfMass = (face) => {\n const v = vendor.surfaceCenterOfMass(face as never)\n return { x: v[0], y: v[1], z: v[2] }\n }\n occtApi.locate = (shape, matrix) => vendor.locate(shape as never, matrix as never) as BrepHandle\n occtApi.copyShape = (shape) => vendor.copyShape(shape as never) as BrepHandle\n occtApi.fixSelfIntersection = (wire) => vendor.fixSelfIntersection(wire as never) as BrepHandle\n occtApi.hullFromPoints = (points, tolerance) => vendor.hullFromPoints(points as never, tolerance) as BrepHandle\n occtApi.loftAdvanced = (wires, options) => vendor.loftAdvanced(wires as never, options as never) as BrepHandle\n occtApi.makeWireFromMixed = (items) => vendor.makeWireFromMixed(items as never) as BrepHandle\n occtApi.revolveVec = (shape, center, direction, angleDeg) =>\n vendor.revolveVec(shape as never, [center.x, center.y, center.z] as never, [direction.x, direction.y, direction.z] as never, angleDeg) as BrepHandle\n occtApi.buildEdgeOnSurface = (curve, surface) => vendor.buildEdgeOnSurface(curve as never, surface as never) as BrepHandle\n occtApi.dispose = (shape) => { if (shape !== undefined) raw.release(shape as number) }\n occtApi.generalTransformNonOrthogonal = (shape, matrix) =>\n vendor.generalTransformNonOrthogonal(shape as never, matrix.slice(0, 9) as never, matrix.slice(9, 12) as never) as BrepHandle\n const toEvolution = (op: {\n shape: number\n evolution: {\n modified: ReadonlyMap<number, readonly number[]>\n generated: ReadonlyMap<number, readonly number[]>\n deleted: ReadonlySet<number>\n }\n }): BrepEvolutionData => {\n const segments = (m: ReadonlyMap<number, readonly number[]>): number[] => {\n const out: number[] = []\n for (const [inHash, outHashes] of m) out.push(inHash, outHashes.length, ...outHashes)\n return out\n }\n return { result: op.shape as BrepHandle, modified: segments(op.evolution.modified), generated: segments(op.evolution.generated), deleted: [...op.evolution.deleted] }\n }\n occtApi.generalTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) =>\n toEvolution(vendor.generalTransformWithHistory(\n shape as never,\n matrix.slice(0, 9) as never,\n matrix.slice(9, 12) as never,\n false,\n inputFaceHashes as never,\n hashUpperBound,\n ) as never)\n occtApi.applyComposedTransformWithHistory = (shape, matrix, inputFaceHashes, hashUpperBound) =>\n toEvolution(vendor.applyComposedTransformWithHistory(\n shape as never,\n matrix as never,\n inputFaceHashes as never,\n hashUpperBound,\n ) as never)\n occtPatternWired = true\n }\n const occtApi = primitives as BrepEngineApi\n registerBrepEngine(OCCT_BREP_ENGINE_ID, async (): Promise<BrepEngine> => ({\n id: OCCT_BREP_ENGINE_ID,\n primitives: occtApi,\n capabilities: {\n // 面演化:逐核函数名单(不是族级布尔——见 BrepEvolutionKind)。\n evolution: OCCT_EVOLUTION_KINDS,\n // 非演化内核方法:逐核如实声明(Phase 1,P2 缺口补齐;op 声明按此静态判定)。\n methods: OCCT_METHOD_KINDS,\n heal: true,\n directEdit: true,\n advSurface: true,\n assembly: true,\n // P7 并入(D4):OCCT 是精确 B-rep 内核——如实声明 brepjs KernelCapabilities 字段。\n exact: true,\n brepExport: true,\n exactMeasurement: true,\n tessellationModel: 'extract-time',\n },\n }))\n // P7-②:同一装配点把移植内核注册表注入到当前 BREP 引擎(Phase 2 P2-5:取代旧的\n // bindOcctKernel() 固定绑定,改为引擎中立的 injectCurrentBrepEngineAsKernel)。\n // 使 L3 调移植 L2 的 op 在宿主装配后立即可用;幂等,重复调用安全。\n await injectCurrentBrepEngineAsKernel()\n}\n\n/**\n * 内置默认 BREP 引擎装配(OCCT):宿主未注册任何引擎时的缺省值。\n *\n * OCCT 是 faijs 的默认 BREP 引擎——低频率、静态的替换:换引擎 = 宿主在\n * 装配期显式注册其它引擎(首个注册者为默认),或改本处默认。宿主无需为\n * 每次使用自行提供引擎;本函数幂等,已注册任何引擎则 no-op。\n */\nexport async function ensureOcctDefaultEngine(): Promise<void> {\n if (hasBrepEngine()) return\n await registerOcctBrepEngine()\n}\n\n// §7.8 编译期守卫:initOcctWasm 的返回类型必须满足 BrepEngineApi。\n// 若未来 occt-kernel 的导出类型不再满足接口(如接口新增方法)→ tsc 报错列出缺失。\ntype _AssertOcctApi = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n"]}
@@ -54,10 +54,89 @@ export interface BrepEngineApi {
54
54
  chamferWithHistory(solid: BrepHandle, edges: BrepHandle[], distance: number, inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
55
55
  translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle;
56
56
  scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle;
57
+ /** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
57
58
  transform(shape: BrepHandle, matrix: number[]): BrepHandle;
59
+ /** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
58
60
  located(shape: BrepHandle, matrix: number[]): BrepHandle;
61
+ /** 3×4 行主序 12 元素矩阵(口径见上方"变换"节注释)。 */
59
62
  generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle;
60
63
  copy(shape: BrepHandle): BrepHandle;
64
+ /** 线性阵列:沿 direction 复制 count 份(含原位置),返回各份副本句柄数组。 */
65
+ linearPattern(shape: BrepHandle, direction: BrepVec3, spacing: number, count: number): BrepHandle[];
66
+ /** 环形阵列:绕 axis 均分 angleStep 每份,返回各份副本句柄数组。 */
67
+ circularPattern(shape: BrepHandle, center: BrepVec3, axis: BrepVec3, angleStep: number, count: number): BrepHandle[];
68
+ /** 二维栅格阵列:沿两方向复制 countX×countY 份,返回 compound 单句柄。 */
69
+ gridPattern(shape: BrepHandle, directionX: BrepVec3, directionY: BrepVec3, spacingX: number, spacingY: number, countX: number, countY: number): BrepHandle;
70
+ /** 轴对齐包围盒。 */
71
+ boundingBox(shape: BrepHandle): BrepBoundingBox;
72
+ /** 形状类型(vertex/edge/wire/face/shell/solid)。 */
73
+ shapeType(shape: BrepHandle): BrepSubShapeType;
74
+ /** 句柄是否为空(无效引用)。 */
75
+ isNull(shape: BrepHandle): boolean;
76
+ /** 遍历子形状句柄(与 getSubShapes 同族,返回句柄数组)。 */
77
+ iterShapes(shape: BrepHandle): BrepHandle[];
78
+ /** 曲面质心。 */
79
+ surfaceCenterOfMass(face: BrepHandle): BrepVec3;
80
+ /** 带位置矩阵放置(3×4 行主序 12 元素,口径见变换族注释)。 */
81
+ locate(shape: BrepHandle, matrix: number[]): BrepHandle;
82
+ /** 复制句柄(独立引用计数)。 */
83
+ copyShape(shape: BrepHandle): BrepHandle;
84
+ /** 类型降级(目标子形状类型;不匹配返回空句柄)。 */
85
+ downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle;
86
+ /** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */
87
+ dispose(shape?: BrepHandle): void;
88
+ /** 组合两个 3×4 行主序变换矩阵(12 元素)。 */
89
+ composeTransform(m1: number[], m2: number[]): number[];
90
+ /** 拉伸律面构造(profile 为曲线描述串)。 */
91
+ buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle;
92
+ /** 曲面上的边构造(curve 为 2D 曲线句柄,宽化 BrepHandle 口径)。 */
93
+ buildEdgeOnSurface(curve: BrepHandle, surface: BrepHandle): BrepHandle;
94
+ /** 面修复(ShapeFix,容忍度可选)。 */
95
+ healFace(shape: BrepHandle, tolerance?: number): BrepHandle;
96
+ /** 线修复(ShapeFix,容忍度可选)。 */
97
+ healWire(shape: BrepHandle, tolerance?: number): BrepHandle;
98
+ /** 线自相交修复。 */
99
+ fixSelfIntersection(wire: BrepHandle): BrepHandle;
100
+ /** 点集凸包(tolerance 为容差)。 */
101
+ hullFromPoints(points: BrepVec3[], tolerance: number): BrepHandle;
102
+ /** 高级放样(options 形态同 vendored loftAdvanced)。 */
103
+ loftAdvanced(wires: BrepHandle[], options?: {
104
+ solid?: boolean;
105
+ ruled?: boolean;
106
+ tolerance?: number;
107
+ }): BrepHandle;
108
+ /** 椭球(三半轴)。 */
109
+ makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle;
110
+ /** 曲面上的面构造(face 为承载面、wire 为边界)。 */
111
+ makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle;
112
+ /** 圆环(主/次半径)。 */
113
+ makeTorus(majorRadius: number, minorRadius: number): BrepHandle;
114
+ /** 顶点构造。 */
115
+ makeVertex(x: number, y: number, z: number): BrepHandle;
116
+ /** 混合线构造(items 为边/顶点混合)。 */
117
+ makeWireFromMixed(items: BrepHandle[]): BrepHandle;
118
+ /** 镜像(过 point、法向 normal 的平面)。 */
119
+ mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle;
120
+ /** 旋转(绕过 center、方向 direction 的轴,angle 为度)。 */
121
+ revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle;
122
+ /** 缝合(tolerance 可选)。 */
123
+ sew(shapes: BrepHandle[], tolerance?: number): BrepHandle;
124
+ /** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */
125
+ shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle;
126
+ /** 简单扫掠(profile 沿 spine 扫出实体)。 */
127
+ simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle;
128
+ /** 简化几何。 */
129
+ simplify(shape: BrepHandle): BrepHandle;
130
+ /** 分割(tools 切割体;返回单个结果句柄,语义同 vendored boolOps.split)。 */
131
+ split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle;
132
+ /** 管壳扫掠(freenet/smooth 可选)。 */
133
+ sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle;
134
+ /** 非正交一般变换(3×4 行主序 12 元素)。 */
135
+ generalTransformNonOrthogonal(shape: BrepHandle, matrix: number[]): BrepHandle;
136
+ /** 一般变换(带面演化;3×4 行主序 12 元素,适配器拆分 linear/translation)。 */
137
+ generalTransformWithHistory(shape: BrepHandle, matrix: number[], inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
138
+ /** 组合变换(带面演化;3×4 行主序 12 元素)。 */
139
+ applyComposedTransformWithHistory(shape: BrepHandle, matrix: number[], inputFaceHashes: number[], hashUpperBound: number): BrepEvolutionData;
61
140
  makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle;
62
141
  makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle;
63
142
  makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle;
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,eAAe,EACf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eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,mDAAmD;IACnD,gBAAgB,CACd,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,EAAE,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,gBAAgB;IAChB,iBAAiB,CACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,yBAAyB;IACzB,kBAAkB,CAChB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IAGpB,kBAAkB,IAAI,gBAAgB,CAAA;IACtC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACvD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,4BAA4B,CAAC,IAAI,SAAS,aAAa,IAAI,IAAI,CAAA"}
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,MAAM,WAAW,aAAa;IAE5B,+BAA+B;IAC/B,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAA;IAGhC,OAAO,CAAC,EAA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U,EACjB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,mDAAmD;IACnD,gBAAgB,CACd,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,EAAE,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,gBAAgB;IAChB,iBAAiB,CACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IACpB,yBAAyB;IACzB,kBAAkB,CAChB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EAAE,EACzB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAAA;IAGpB,kBAAkB,IAAI,gBAAgB,CAAA;IACtC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACvD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,4BAA4B,CAAC,IAAI,SAAS,aAAa,IAAI,IAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面)\n *\n *\n * ⚠️ Phase 0 落地形态:覆盖 §2.3 实测的 66 个被调方法(BrepHandle 中立签名),\n * 供类型解耦使用。Phase 1 按 §7.4 扩到 83 项分 14 族,并落地编译期完整性守卫\n * (_AssertSatisfiesBrepEngineApi,抄 brepjs §3.2)。\n * 复杂返回类型(XCAF 文档 / NURBS 曲线数据等)在 Phase 0 用 unknown 占位,Phase 1 钉死。\n *\n * 命名沿用 occt-wasm 现状——最小迁移成本 + 可演进(§7.4 的取舍)。\n */\n\nimport type {\n BrepBoundingBox,\n BrepCurveParameters,\n BrepEdgeData,\n BrepEvolutionData,\n BrepHandle,\n BrepMeshResult,\n BrepSubShapeType,\n BrepTessellateOptions,\n BrepUvBounds,\n BrepVec3,\n BrepXcafDocument,\n} from './types'\n\n/**\n * BREP 引擎原语契约。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/remus 适配器)负责内部句柄形态与 BrepHandle 的转换。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n\n // ── 实体图元 ──\n makeBox(dx: number, dy: number, dz: number): BrepHandle\n makeBoxFromCorners(corner1: BrepVec3, corner2: BrepVec3): BrepHandle\n makeCylinder(radius: number, height: number): BrepHandle\n makeSphere(radius: number): BrepHandle\n makeCone(r1: number, r2: number, height: number): BrepHandle\n makeRectangle(width: number, height: number): BrepHandle\n\n // ── 造型运算 ──\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n loft(wires: BrepHandle[], isSolid: boolean, ruled: boolean): BrepHandle\n\n // ── 布尔与分割 ──\n fuse(a: BrepHandle, b: BrepHandle): BrepHandle\n cut(a: BrepHandle, b: BrepHandle): BrepHandle\n common(a: BrepHandle, b: BrepHandle): BrepHandle\n intersect(a: BrepHandle, b: BrepHandle): BrepHandle\n section(a: BrepHandle, b: BrepHandle): BrepHandle\n fuseAll(shapes: BrepHandle[]): BrepHandle\n\n // ── 倒角与圆角(directEdit 能力)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleRad, E, F)`。\n * ⚠️ F 由内核自选(外层 TopExp_Explorer 第一个含该边的面),调用方不可指定。\n */\n chamferDistAngle(\n solid: BrepHandle, edges: BrepHandle[], distance: number, angleDeg: number,\n ): BrepHandle\n /** 等半径圆角:`BRepFilletAPI_MakeFillet::Add(radius, E)`。 */\n fillet(solid: BrepHandle, edges: BrepHandle[], radius: number): BrepHandle\n /** 变半径圆角:单边 `BRepFilletAPI_MakeFillet::Add(startRadius, endRadius, E)`。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /**\n * 等距倒角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n chamferWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n distance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 变换 ──\n translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle\n transform(shape: BrepHandle, matrix: number[]): BrepHandle\n located(shape: BrepHandle, matrix: number[]): BrepHandle\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n\n // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n\n // ── 三角化(BREP→mesh 唯一出口,断链物化依赖,硬必需) ──\n meshShape(shape: BrepHandle, options?: BrepTessellateOptions): BrepMeshResult\n wireframe(shape: BrepHandle, deflection?: number): BrepEdgeData\n\n // ── 拓扑查询 ──\n getSubShapes(shape: BrepHandle, type: BrepSubShapeType): BrepHandle[]\n /** 批量查询(§2.3:生产路径零调用,仅测试使用;Phase 1 钉死返回形态)。 */\n queryBatch(shapes: BrepHandle[]): Array<{ area: number }>\n subShapeHashes(shape: BrepHandle, type: BrepSubShapeType, hashUpperBound: number): number[]\n hashCode(shape: BrepHandle, upperBound: number): number\n isSame(a: BrepHandle, b: BrepHandle): boolean\n isSolid(shape: BrepHandle): boolean\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n\n // ── 几何求值 ──\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n curveType(edge: BrepHandle): string\n curvePointAtParam(edge: BrepHandle, param: number): BrepVec3\n curveTangent(edge: BrepHandle, param: number): BrepVec3\n curveParameters(edge: BrepHandle): BrepCurveParameters\n curveIsClosed(edge: BrepHandle): boolean\n curveLength(edge: BrepHandle): number\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n surfaceType(face: BrepHandle): string\n surfaceNormal(face: BrepHandle, u: number, v: number): BrepVec3\n pointOnSurface(face: BrepHandle, u: number, v: number): BrepVec3\n uvBounds(face: BrepHandle): BrepUvBounds\n getSurfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** Phase 1 钉死返回形态(topologyExt 仅读 radius)。 */\n getFaceCylinderData(face: BrepHandle): { radius: number } | null\n /** Phase 1 钉死返回形态(topologyExt 读 degree/periodic/rational)。 */\n getNurbsCurveData(edge: BrepHandle): { degree: number; periodic: boolean; rational: boolean } | null\n\n // ── 测量 ──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n\n // ── 校验与修复 ──\n isValid(shape: BrepHandle): boolean\n unifySameDomain(shape: BrepHandle): BrepHandle\n healSolid(shape: BrepHandle, tolerance?: number): BrepHandle\n fixShape(shape: BrepHandle): BrepHandle\n fixFaceOrientations(shape: BrepHandle): BrepHandle\n removeDegenerateEdges(shape: BrepHandle): BrepHandle\n\n // ── IO ──\n importStep(data: string | ArrayBuffer): BrepHandle\n exportStep(shape: BrepHandle): string\n importStl(data: string | ArrayBuffer): BrepHandle\n fromBREP(data: string): BrepHandle\n\n // ── 面演化(可选能力槽 §7.5 EvolutionCapability) ──\n cutWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n fuseWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n intersectWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 面演化 · Phase 0.1 补齐的 7 个(occt-wasm 运行时本就存在) ──\n //\n // ⚠️ 为什么此前只有 5 个:faijs 只绑了 boolean 与 fillet/chamfer,那 7 个在\n // `occt-wasm@3.8.4` 的运行时**一直都在**(dist/index.d.ts:458-472 共 12 个),\n // 只是 faijs 类型层未声明、也无人调用。补齐**不动 WASM**。\n //\n // ⚠️ 注意:`initOcctWasm()` 的返回类型在本文件之外已被硬断言为 BrepEngineApi\n // (occtKernel.ts:88/95/106/112 `as unknown as`)⇒ 下方 `_AssertOcctApi`\n // 恒真、**无校验力**。声明 ≠ 运行时存在:存在性由\n // `packages/core/src/brep/engine/evolution-bindings.test.ts` 的冒烟测试钉住。\n\n /** 平移 + 面演化(权威 hash→hash 映射,替代序号对齐近似)。 */\n translateWithHistory(\n shape: BrepHandle,\n dx: number,\n dy: number,\n dz: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 绕任意轴旋转 + 面演化。`axis = {point, direction}`,`angleRad` 为**弧度**。 */\n rotateWithHistory(\n shape: BrepHandle,\n axis: { point: BrepVec3; direction: BrepVec3 },\n angleRad: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 镜像 + 面演化。`point` 为镜像面上一点,`normal` 为镜像面法向。 */\n mirrorWithHistory(\n shape: BrepHandle,\n point: BrepVec3,\n normal: BrepVec3,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 缩放 + 面演化。⚠️ 仅**均匀**缩放(`factor: number`);非均匀走 `generalTransform`(无历史)。 */\n scaleWithHistory(\n shape: BrepHandle,\n center: BrepVec3,\n factor: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 抽壳 + 面演化。`faces` 为被移除的面(开口),`thickness` 为壁厚。 */\n shellWithHistory(\n solid: BrepHandle,\n faces: BrepHandle[],\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 偏移 + 面演化。 */\n offsetWithHistory(\n solid: BrepHandle,\n distance: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 加厚(面/壳 → 实体)+ 面演化。 */\n thickenWithHistory(\n shape: BrepHandle,\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── XCAF 装配(可选能力槽 §7.5 AssemblyCapability,Phase 1 钉死完整形态) ──\n createXCAFDocument(): BrepXcafDocument\n importXCAFFromSTEP(stepData: string): BrepXcafDocument\n}\n\n/**\n * 编译期完整性守卫(§7.8,抄 brepjs §3.2 的 _AssertSatisfiesKernelShape)。\n *\n * 用法(适配器里):\n * ```ts\n * type _AssertOcct = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n * ```\n * 若实现类型缺少接口中的任何方法(或签名不兼容)→ tsc 报错并列出缺失属性。\n * 引擎换用 / 接口演进(Phase 1 扩到 83 项)时,失配在编译期暴露,而非运行时黑盒。\n */\nexport type AssertSatisfiesBrepEngineApi<Impl extends BrepEngineApi> = Impl\n"]}
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/brep/engine/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * engine/primitives — BREP 引擎契约面(port 面)\n *\n *\n * ⚠️ Phase 0 落地形态:覆盖 §2.3 实测的 66 个被调方法(BrepHandle 中立签名),\n * 供类型解耦使用。Phase 1 按 §7.4 扩到 83 项分 14 族,并落地编译期完整性守卫\n * (_AssertSatisfiesBrepEngineApi,抄 brepjs §3.2)。\n * 复杂返回类型(XCAF 文档 / NURBS 曲线数据等)在 Phase 0 用 unknown 占位,Phase 1 钉死。\n *\n * 命名沿用 occt-wasm 现状——最小迁移成本 + 可演进(§7.4 的取舍)。\n */\n\nimport type {\n BrepBoundingBox,\n BrepCurveParameters,\n BrepEdgeData,\n BrepEvolutionData,\n BrepHandle,\n BrepMeshResult,\n BrepSubShapeType,\n BrepTessellateOptions,\n BrepUvBounds,\n BrepVec3,\n BrepXcafDocument,\n} from './types'\n\n/**\n * BREP 引擎原语契约。所有句柄参数/返回值均为 BrepHandle(不透明值,§6.3)。\n * 引擎实现(occt/remus 适配器)负责内部句柄形态与 BrepHandle 的转换。\n */\nexport interface BrepEngineApi {\n // ── 生命周期 ──\n /** 手工释放句柄(GC 型引擎实现为 no-op)。 */\n release(shape: BrepHandle): void\n\n // ── 实体图元 ──\n makeBox(dx: number, dy: number, dz: number): BrepHandle\n makeBoxFromCorners(corner1: BrepVec3, corner2: BrepVec3): BrepHandle\n makeCylinder(radius: number, height: number): BrepHandle\n makeSphere(radius: number): BrepHandle\n makeCone(r1: number, r2: number, height: number): BrepHandle\n makeRectangle(width: number, height: number): BrepHandle\n\n // ── 造型运算 ──\n extrude(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n loft(wires: BrepHandle[], isSolid: boolean, ruled: boolean): BrepHandle\n\n // ── 布尔与分割 ──\n fuse(a: BrepHandle, b: BrepHandle): BrepHandle\n cut(a: BrepHandle, b: BrepHandle): BrepHandle\n common(a: BrepHandle, b: BrepHandle): BrepHandle\n intersect(a: BrepHandle, b: BrepHandle): BrepHandle\n section(a: BrepHandle, b: BrepHandle): BrepHandle\n fuseAll(shapes: BrepHandle[]): BrepHandle\n\n // ── 倒角与圆角(directEdit 能力)──\n /** 等距倒角:逐边 `BRepFilletAPI_MakeChamfer::Add(distance, E)`。 */\n chamfer(solid: BrepHandle, edges: BrepHandle[], distance: number): BrepHandle\n /**\n * 距角倒角:`AddDA(distance, angleRad, E, F)`。\n * ⚠️ F 由内核自选(外层 TopExp_Explorer 第一个含该边的面),调用方不可指定。\n */\n chamferDistAngle(\n solid: BrepHandle, edges: BrepHandle[], distance: number, angleDeg: number,\n ): BrepHandle\n /** 等半径圆角:`BRepFilletAPI_MakeFillet::Add(radius, E)`。 */\n fillet(solid: BrepHandle, edges: BrepHandle[], radius: number): BrepHandle\n /** 变半径圆角:单边 `BRepFilletAPI_MakeFillet::Add(startRadius, endRadius, E)`。 */\n filletVariable(solid: BrepHandle, edge: BrepHandle, startRadius: number, endRadius: number): BrepHandle\n /**\n * 等半径圆角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n filletWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n radius: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /**\n * 等距倒角(WithHistory):返回面演化数据,供 roleTable 传播。\n * modified/generated/deleted 用面 hash 编码(§7.5)。\n */\n chamferWithHistory(\n solid: BrepHandle,\n edges: BrepHandle[],\n distance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 变换 ──\n // 矩阵口径(唯一权威):matrix 参数是 **3×4 行主序、12 个 double**——\n // [r00,r01,r02,tx, r10,r11,r12,ty, r20,r21,r22,tz],与 brep/brep-ops.ts 的\n // matrixToArray()(THREE.Matrix4 column-major → 行主序 3×4)产出同构。\n // 各引擎方言不同(如 brepkit transformSolid 吃 4×4 行主序 16 元素)时,\n // 由该引擎适配层内部转换(见 brepkit-kernel/brepkitKernel.ts 的 toKernelMatrix\n // 唯一转换点),禁止要求调用方适配引擎方言。\n translate(shape: BrepHandle, dx: number, dy: number, dz: number): BrepHandle\n scale(shape: BrepHandle, center: BrepVec3, factor: number): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n transform(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n located(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 3×4 行主序 12 元素矩阵(口径见上方\"变换\"节注释)。 */\n generalTransform(shape: BrepHandle, matrix: number[]): BrepHandle\n copy(shape: BrepHandle): BrepHandle\n\n // ── 阵列(Phase 2:pattern 族;occt-wasm 原生 + brepkit wasm 已导出) ──\n // 口径(vendored brepjs 内核调用面,docs/plans/2026-09-23-brep-engine-switchability-rework.md §Phase 2):\n // - 两内核的 pattern 内核函数都返回 compound(含全部副本),适配器负责拆成数组;\n // - 不声明 rectangularPattern:vendored rectangularPattern 是纯 JS 组合\n // (compoundOpsFns.ts,translate + fuseAll),不调内核方法(capability-map 实证);\n // - 不声明裸 mirror/rotate:vendored transformFns 全部走 `*WithHistory` 内核\n // (transformFns.ts:29-99 实证),基础方法仅 2D sketcher 面使用(走 KernelAdapter)。\n /** 线性阵列:沿 direction 复制 count 份(含原位置),返回各份副本句柄数组。 */\n linearPattern(shape: BrepHandle, direction: BrepVec3, spacing: number, count: number): BrepHandle[]\n /** 环形阵列:绕 axis 均分 angleStep 每份,返回各份副本句柄数组。 */\n circularPattern(\n shape: BrepHandle,\n center: BrepVec3,\n axis: BrepVec3,\n angleStep: number,\n count: number,\n ): BrepHandle[]\n /** 二维栅格阵列:沿两方向复制 countX×countY 份,返回 compound 单句柄。 */\n gridPattern(\n shape: BrepHandle,\n directionX: BrepVec3,\n directionY: BrepVec3,\n spacingX: number,\n spacingY: number,\n countX: number,\n countY: number,\n ): BrepHandle\n\n // ── 查询与测量(Phase 3:capability-map 64 方法登记补全——occt-wasm 原生或\n // vendored 适配器组合面;brepkit 无实现的能力保持不声明,静态判定拦截) ──\n /** 轴对齐包围盒。 */\n boundingBox(shape: BrepHandle): BrepBoundingBox\n /** 形状类型(vertex/edge/wire/face/shell/solid)。 */\n shapeType(shape: BrepHandle): BrepSubShapeType\n /** 句柄是否为空(无效引用)。 */\n isNull(shape: BrepHandle): boolean\n /** 遍历子形状句柄(与 getSubShapes 同族,返回句柄数组)。 */\n iterShapes(shape: BrepHandle): BrepHandle[]\n /** 曲面质心。 */\n surfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** 带位置矩阵放置(3×4 行主序 12 元素,口径见变换族注释)。 */\n locate(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 复制句柄(独立引用计数)。 */\n copyShape(shape: BrepHandle): BrepHandle\n /** 类型降级(目标子形状类型;不匹配返回空句柄)。 */\n downcast(shape: BrepHandle, targetType: BrepSubShapeType): BrepHandle\n /** 释放内核/句柄(引擎级释放语义;brepkit GC 型 no-op)。 */\n dispose(shape?: BrepHandle): void\n /** 组合两个 3×4 行主序变换矩阵(12 元素)。 */\n composeTransform(m1: number[], m2: number[]): number[]\n\n // ── 构形与修复(Phase 3 登记;brepkit 未实现 → 能力表不声明) ──\n /** 拉伸律面构造(profile 为曲线描述串)。 */\n buildExtrusionLaw(profile: string, length: number, endFactor: number): BrepHandle\n /** 曲面上的边构造(curve 为 2D 曲线句柄,宽化 BrepHandle 口径)。 */\n buildEdgeOnSurface(curve: BrepHandle, surface: BrepHandle): BrepHandle\n /** 面修复(ShapeFix,容忍度可选)。 */\n healFace(shape: BrepHandle, tolerance?: number): BrepHandle\n /** 线修复(ShapeFix,容忍度可选)。 */\n healWire(shape: BrepHandle, tolerance?: number): BrepHandle\n /** 线自相交修复。 */\n fixSelfIntersection(wire: BrepHandle): BrepHandle\n /** 点集凸包(tolerance 为容差)。 */\n hullFromPoints(points: BrepVec3[], tolerance: number): BrepHandle\n /** 高级放样(options 形态同 vendored loftAdvanced)。 */\n loftAdvanced(wires: BrepHandle[], options?: { solid?: boolean; ruled?: boolean; tolerance?: number }): BrepHandle\n /** 椭球(三半轴)。 */\n makeEllipsoid(rx: number, ry: number, rz: number): BrepHandle\n /** 曲面上的面构造(face 为承载面、wire 为边界)。 */\n makeFaceOnSurface(face: BrepHandle, wire: BrepHandle): BrepHandle\n /** 圆环(主/次半径)。 */\n makeTorus(majorRadius: number, minorRadius: number): BrepHandle\n /** 顶点构造。 */\n makeVertex(x: number, y: number, z: number): BrepHandle\n /** 混合线构造(items 为边/顶点混合)。 */\n makeWireFromMixed(items: BrepHandle[]): BrepHandle\n /** 镜像(过 point、法向 normal 的平面)。 */\n mirror(shape: BrepHandle, point: BrepVec3, normal: BrepVec3): BrepHandle\n /** 旋转(绕过 center、方向 direction 的轴,angle 为度)。 */\n revolveVec(shape: BrepHandle, center: BrepVec3, direction: BrepVec3, angleDeg: number): BrepHandle\n /** 缝合(tolerance 可选)。 */\n sew(shapes: BrepHandle[], tolerance?: number): BrepHandle\n /** 抽壳(facesToRemove 移除面、thickness 壁厚、tolerance 容差)。 */\n shell(solid: BrepHandle, facesToRemove: BrepHandle[], thickness: number, tolerance: number): BrepHandle\n /** 简单扫掠(profile 沿 spine 扫出实体)。 */\n simplePipe(profile: BrepHandle, spine: BrepHandle): BrepHandle\n /** 简化几何。 */\n simplify(shape: BrepHandle): BrepHandle\n /** 分割(tools 切割体;返回单个结果句柄,语义同 vendored boolOps.split)。 */\n split(shape: BrepHandle, tools: BrepHandle[]): BrepHandle\n /** 管壳扫掠(freenet/smooth 可选)。 */\n sweepPipeShell(profile: BrepHandle, spine: BrepHandle, freenet?: boolean, smooth?: boolean): BrepHandle\n /** 非正交一般变换(3×4 行主序 12 元素)。 */\n generalTransformNonOrthogonal(shape: BrepHandle, matrix: number[]): BrepHandle\n /** 一般变换(带面演化;3×4 行主序 12 元素,适配器拆分 linear/translation)。 */\n generalTransformWithHistory(\n shape: BrepHandle,\n matrix: number[],\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 组合变换(带面演化;3×4 行主序 12 元素)。 */\n applyComposedTransformWithHistory(\n shape: BrepHandle,\n matrix: number[],\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n\n // ── 曲线构造 ──\n makeLineEdge(start: BrepVec3, end: BrepVec3): BrepHandle\n makeArcEdge(start: BrepVec3, mid: BrepVec3, end: BrepVec3): BrepHandle\n makeBezierEdge(controlPoints: BrepVec3[]): BrepHandle\n\n // ── 拓扑构造 ──\n makeWire(edges: BrepHandle[]): BrepHandle\n makeFace(wire: BrepHandle): BrepHandle\n makeCompound(shapes: BrepHandle[]): BrepHandle\n sewAndSolidify(faces: BrepHandle[], tolerance?: number): BrepHandle\n buildTriFace(a: BrepVec3, b: BrepVec3, c: BrepVec3): BrepHandle\n addHolesInFace(face: BrepHandle, holeWires: BrepHandle[]): BrepHandle\n\n // ── 三角化(BREP→mesh 唯一出口,断链物化依赖,硬必需) ──\n meshShape(shape: BrepHandle, options?: BrepTessellateOptions): BrepMeshResult\n wireframe(shape: BrepHandle, deflection?: number): BrepEdgeData\n\n // ── 拓扑查询 ──\n getSubShapes(shape: BrepHandle, type: BrepSubShapeType): BrepHandle[]\n /** 批量查询(§2.3:生产路径零调用,仅测试使用;Phase 1 钉死返回形态)。 */\n queryBatch(shapes: BrepHandle[]): Array<{ area: number }>\n subShapeHashes(shape: BrepHandle, type: BrepSubShapeType, hashUpperBound: number): number[]\n hashCode(shape: BrepHandle, upperBound: number): number\n isSame(a: BrepHandle, b: BrepHandle): boolean\n isSolid(shape: BrepHandle): boolean\n /** 方向标识(与内核 ShapeOrientation 同构:'forward'|'reversed'|'internal'|'external')。 */\n shapeOrientation(shape: BrepHandle): string\n\n // ── 几何求值 ──\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n curveType(edge: BrepHandle): string\n curvePointAtParam(edge: BrepHandle, param: number): BrepVec3\n curveTangent(edge: BrepHandle, param: number): BrepVec3\n curveParameters(edge: BrepHandle): BrepCurveParameters\n curveIsClosed(edge: BrepHandle): boolean\n curveLength(edge: BrepHandle): number\n /** 曲面类型标识(与内核 SurfaceKind 同构的中立字符串形态)。 */\n surfaceType(face: BrepHandle): string\n surfaceNormal(face: BrepHandle, u: number, v: number): BrepVec3\n pointOnSurface(face: BrepHandle, u: number, v: number): BrepVec3\n uvBounds(face: BrepHandle): BrepUvBounds\n getSurfaceCenterOfMass(face: BrepHandle): BrepVec3\n /** Phase 1 钉死返回形态(topologyExt 仅读 radius)。 */\n getFaceCylinderData(face: BrepHandle): { radius: number } | null\n /** Phase 1 钉死返回形态(topologyExt 读 degree/periodic/rational)。 */\n getNurbsCurveData(edge: BrepHandle): { degree: number; periodic: boolean; rational: boolean } | null\n\n // ── 测量 ──\n getBoundingBox(shape: BrepHandle, useTriangulation?: boolean): BrepBoundingBox\n getVolume(shape: BrepHandle): number\n getCenterOfMass(shape: BrepHandle): BrepVec3\n\n // ── 校验与修复 ──\n isValid(shape: BrepHandle): boolean\n unifySameDomain(shape: BrepHandle): BrepHandle\n healSolid(shape: BrepHandle, tolerance?: number): BrepHandle\n fixShape(shape: BrepHandle): BrepHandle\n fixFaceOrientations(shape: BrepHandle): BrepHandle\n removeDegenerateEdges(shape: BrepHandle): BrepHandle\n\n // ── IO ──\n importStep(data: string | ArrayBuffer): BrepHandle\n exportStep(shape: BrepHandle): string\n importStl(data: string | ArrayBuffer): BrepHandle\n fromBREP(data: string): BrepHandle\n\n // ── 面演化(可选能力槽 §7.5 EvolutionCapability) ──\n cutWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n fuseWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n intersectWithHistory(\n a: BrepHandle,\n b: BrepHandle,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── 面演化 · Phase 0.1 补齐的 7 个(occt-wasm 运行时本就存在) ──\n //\n // ⚠️ 为什么此前只有 5 个:faijs 只绑了 boolean 与 fillet/chamfer,那 7 个在\n // `occt-wasm@3.8.4` 的运行时**一直都在**(dist/index.d.ts:458-472 共 12 个),\n // 只是 faijs 类型层未声明、也无人调用。补齐**不动 WASM**。\n //\n // ⚠️ 注意:`initOcctWasm()` 的返回类型在本文件之外已被硬断言为 BrepEngineApi\n // (occtKernel.ts:88/95/106/112 `as unknown as`)⇒ 下方 `_AssertOcctApi`\n // 恒真、**无校验力**。声明 ≠ 运行时存在:存在性由\n // `packages/core/src/brep/engine/evolution-bindings.test.ts` 的冒烟测试钉住。\n\n /** 平移 + 面演化(权威 hash→hash 映射,替代序号对齐近似)。 */\n translateWithHistory(\n shape: BrepHandle,\n dx: number,\n dy: number,\n dz: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 绕任意轴旋转 + 面演化。`axis = {point, direction}`,`angleRad` 为**弧度**。 */\n rotateWithHistory(\n shape: BrepHandle,\n axis: { point: BrepVec3; direction: BrepVec3 },\n angleRad: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 镜像 + 面演化。`point` 为镜像面上一点,`normal` 为镜像面法向。 */\n mirrorWithHistory(\n shape: BrepHandle,\n point: BrepVec3,\n normal: BrepVec3,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 缩放 + 面演化。⚠️ 仅**均匀**缩放(`factor: number`);非均匀走 `generalTransform`(无历史)。 */\n scaleWithHistory(\n shape: BrepHandle,\n center: BrepVec3,\n factor: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 抽壳 + 面演化。`faces` 为被移除的面(开口),`thickness` 为壁厚。 */\n shellWithHistory(\n solid: BrepHandle,\n faces: BrepHandle[],\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 偏移 + 面演化。 */\n offsetWithHistory(\n solid: BrepHandle,\n distance: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n /** 加厚(面/壳 → 实体)+ 面演化。 */\n thickenWithHistory(\n shape: BrepHandle,\n thickness: number,\n tolerance: number,\n inputFaceHashes: number[],\n hashUpperBound: number,\n ): BrepEvolutionData\n\n // ── XCAF 装配(可选能力槽 §7.5 AssemblyCapability,Phase 1 钉死完整形态) ──\n createXCAFDocument(): BrepXcafDocument\n importXCAFFromSTEP(stepData: string): BrepXcafDocument\n}\n\n/**\n * 编译期完整性守卫(§7.8,抄 brepjs §3.2 的 _AssertSatisfiesKernelShape)。\n *\n * 用法(适配器里):\n * ```ts\n * type _AssertOcct = AssertSatisfiesBrepEngineApi<Awaited<ReturnType<typeof initOcctWasm>>>\n * ```\n * 若实现类型缺少接口中的任何方法(或签名不兼容)→ tsc 报错并列出缺失属性。\n * 引擎换用 / 接口演进(Phase 1 扩到 83 项)时,失配在编译期暴露,而非运行时黑盒。\n */\nexport type AssertSatisfiesBrepEngineApi<Impl extends BrepEngineApi> = Impl\n"]}
@@ -156,7 +156,19 @@ export type BrepTessellationModel = 'build-time' | 'extract-time' | 'none';
156
156
  * ⇒ 引擎声明"我提供哪几个"(`BrepCapabilities.evolution`),op 声明"我要哪一个"
157
157
  * (`defineOp.capabilities`),两者**按名字求交集**(`cad-runtime/backend-dispatch.ts`)。
158
158
  */
159
- export type BrepEvolutionKind = 'fuse' | 'cut' | 'intersect' | 'fillet' | 'chamfer' | 'translate' | 'rotate' | 'mirror' | 'scale' | 'shell' | 'offset' | 'thicken';
159
+ export type BrepEvolutionKind = 'fuseWithHistory' | 'cutWithHistory' | 'intersectWithHistory' | 'filletWithHistory' | 'chamferWithHistory' | 'translateWithHistory' | 'rotateWithHistory' | 'mirrorWithHistory' | 'scaleWithHistory' | 'shellWithHistory' | 'offsetWithHistory' | 'thickenWithHistory';
160
+ /**
161
+ * 非演化内核方法真名(`*WithHistory` 之外的 `BrepEngineApi` 方法)。
162
+ *
163
+ * 与 `BrepEvolutionKind` 分名(P3 冲突消除):`'mirror'` 一个字符串不能同时表示
164
+ * "提供 `mirrorWithHistory`"与"提供 `mirror`",两族必须互不共用字符串。
165
+ * 语义与 evolution 相同——**逐核函数**声明:声明 = 实现(诚实原则),
166
+ * 缺省/空 = 一个都不提供。
167
+ *
168
+ * 初始全集 = Phase 0 能力映射表(`api/surface/capability-map.json`)盘点的
169
+ * compat op 依赖内核方法 + 方案初始项;Phase 3 全量收敛时按映射表滚动补全。
170
+ */
171
+ export type BrepMethodKind = 'linearPattern' | 'circularPattern' | 'gridPattern' | 'rectangularPattern' | 'mirror' | 'rotate' | 'translate' | 'scale' | 'chamfer' | 'chamferDistAngle' | 'fillet' | 'filletVariable' | 'makeRectangle' | 'shell' | 'extrude' | 'loft' | 'loftAdvanced' | 'section' | 'sweepPipeShell' | 'simplePipe' | 'revolveVec' | 'buildExtrusionLaw' | 'fuse' | 'cut' | 'intersect' | 'fuseAll' | 'makeArcEdge' | 'makeBezierEdge' | 'makeCylinder' | 'makeEllipsoid' | 'makeFace' | 'makeFaceOnSurface' | 'makeLineEdge' | 'makeTorus' | 'makeVertex' | 'makeWireFromMixed' | 'buildEdgeOnSurface' | 'addHolesInFace' | 'buildTriFace' | 'sew' | 'sewAndSolidify' | 'healFace' | 'healSolid' | 'healWire' | 'fixShape' | 'fixSelfIntersection' | 'isValid' | 'removeDegenerateEdges' | 'simplify' | 'split' | 'boundingBox' | 'curveParameters' | 'curvePointAtParam' | 'curveTangent' | 'hullFromPoints' | 'isNull' | 'iterShapes' | 'locate' | 'shapeType' | 'surfaceCenterOfMass' | 'surfaceNormal' | 'surfaceType' | 'uvBounds' | 'composeTransform' | 'applyComposedTransformWithHistory' | 'generalTransformNonOrthogonal' | 'generalTransformWithHistory' | 'importStl' | 'createXCAFDocument' | 'importXCAFFromSTEP' | 'copyShape' | 'dispose' | 'downcast' | 'hashCode';
160
172
  /**
161
173
  * 可选能力槽声明(§7.5,Phase 1 钉死成员)。
162
174
  *
@@ -177,6 +189,11 @@ export interface BrepCapabilities {
177
189
  * `BrepEvolutionKind`)。空数组 / 缺省 = 一个都不提供。
178
190
  */
179
191
  evolution?: readonly BrepEvolutionKind[];
192
+ /**
193
+ * 非演化内核方法族:本引擎**实际提供**的 `BrepEngineApi` 方法真名
194
+ * (逐核声明,与 `evolution` 同语义;空数组 / 缺省 = 一个都不提供)。
195
+ */
196
+ methods?: readonly BrepMethodKind[];
180
197
  /** 修复族(healSolid/fixShape/fixFaceOrientations/...) */
181
198
  heal?: boolean;
182
199
  /** 直接编辑族(C1:moveFace/replaceFace/...) */