@faicad/faijs 0.19.0 → 0.29.3

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 (510) hide show
  1. package/LICENSE +202 -28
  2. package/dist/api/api-namespace.d.ts +5 -5
  3. package/dist/api/api-namespace.d.ts.map +1 -1
  4. package/dist/api/api-namespace.js +4 -4
  5. package/dist/api/api-namespace.js.map +1 -1
  6. package/dist/api/assert.d.ts +2 -2
  7. package/dist/api/assert.js +8 -8
  8. package/dist/api/assert.js.map +1 -1
  9. package/dist/api/asset.d.ts +1 -1
  10. package/dist/api/asset.js +2 -2
  11. package/dist/api/asset.js.map +1 -1
  12. package/dist/api/boolean.d.ts +1 -1
  13. package/dist/api/boolean.d.ts.map +1 -1
  14. package/dist/api/boolean.js +128 -16
  15. package/dist/api/boolean.js.map +1 -1
  16. package/dist/api/brep-mirror/joinery-brep.d.ts.map +1 -1
  17. package/dist/api/brep-mirror/joinery-brep.js +3 -1
  18. package/dist/api/brep-mirror/joinery-brep.js.map +1 -1
  19. package/dist/api/cadquery-selectors/borrow-bridge.d.ts +14 -0
  20. package/dist/api/cadquery-selectors/borrow-bridge.d.ts.map +1 -0
  21. package/dist/api/cadquery-selectors/borrow-bridge.js +52 -0
  22. package/dist/api/cadquery-selectors/borrow-bridge.js.map +1 -0
  23. package/dist/api/cadquery-selectors/edge.d.ts +40 -0
  24. package/dist/api/cadquery-selectors/edge.d.ts.map +1 -0
  25. package/dist/api/cadquery-selectors/edge.js +70 -0
  26. package/dist/api/cadquery-selectors/edge.js.map +1 -0
  27. package/dist/api/cadquery-selectors/entity.d.ts +121 -0
  28. package/dist/api/cadquery-selectors/entity.d.ts.map +1 -0
  29. package/dist/api/cadquery-selectors/entity.js +167 -0
  30. package/dist/api/cadquery-selectors/entity.js.map +1 -0
  31. package/dist/api/cadquery-selectors/face.d.ts +33 -0
  32. package/dist/api/cadquery-selectors/face.d.ts.map +1 -0
  33. package/dist/api/cadquery-selectors/face.js +353 -0
  34. package/dist/api/cadquery-selectors/face.js.map +1 -0
  35. package/dist/api/cadquery-selectors/grammar.d.ts +50 -0
  36. package/dist/api/cadquery-selectors/grammar.d.ts.map +1 -0
  37. package/dist/api/cadquery-selectors/grammar.js +345 -0
  38. package/dist/api/cadquery-selectors/grammar.js.map +1 -0
  39. package/dist/api/cadquery-selectors/index.d.ts +18 -0
  40. package/dist/api/cadquery-selectors/index.d.ts.map +1 -0
  41. package/dist/api/cadquery-selectors/index.js +17 -0
  42. package/dist/api/cadquery-selectors/index.js.map +1 -0
  43. package/dist/api/cadquery-selectors/predicates.d.ts +76 -0
  44. package/dist/api/cadquery-selectors/predicates.d.ts.map +1 -0
  45. package/dist/api/cadquery-selectors/predicates.js +85 -0
  46. package/dist/api/cadquery-selectors/predicates.js.map +1 -0
  47. package/dist/api/cadquery-selectors/resolve.d.ts +41 -0
  48. package/dist/api/cadquery-selectors/resolve.d.ts.map +1 -0
  49. package/dist/api/cadquery-selectors/resolve.js +243 -0
  50. package/dist/api/cadquery-selectors/resolve.js.map +1 -0
  51. package/dist/api/cadquery-selectors/types.d.ts +96 -0
  52. package/dist/api/cadquery-selectors/types.d.ts.map +1 -0
  53. package/dist/api/cadquery-selectors/types.js +11 -0
  54. package/dist/api/cadquery-selectors/types.js.map +1 -0
  55. package/dist/api/chamfer.d.ts +13 -5
  56. package/dist/api/chamfer.d.ts.map +1 -1
  57. package/dist/api/chamfer.js +63 -7
  58. package/dist/api/chamfer.js.map +1 -1
  59. package/dist/api/compound-geom.d.ts +1 -1
  60. package/dist/api/compound-geom.js +1 -1
  61. package/dist/api/compound-geom.js.map +1 -1
  62. package/dist/api/draft.d.ts +1 -1
  63. package/dist/api/draft.js +1 -1
  64. package/dist/api/draft.js.map +1 -1
  65. package/dist/api/edge-ref.d.ts +1 -1
  66. package/dist/api/edge-ref.d.ts.map +1 -1
  67. package/dist/api/edge-ref.js +11 -3
  68. package/dist/api/edge-ref.js.map +1 -1
  69. package/dist/api/engrave.d.ts +1 -1
  70. package/dist/api/engrave.js +7 -7
  71. package/dist/api/engrave.js.map +1 -1
  72. package/dist/api/extrude.d.ts +6 -1
  73. package/dist/api/extrude.d.ts.map +1 -1
  74. package/dist/api/extrude.js +59 -5
  75. package/dist/api/extrude.js.map +1 -1
  76. package/dist/api/face-ref.d.ts +1 -1
  77. package/dist/api/face-ref.js +1 -1
  78. package/dist/api/face-ref.js.map +1 -1
  79. package/dist/api/feature-repair.d.ts +1 -1
  80. package/dist/api/feature-repair.js +1 -1
  81. package/dist/api/feature-repair.js.map +1 -1
  82. package/dist/api/fillet-variable.d.ts +1 -1
  83. package/dist/api/fillet-variable.js +1 -1
  84. package/dist/api/fillet-variable.js.map +1 -1
  85. package/dist/api/fillet.d.ts +28 -8
  86. package/dist/api/fillet.d.ts.map +1 -1
  87. package/dist/api/fillet.js +64 -9
  88. package/dist/api/fillet.js.map +1 -1
  89. package/dist/api/generated/script-face-manifest.d.ts +4 -0
  90. package/dist/api/generated/script-face-manifest.d.ts.map +1 -1
  91. package/dist/api/generated/script-face-manifest.js.map +1 -1
  92. package/dist/api/geom.d.ts +1 -1
  93. package/dist/api/geom.js +1 -1
  94. package/dist/api/geom.js.map +1 -1
  95. package/dist/api/helix.d.ts +1 -1
  96. package/dist/api/helix.js +1 -1
  97. package/dist/api/helix.js.map +1 -1
  98. package/dist/api/import-brep.d.ts +20 -2
  99. package/dist/api/import-brep.d.ts.map +1 -1
  100. package/dist/api/import-brep.js +28 -3
  101. package/dist/api/import-brep.js.map +1 -1
  102. package/dist/api/import-step.d.ts +17 -2
  103. package/dist/api/import-step.d.ts.map +1 -1
  104. package/dist/api/import-step.js +23 -3
  105. package/dist/api/import-step.js.map +1 -1
  106. package/dist/api/index.d.ts +2 -1
  107. package/dist/api/index.d.ts.map +1 -1
  108. package/dist/api/index.js +5 -2
  109. package/dist/api/index.js.map +1 -1
  110. package/dist/api/internal/compat-op.js +1 -1
  111. package/dist/api/internal/compat-op.js.map +1 -1
  112. package/dist/api/internal/mesh-solid-op.d.ts +236 -0
  113. package/dist/api/internal/mesh-solid-op.d.ts.map +1 -0
  114. package/dist/api/internal/mesh-solid-op.js +352 -0
  115. package/dist/api/internal/mesh-solid-op.js.map +1 -0
  116. package/dist/api/internal/svg-asset-resolver.d.ts +1 -1
  117. package/dist/api/internal/svg-asset-resolver.js +1 -1
  118. package/dist/api/internal/svg-asset-resolver.js.map +1 -1
  119. package/dist/api/knurl.d.ts +1 -1
  120. package/dist/api/knurl.d.ts.map +1 -1
  121. package/dist/api/knurl.js +3 -2
  122. package/dist/api/knurl.js.map +1 -1
  123. package/dist/api/loft.d.ts +1 -1
  124. package/dist/api/loft.js +1 -1
  125. package/dist/api/loft.js.map +1 -1
  126. package/dist/api/measurement/index.d.ts +9 -5
  127. package/dist/api/measurement/index.d.ts.map +1 -1
  128. package/dist/api/measurement/index.js +47 -20
  129. package/dist/api/measurement/index.js.map +1 -1
  130. package/dist/api/pattern.d.ts +5 -3
  131. package/dist/api/pattern.d.ts.map +1 -1
  132. package/dist/api/pattern.js +32 -4
  133. package/dist/api/pattern.js.map +1 -1
  134. package/dist/api/place.d.ts +1 -1
  135. package/dist/api/place.js +1 -1
  136. package/dist/api/place.js.map +1 -1
  137. package/dist/api/primitives.d.ts +5 -4
  138. package/dist/api/primitives.d.ts.map +1 -1
  139. package/dist/api/primitives.js +11 -5
  140. package/dist/api/primitives.js.map +1 -1
  141. package/dist/api/profile.d.ts +64 -8
  142. package/dist/api/profile.d.ts.map +1 -1
  143. package/dist/api/profile.js +61 -10
  144. package/dist/api/profile.js.map +1 -1
  145. package/dist/api/punch-hole.d.ts +3 -0
  146. package/dist/api/punch-hole.d.ts.map +1 -1
  147. package/dist/api/punch-hole.js.map +1 -1
  148. package/dist/api/reconcile.d.ts +1 -1
  149. package/dist/api/reconcile.js +1 -1
  150. package/dist/api/reconcile.js.map +1 -1
  151. package/dist/api/replicate.d.ts.map +1 -1
  152. package/dist/api/replicate.js +122 -1
  153. package/dist/api/replicate.js.map +1 -1
  154. package/dist/api/screw.d.ts +1 -1
  155. package/dist/api/screw.js +3 -3
  156. package/dist/api/screw.js.map +1 -1
  157. package/dist/api/sdf.d.ts +1 -1
  158. package/dist/api/sdf.js +2 -2
  159. package/dist/api/sdf.js.map +1 -1
  160. package/dist/api/section-by-plane.d.ts +1 -1
  161. package/dist/api/section-by-plane.d.ts.map +1 -1
  162. package/dist/api/section-by-plane.js +2 -1
  163. package/dist/api/section-by-plane.js.map +1 -1
  164. package/dist/api/shell.d.ts +11 -4
  165. package/dist/api/shell.d.ts.map +1 -1
  166. package/dist/api/shell.js +53 -7
  167. package/dist/api/shell.js.map +1 -1
  168. package/dist/api/sketch-on-face.d.ts +41 -0
  169. package/dist/api/sketch-on-face.d.ts.map +1 -1
  170. package/dist/api/sketch-on-face.js +100 -1
  171. package/dist/api/sketch-on-face.js.map +1 -1
  172. package/dist/api/sketch-on-plane.d.ts +17 -9
  173. package/dist/api/sketch-on-plane.d.ts.map +1 -1
  174. package/dist/api/sketch-on-plane.js +12 -10
  175. package/dist/api/sketch-on-plane.js.map +1 -1
  176. package/dist/api/split-by-plane.d.ts +1 -1
  177. package/dist/api/split-by-plane.d.ts.map +1 -1
  178. package/dist/api/split-by-plane.js +2 -1
  179. package/dist/api/split-by-plane.js.map +1 -1
  180. package/dist/api/split.d.ts +1 -1
  181. package/dist/api/split.js +2 -2
  182. package/dist/api/split.js.map +1 -1
  183. package/dist/api/surface/arg-spec.d.ts +8 -0
  184. package/dist/api/surface/arg-spec.d.ts.map +1 -1
  185. package/dist/api/surface/arg-spec.js.map +1 -1
  186. package/dist/api/sweep.d.ts +1 -1
  187. package/dist/api/sweep.js +1 -1
  188. package/dist/api/sweep.js.map +1 -1
  189. package/dist/api/thicken.d.ts +1 -1
  190. package/dist/api/thicken.js +1 -1
  191. package/dist/api/thicken.js.map +1 -1
  192. package/dist/api/topo-resolve.d.ts +74 -1
  193. package/dist/api/topo-resolve.d.ts.map +1 -1
  194. package/dist/api/topo-resolve.js +180 -2
  195. package/dist/api/topo-resolve.js.map +1 -1
  196. package/dist/api/transform.d.ts +10 -6
  197. package/dist/api/transform.d.ts.map +1 -1
  198. package/dist/api/transform.js +74 -21
  199. package/dist/api/transform.js.map +1 -1
  200. package/dist/api/wire.d.ts +1 -1
  201. package/dist/api/wire.js +1 -1
  202. package/dist/api/wire.js.map +1 -1
  203. package/dist/api/xml-dom.d.ts +27 -0
  204. package/dist/api/xml-dom.d.ts.map +1 -0
  205. package/dist/api/xml-dom.js +45 -0
  206. package/dist/api/xml-dom.js.map +1 -0
  207. package/dist/brep/brep-ops.d.ts +13 -11
  208. package/dist/brep/brep-ops.d.ts.map +1 -1
  209. package/dist/brep/brep-ops.js +31 -30
  210. package/dist/brep/brep-ops.js.map +1 -1
  211. package/dist/brep/brep-topology.d.ts +5 -4
  212. package/dist/brep/brep-topology.d.ts.map +1 -1
  213. package/dist/brep/brep-topology.js +9 -6
  214. package/dist/brep/brep-topology.js.map +1 -1
  215. package/dist/brep/effective-deflection.d.ts +35 -0
  216. package/dist/brep/effective-deflection.d.ts.map +1 -0
  217. package/dist/brep/effective-deflection.js +49 -0
  218. package/dist/brep/effective-deflection.js.map +1 -0
  219. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  220. package/dist/brep/engine/adapters/brep-mock.js +27 -0
  221. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  222. package/dist/brep/engine/adapters/brepkit.d.ts +18 -0
  223. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  224. package/dist/brep/engine/adapters/brepkit.js +46 -1
  225. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  226. package/dist/brep/engine/adapters/occt.d.ts +1 -1
  227. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  228. package/dist/brep/engine/adapters/occt.js +3 -1
  229. package/dist/brep/engine/adapters/occt.js.map +1 -1
  230. package/dist/brep/engine/primitives.d.ts +29 -7
  231. package/dist/brep/engine/primitives.d.ts.map +1 -1
  232. package/dist/brep/engine/primitives.js.map +1 -1
  233. package/dist/brep/engine/registry.d.ts +24 -1
  234. package/dist/brep/engine/registry.d.ts.map +1 -1
  235. package/dist/brep/engine/registry.js +24 -0
  236. package/dist/brep/engine/registry.js.map +1 -1
  237. package/dist/brep/engine/types.d.ts +54 -3
  238. package/dist/brep/engine/types.d.ts.map +1 -1
  239. package/dist/brep/engine/types.js +10 -0
  240. package/dist/brep/engine/types.js.map +1 -1
  241. package/dist/brep/export/export-model.d.ts +79 -0
  242. package/dist/brep/export/export-model.d.ts.map +1 -0
  243. package/dist/brep/export/export-model.js +336 -0
  244. package/dist/brep/export/export-model.js.map +1 -0
  245. package/dist/brep/face-evolution.d.ts +1 -1
  246. package/dist/brep/face-evolution.d.ts.map +1 -1
  247. package/dist/brep/face-evolution.js +20 -1
  248. package/dist/brep/face-evolution.js.map +1 -1
  249. package/dist/brep/handle-bridge.d.ts +1 -1
  250. package/dist/brep/handle-bridge.js +1 -1
  251. package/dist/brep/handle-bridge.js.map +1 -1
  252. package/dist/brep/mesh-solid.d.ts +218 -0
  253. package/dist/brep/mesh-solid.d.ts.map +1 -0
  254. package/dist/brep/mesh-solid.js +229 -0
  255. package/dist/brep/mesh-solid.js.map +1 -0
  256. package/dist/brep/primitives-brep.d.ts.map +1 -1
  257. package/dist/brep/primitives-brep.js +3 -1
  258. package/dist/brep/primitives-brep.js.map +1 -1
  259. package/dist/brep/text/fontRegistry.d.ts +32 -1
  260. package/dist/brep/text/fontRegistry.d.ts.map +1 -1
  261. package/dist/brep/text/fontRegistry.js +51 -1
  262. package/dist/brep/text/fontRegistry.js.map +1 -1
  263. package/dist/brep/text/text-to-solid.d.ts.map +1 -1
  264. package/dist/brep/text/text-to-solid.js +8 -3
  265. package/dist/brep/text/text-to-solid.js.map +1 -1
  266. package/dist/brepkit-kernel/brepkitKernel.d.ts +18 -2
  267. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  268. package/dist/brepkit-kernel/brepkitKernel.js +453 -125
  269. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  270. package/dist/brepkit-kernel/brepkitWasm.d.ts +8 -0
  271. package/dist/brepkit-kernel/brepkitWasm.d.ts.map +1 -1
  272. package/dist/brepkit-kernel/brepkitWasm.js +10 -0
  273. package/dist/brepkit-kernel/brepkitWasm.js.map +1 -1
  274. package/dist/browser-host/browser-font-provider.d.ts +12 -0
  275. package/dist/browser-host/browser-font-provider.d.ts.map +1 -1
  276. package/dist/browser-host/browser-font-provider.js +25 -0
  277. package/dist/browser-host/browser-font-provider.js.map +1 -1
  278. package/dist/browser.d.ts +6 -3
  279. package/dist/browser.d.ts.map +1 -1
  280. package/dist/browser.js +10 -3
  281. package/dist/browser.js.map +1 -1
  282. package/dist/cad-runtime/backend-dispatch.d.ts +28 -3
  283. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  284. package/dist/cad-runtime/backend-dispatch.js +119 -4
  285. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  286. package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
  287. package/dist/cad-runtime/direct-executor.d.ts +19 -3
  288. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  289. package/dist/cad-runtime/direct-executor.js +49 -1
  290. package/dist/cad-runtime/direct-executor.js.map +1 -1
  291. package/dist/cad-runtime/ports.d.ts +3 -3
  292. package/dist/cad-runtime/ports.d.ts.map +1 -1
  293. package/dist/cad-runtime/ports.js.map +1 -1
  294. package/dist/cad-runtime/preview-exec.d.ts +4 -4
  295. package/dist/cad-runtime/preview-exec.js +2 -2
  296. package/dist/cad-runtime/preview-exec.js.map +1 -1
  297. package/dist/cad-runtime/runtime.d.ts +66 -8
  298. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  299. package/dist/cad-runtime/runtime.js +121 -8
  300. package/dist/cad-runtime/runtime.js.map +1 -1
  301. package/dist/define-op.d.ts +37 -1
  302. package/dist/define-op.d.ts.map +1 -1
  303. package/dist/define-op.js +25 -1
  304. package/dist/define-op.js.map +1 -1
  305. package/dist/env-agnostic.d.ts +7 -7
  306. package/dist/env-agnostic.d.ts.map +1 -1
  307. package/dist/env-agnostic.js +3 -3
  308. package/dist/env-agnostic.js.map +1 -1
  309. package/dist/geometry2d/adapt.d.ts +39 -4
  310. package/dist/geometry2d/adapt.d.ts.map +1 -1
  311. package/dist/geometry2d/adapt.js +14 -3
  312. package/dist/geometry2d/adapt.js.map +1 -1
  313. package/dist/geometry2d/blueprint.d.ts +2 -2
  314. package/dist/geometry2d/blueprint.js +2 -2
  315. package/dist/geometry2d/blueprint.js.map +1 -1
  316. package/dist/geometry2d/bridge/lift-on-plane.d.ts +18 -8
  317. package/dist/geometry2d/bridge/lift-on-plane.d.ts.map +1 -1
  318. package/dist/geometry2d/bridge/lift-on-plane.js +71 -12
  319. package/dist/geometry2d/bridge/lift-on-plane.js.map +1 -1
  320. package/dist/geometry2d/bridge/plane.d.ts +17 -0
  321. package/dist/geometry2d/bridge/plane.d.ts.map +1 -1
  322. package/dist/geometry2d/bridge/plane.js +22 -0
  323. package/dist/geometry2d/bridge/plane.js.map +1 -1
  324. package/dist/geometry2d/curve2d.d.ts +25 -0
  325. package/dist/geometry2d/curve2d.d.ts.map +1 -1
  326. package/dist/geometry2d/curve2d.js +41 -5
  327. package/dist/geometry2d/curve2d.js.map +1 -1
  328. package/dist/geometry2d/pen-sketcher.d.ts +25 -0
  329. package/dist/geometry2d/pen-sketcher.d.ts.map +1 -1
  330. package/dist/geometry2d/pen-sketcher.js +43 -0
  331. package/dist/geometry2d/pen-sketcher.js.map +1 -1
  332. package/dist/index.d.ts +6 -2
  333. package/dist/index.d.ts.map +1 -1
  334. package/dist/index.js +10 -3
  335. package/dist/index.js.map +1 -1
  336. package/dist/io/bytes-node.d.ts +11 -0
  337. package/dist/io/bytes-node.d.ts.map +1 -0
  338. package/dist/io/bytes-node.js +28 -0
  339. package/dist/io/bytes-node.js.map +1 -0
  340. package/dist/io/bytes.d.ts +33 -0
  341. package/dist/io/bytes.d.ts.map +1 -0
  342. package/dist/io/bytes.js +41 -0
  343. package/dist/io/bytes.js.map +1 -0
  344. package/dist/io/fai-zip/container-read.d.ts +102 -0
  345. package/dist/io/fai-zip/container-read.d.ts.map +1 -0
  346. package/dist/io/fai-zip/container-read.js +305 -0
  347. package/dist/io/fai-zip/container-read.js.map +1 -0
  348. package/dist/io/fai-zip/container-write.d.ts +70 -0
  349. package/dist/io/fai-zip/container-write.d.ts.map +1 -0
  350. package/dist/io/fai-zip/container-write.js +186 -0
  351. package/dist/io/fai-zip/container-write.js.map +1 -0
  352. package/dist/io/fai-zip/container.d.ts +107 -0
  353. package/dist/io/fai-zip/container.d.ts.map +1 -0
  354. package/dist/io/fai-zip/container.js +89 -0
  355. package/dist/io/fai-zip/container.js.map +1 -0
  356. package/dist/io/fai-zip/index.d.ts +18 -0
  357. package/dist/io/fai-zip/index.d.ts.map +1 -0
  358. package/dist/io/fai-zip/index.js +4 -0
  359. package/dist/io/fai-zip/index.js.map +1 -0
  360. package/dist/io/index.d.ts +10 -0
  361. package/dist/io/index.d.ts.map +1 -0
  362. package/dist/io/index.js +13 -0
  363. package/dist/io/index.js.map +1 -0
  364. package/dist/io/zip.d.ts +68 -0
  365. package/dist/io/zip.d.ts.map +1 -0
  366. package/dist/io/zip.js +147 -0
  367. package/dist/io/zip.js.map +1 -0
  368. package/dist/lang/code-to-args.d.ts +30 -4
  369. package/dist/lang/code-to-args.d.ts.map +1 -1
  370. package/dist/lang/code-to-args.js +42 -3
  371. package/dist/lang/code-to-args.js.map +1 -1
  372. package/dist/lang/codegen.d.ts +45 -1
  373. package/dist/lang/codegen.d.ts.map +1 -1
  374. package/dist/lang/codegen.js +135 -6
  375. package/dist/lang/codegen.js.map +1 -1
  376. package/dist/lang/host-arg.d.ts +6 -0
  377. package/dist/lang/host-arg.d.ts.map +1 -1
  378. package/dist/lang/host-arg.js.map +1 -1
  379. package/dist/lang/metadata-extractor.d.ts +25 -0
  380. package/dist/lang/metadata-extractor.d.ts.map +1 -1
  381. package/dist/lang/metadata-extractor.js +289 -25
  382. package/dist/lang/metadata-extractor.js.map +1 -1
  383. package/dist/lang/parse-error.d.ts +7 -1
  384. package/dist/lang/parse-error.d.ts.map +1 -1
  385. package/dist/lang/parse-error.js.map +1 -1
  386. package/dist/lang/security-scanner.d.ts +9 -1
  387. package/dist/lang/security-scanner.d.ts.map +1 -1
  388. package/dist/lang/security-scanner.js +38 -1
  389. package/dist/lang/security-scanner.js.map +1 -1
  390. package/dist/lang/statement-summary.d.ts +1 -1
  391. package/dist/lang/statement-summary.js +1 -1
  392. package/dist/lang/statement-summary.js.map +1 -1
  393. package/dist/lang/types.d.ts +1 -1
  394. package/dist/lang/types.js +1 -1
  395. package/dist/lang/types.js.map +1 -1
  396. package/dist/mesh/index.d.ts +2 -1
  397. package/dist/mesh/index.d.ts.map +1 -1
  398. package/dist/mesh/index.js +2 -1
  399. package/dist/mesh/index.js.map +1 -1
  400. package/dist/mesh/io.d.ts +69 -9
  401. package/dist/mesh/io.d.ts.map +1 -1
  402. package/dist/mesh/io.js +121 -17
  403. package/dist/mesh/io.js.map +1 -1
  404. package/dist/mesh/reconcile.d.ts +1 -1
  405. package/dist/mesh/reconcile.js +1 -1
  406. package/dist/mesh/reconcile.js.map +1 -1
  407. package/dist/mesh/rigid-transform.d.ts +3 -3
  408. package/dist/mesh/rigid-transform.js +3 -3
  409. package/dist/mesh/rigid-transform.js.map +1 -1
  410. package/dist/mesh/stl-unit.d.ts +24 -0
  411. package/dist/mesh/stl-unit.d.ts.map +1 -0
  412. package/dist/mesh/stl-unit.js +17 -0
  413. package/dist/mesh/stl-unit.js.map +1 -0
  414. package/dist/mesh/threemf-bambu.d.ts +142 -0
  415. package/dist/mesh/threemf-bambu.d.ts.map +1 -0
  416. package/dist/mesh/threemf-bambu.js +334 -0
  417. package/dist/mesh/threemf-bambu.js.map +1 -0
  418. package/dist/mesh/threemf-loader.d.ts +50 -0
  419. package/dist/mesh/threemf-loader.d.ts.map +1 -0
  420. package/dist/mesh/threemf-loader.js +628 -0
  421. package/dist/mesh/threemf-loader.js.map +1 -0
  422. package/dist/mesh/threemf-view.d.ts +71 -0
  423. package/dist/mesh/threemf-view.d.ts.map +1 -0
  424. package/dist/mesh/threemf-view.js +100 -0
  425. package/dist/mesh/threemf-view.js.map +1 -0
  426. package/dist/mesh/transform.d.ts +2 -2
  427. package/dist/mesh/transform.d.ts.map +1 -1
  428. package/dist/mesh/transform.js +3 -3
  429. package/dist/mesh/transform.js.map +1 -1
  430. package/dist/mesh/types.d.ts +1 -1
  431. package/dist/mesh/types.d.ts.map +1 -1
  432. package/dist/mesh/types.js.map +1 -1
  433. package/dist/node-host/cli.d.ts +44 -6
  434. package/dist/node-host/cli.d.ts.map +1 -1
  435. package/dist/node-host/cli.js +127 -50
  436. package/dist/node-host/cli.js.map +1 -1
  437. package/dist/node-host/font-family-index.d.ts +93 -0
  438. package/dist/node-host/font-family-index.d.ts.map +1 -0
  439. package/dist/node-host/font-family-index.js +273 -0
  440. package/dist/node-host/font-family-index.js.map +1 -0
  441. package/dist/node-host/fs-asset-resolver.d.ts +8 -3
  442. package/dist/node-host/fs-asset-resolver.d.ts.map +1 -1
  443. package/dist/node-host/fs-asset-resolver.js +13 -5
  444. package/dist/node-host/fs-asset-resolver.js.map +1 -1
  445. package/dist/node-host/index.d.ts +8 -0
  446. package/dist/node-host/index.d.ts.map +1 -1
  447. package/dist/node-host/index.js +1 -0
  448. package/dist/node-host/index.js.map +1 -1
  449. package/dist/node-host/node-font-provider.d.ts +28 -0
  450. package/dist/node-host/node-font-provider.d.ts.map +1 -1
  451. package/dist/node-host/node-font-provider.js +49 -0
  452. package/dist/node-host/node-font-provider.js.map +1 -1
  453. package/dist/node.d.ts +1 -0
  454. package/dist/node.d.ts.map +1 -1
  455. package/dist/node.js +1 -0
  456. package/dist/node.js.map +1 -1
  457. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -1
  458. package/dist/occt-kernel/occt-primitives.js +35 -2
  459. package/dist/occt-kernel/occt-primitives.js.map +1 -1
  460. package/dist/occt-kernel/occtKernel.d.ts +18 -13
  461. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  462. package/dist/occt-kernel/occtKernel.js +20 -31
  463. package/dist/occt-kernel/occtKernel.js.map +1 -1
  464. package/dist/occt-kernel/stepColorParser.d.ts +18 -0
  465. package/dist/occt-kernel/stepColorParser.d.ts.map +1 -1
  466. package/dist/occt-kernel/stepColorParser.js +38 -0
  467. package/dist/occt-kernel/stepColorParser.js.map +1 -1
  468. package/dist/occt-kernel/topologyExt.d.ts +1 -1
  469. package/dist/occt-kernel/topologyExt.d.ts.map +1 -1
  470. package/dist/occt-kernel/topologyExt.js +8 -6
  471. package/dist/occt-kernel/topologyExt.js.map +1 -1
  472. package/dist/primitives/text/cjk-font.d.ts +2 -15
  473. package/dist/primitives/text/cjk-font.d.ts.map +1 -1
  474. package/dist/primitives/text/cjk-font.js +13 -1
  475. package/dist/primitives/text/cjk-font.js.map +1 -1
  476. package/dist/runtime-state.d.ts +103 -9
  477. package/dist/runtime-state.d.ts.map +1 -1
  478. package/dist/runtime-state.js +95 -2
  479. package/dist/runtime-state.js.map +1 -1
  480. package/dist/sdk.d.ts +4 -4
  481. package/dist/sdk.d.ts.map +1 -1
  482. package/dist/sdk.js +6 -6
  483. package/dist/sdk.js.map +1 -1
  484. package/dist/shape.d.ts +97 -2
  485. package/dist/shape.d.ts.map +1 -1
  486. package/dist/shape.js +126 -1
  487. package/dist/shape.js.map +1 -1
  488. package/dist/tolerance.d.ts +38 -0
  489. package/dist/tolerance.d.ts.map +1 -0
  490. package/dist/tolerance.js +40 -0
  491. package/dist/tolerance.js.map +1 -0
  492. package/dist/topology/naming/lineage.d.ts +6 -0
  493. package/dist/topology/naming/lineage.d.ts.map +1 -1
  494. package/dist/topology/naming/lineage.js +8 -0
  495. package/dist/topology/naming/lineage.js.map +1 -1
  496. package/dist/topology/naming/resolve-edge.d.ts +20 -1
  497. package/dist/topology/naming/resolve-edge.d.ts.map +1 -1
  498. package/dist/topology/naming/resolve-edge.js +54 -20
  499. package/dist/topology/naming/resolve-edge.js.map +1 -1
  500. package/dist/topology/naming/score.js +3 -3
  501. package/dist/topology/naming/score.js.map +1 -1
  502. package/dist/units.d.ts +248 -0
  503. package/dist/units.d.ts.map +1 -0
  504. package/dist/units.js +397 -0
  505. package/dist/units.js.map +1 -0
  506. package/dist/weapp.d.ts +6 -2
  507. package/dist/weapp.d.ts.map +1 -1
  508. package/dist/weapp.js +7 -1
  509. package/dist/weapp.js.map +1 -1
  510. package/package.json +28 -3
package/dist/shape.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * stdlib shape — 类型化构造器 + 身份槽
2
+ * api shape — 类型化构造器 + 身份槽
3
3
  *
4
4
  *
5
5
  * 变更要点:
@@ -32,7 +32,7 @@ export interface CompoundShape {
32
32
  export interface CurveShape extends Shape {
33
33
  kind: 'curve';
34
34
  }
35
- /** A shape that the stdlib exports as a finished result. */
35
+ /** A shape that the api layer exports as a finished result. */
36
36
  export type StdShape = SolidShape | CompoundShape | CurveShape;
37
37
  /**
38
38
  * 实体 Shape 构造器:mesh 产物必须经此创建。
@@ -77,6 +77,101 @@ export declare function fromBrep(mesh: Shape, holder: BrepHolder): SolidShape;
77
77
  * @returns the created curve shape with the BREP handle attached.
78
78
  */
79
79
  export declare function fromBrepCurve(mesh: Shape, holder: BrepHolder): CurveShape;
80
+ /**
81
+ * 网格实体产物的构造器:与 `fromBrep` 对称,登记网格实体句柄(近似链)而非
82
+ * BREP 句柄(精度链)。
83
+ *
84
+ * ```ts
85
+ * return fromMeshSolid(displayMesh, { meshSolid: result.solid })
86
+ * ```
87
+ *
88
+ * 与 `fromBrep` 的三点差别(方案 §3.2):
89
+ * 1. 写 `slot.meshSolid`,**不写** `slot.solid`——网格零件永不进 BREP 链;
90
+ * 2. 不登记函数 BREP 域(`registerFunctionBrep`)——句柄所有权在
91
+ * `MeshSolidRegistry`,按 BREP 内核释放是错的(可能是另一个内核);
92
+ * 3. 不旁挂 roleTable(近似拓扑不给语义 role——role 是 BREP 真拓扑的专有能力)。
93
+ *
94
+ * @param mesh - the mesh shape to wrap as a solid (display mesh).
95
+ * @param holder - the mesh-solid holder providing the handle identity.
96
+ * @returns the created solid shape carrying the mesh-solid slot.
97
+ */
98
+ export declare function fromMeshSolid(mesh: Shape, holder: MeshSolidHolder): SolidShape;
99
+ /** 网格实体句柄容器(与 `BrepHolder` 对称;类型为 unknown 以保持零依赖)。 */
100
+ export interface MeshSolidHolder {
101
+ /** 网格实体句柄的**身份**(句柄本体在 `MeshSolidRegistry`)。 */
102
+ meshSolid: unknown;
103
+ }
104
+ /**
105
+ * 网格链**面**产物的构造器(方案 2026-10-01 §4 Phase 3)。与 `fromBrep` 的
106
+ * 面产物对称:BREP 侧 `sketchOnFace` 返回 `fromBrep(solidToShape(kernel, face),
107
+ * { solid: face })`,这里返回 `fromMeshFace(meshShape(face), { meshFace: face })`。
108
+ *
109
+ * `kind` 沿用 `'solid'`(不是 `'shape2d'`):与 BREP 侧的面 Shape 保持同一形态,
110
+ * 好让 `extrude` 的 `isCurveShape` 预检在两条链上行为一致——面不是 1D 曲线,
111
+ * 不该被面消费 op 当成曲线拒掉。
112
+ *
113
+ * @param mesh - the face's display mesh (its own tessellation).
114
+ * @param holder - the mesh-face holder providing the handle identity.
115
+ * @returns the created shape carrying the mesh-face slot.
116
+ */
117
+ export declare function fromMeshFace(mesh: Shape, holder: MeshFaceHolder): SolidShape;
118
+ /** 网格链面句柄容器(与 `MeshSolidHolder` 对称;类型为 unknown 以保持零依赖)。 */
119
+ export interface MeshFaceHolder {
120
+ /** 网格链面句柄的**身份**。 */
121
+ meshFace: unknown;
122
+ }
123
+ /**
124
+ * 把网格实体句柄登记到已构造的 Shape。
125
+ *
126
+ * 互斥红线:该 Shape 已有 BREP 句柄或网格链面句柄时**直接抛错**——一个 Shape
127
+ * 同时声称两种链身份是设计缺陷,不能静默覆盖任何一侧。
128
+ *
129
+ * @param s - the already-constructed shape.
130
+ * @param meshSolid - the mesh solid handle.
131
+ * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.
132
+ */
133
+ export declare function attachMeshSolid(s: Shape, meshSolid: unknown): void;
134
+ /**
135
+ * 把网格链**面**句柄登记到已构造的 Shape。
136
+ *
137
+ * 与 `attachMeshSolid` 同一条互斥红线:已有任意另一种链身份即抛错。
138
+ *
139
+ * @param s - the already-constructed shape.
140
+ * @param meshFace - the mesh-chain face handle.
141
+ * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.
142
+ */
143
+ export declare function attachMeshFace(s: Shape, meshFace: unknown): void;
144
+ /**
145
+ * 该 Shape 是否携带网格链面(`sketchOnFace` 在近似拓扑面上的产物)。
146
+ *
147
+ * @param shape - the shape to test.
148
+ * @returns true if the shape carries a mesh-chain face handle.
149
+ */
150
+ export declare function hasMeshFace(shape: Shape): boolean;
151
+ /**
152
+ * 读取该 Shape 的网格链面句柄(无则 undefined)。
153
+ *
154
+ * @param shape - the shape whose mesh-chain face handle to read.
155
+ * @returns the mesh-chain face handle, or undefined if none.
156
+ */
157
+ export declare function meshFaceOf(shape: Shape): unknown | undefined;
158
+ /**
159
+ * 该 Shape 是否携带网格实体(网格零件)。引擎分派与 UI 查询用。
160
+ *
161
+ * 与 `hasBrep` 互斥:正常路径下二者不可能同时为真(`attachMeshSolid` 已经把
162
+ * 互斥钉在写入侧,`assertShapeSlotExclusive` 在分派前再兜一层)。
163
+ *
164
+ * @param shape - the shape to test.
165
+ * @returns true if the shape carries a mesh solid handle.
166
+ */
167
+ export declare function hasMeshSolid(shape: Shape): boolean;
168
+ /**
169
+ * 读取该 Shape 的网格实体句柄(无则 undefined)。
170
+ *
171
+ * @param shape - the shape whose mesh solid handle to read.
172
+ * @returns the mesh solid handle, or undefined if none.
173
+ */
174
+ export declare function meshSolidOf(shape: Shape): unknown | undefined;
80
175
  /** BREP 句柄 + 面演化 + 拓扑命名 RoleTable(对应 OCCT 的 ShapeHandle)。类型为 unknown 以保持零依赖。 */
81
176
  export interface BrepHolder {
82
177
  solid: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../src/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAiE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAM/G,kDAAkD;AAClD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAA;AAElE,oDAAoD;AACpD,MAAM,WAAW,UAAW,SAAQ,KAAK;IACvC,IAAI,EAAE,OAAO,CAAA;CACd;AAED,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE,KAAK,EAAE,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAW,SAAQ,KAAK;IACvC,IAAI,EAAE,OAAO,CAAA;CACd;AAED,4DAA4D;AAC5D,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAAA;AAE9D;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,CAI7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,CAI7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAIpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAIzE;AAoCD,gFAAgF;AAChF,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,OAAO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aAAa,CAI7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAExD;AAID,YAAY,EAAE,SAAS,EAAE,CAAA;AAEzB;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAQnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAGjE;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAE7C;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAEtD"}
package/dist/shape.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * stdlib shape — 类型化构造器 + 身份槽
2
+ * api shape — 类型化构造器 + 身份槽
3
3
  *
4
4
  *
5
5
  * 变更要点:
@@ -71,6 +71,126 @@ export function fromBrepCurve(mesh, holder) {
71
71
  attachBrep(s, holder);
72
72
  return s;
73
73
  }
74
+ /**
75
+ * 网格实体产物的构造器:与 `fromBrep` 对称,登记网格实体句柄(近似链)而非
76
+ * BREP 句柄(精度链)。
77
+ *
78
+ * ```ts
79
+ * return fromMeshSolid(displayMesh, { meshSolid: result.solid })
80
+ * ```
81
+ *
82
+ * 与 `fromBrep` 的三点差别(方案 §3.2):
83
+ * 1. 写 `slot.meshSolid`,**不写** `slot.solid`——网格零件永不进 BREP 链;
84
+ * 2. 不登记函数 BREP 域(`registerFunctionBrep`)——句柄所有权在
85
+ * `MeshSolidRegistry`,按 BREP 内核释放是错的(可能是另一个内核);
86
+ * 3. 不旁挂 roleTable(近似拓扑不给语义 role——role 是 BREP 真拓扑的专有能力)。
87
+ *
88
+ * @param mesh - the mesh shape to wrap as a solid (display mesh).
89
+ * @param holder - the mesh-solid holder providing the handle identity.
90
+ * @returns the created solid shape carrying the mesh-solid slot.
91
+ */
92
+ export function fromMeshSolid(mesh, holder) {
93
+ const s = solid(mesh);
94
+ attachMeshSolid(s, holder.meshSolid);
95
+ return s;
96
+ }
97
+ /**
98
+ * 网格链**面**产物的构造器(方案 2026-10-01 §4 Phase 3)。与 `fromBrep` 的
99
+ * 面产物对称:BREP 侧 `sketchOnFace` 返回 `fromBrep(solidToShape(kernel, face),
100
+ * { solid: face })`,这里返回 `fromMeshFace(meshShape(face), { meshFace: face })`。
101
+ *
102
+ * `kind` 沿用 `'solid'`(不是 `'shape2d'`):与 BREP 侧的面 Shape 保持同一形态,
103
+ * 好让 `extrude` 的 `isCurveShape` 预检在两条链上行为一致——面不是 1D 曲线,
104
+ * 不该被面消费 op 当成曲线拒掉。
105
+ *
106
+ * @param mesh - the face's display mesh (its own tessellation).
107
+ * @param holder - the mesh-face holder providing the handle identity.
108
+ * @returns the created shape carrying the mesh-face slot.
109
+ */
110
+ export function fromMeshFace(mesh, holder) {
111
+ const s = solid(mesh);
112
+ attachMeshFace(s, holder.meshFace);
113
+ return s;
114
+ }
115
+ /**
116
+ * 把网格实体句柄登记到已构造的 Shape。
117
+ *
118
+ * 互斥红线:该 Shape 已有 BREP 句柄或网格链面句柄时**直接抛错**——一个 Shape
119
+ * 同时声称两种链身份是设计缺陷,不能静默覆盖任何一侧。
120
+ *
121
+ * @param s - the already-constructed shape.
122
+ * @param meshSolid - the mesh solid handle.
123
+ * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.
124
+ */
125
+ export function attachMeshSolid(s, meshSolid) {
126
+ const state = getRuntimeState();
127
+ const slot = state.slots.get(s) ?? {};
128
+ if (slot.solid !== undefined) {
129
+ throw new Error('E_SHAPE_SLOT_EXCLUSIVE: shape already carries a BREP handle — a shape is either on the precision chain or the mesh chain, never both');
130
+ }
131
+ if (slot.meshFace !== undefined) {
132
+ throw new Error('E_SHAPE_SLOT_EXCLUSIVE: shape already carries a mesh-chain face handle — a shape is either a mesh solid or a mesh-chain face, never both');
133
+ }
134
+ slot.meshSolid = meshSolid;
135
+ state.slots.set(s, slot);
136
+ }
137
+ /**
138
+ * 把网格链**面**句柄登记到已构造的 Shape。
139
+ *
140
+ * 与 `attachMeshSolid` 同一条互斥红线:已有任意另一种链身份即抛错。
141
+ *
142
+ * @param s - the already-constructed shape.
143
+ * @param meshFace - the mesh-chain face handle.
144
+ * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.
145
+ */
146
+ export function attachMeshFace(s, meshFace) {
147
+ const state = getRuntimeState();
148
+ const slot = state.slots.get(s) ?? {};
149
+ if (slot.solid !== undefined || slot.meshSolid !== undefined) {
150
+ throw new Error('E_SHAPE_SLOT_EXCLUSIVE: shape already carries a BREP or mesh-solid handle — a mesh-chain face is its own identity');
151
+ }
152
+ slot.meshFace = meshFace;
153
+ state.slots.set(s, slot);
154
+ }
155
+ /**
156
+ * 该 Shape 是否携带网格链面(`sketchOnFace` 在近似拓扑面上的产物)。
157
+ *
158
+ * @param shape - the shape to test.
159
+ * @returns true if the shape carries a mesh-chain face handle.
160
+ */
161
+ export function hasMeshFace(shape) {
162
+ return getRuntimeState().slots.get(shape)?.meshFace !== undefined;
163
+ }
164
+ /**
165
+ * 读取该 Shape 的网格链面句柄(无则 undefined)。
166
+ *
167
+ * @param shape - the shape whose mesh-chain face handle to read.
168
+ * @returns the mesh-chain face handle, or undefined if none.
169
+ */
170
+ export function meshFaceOf(shape) {
171
+ return getRuntimeState().slots.get(shape)?.meshFace;
172
+ }
173
+ /**
174
+ * 该 Shape 是否携带网格实体(网格零件)。引擎分派与 UI 查询用。
175
+ *
176
+ * 与 `hasBrep` 互斥:正常路径下二者不可能同时为真(`attachMeshSolid` 已经把
177
+ * 互斥钉在写入侧,`assertShapeSlotExclusive` 在分派前再兜一层)。
178
+ *
179
+ * @param shape - the shape to test.
180
+ * @returns true if the shape carries a mesh solid handle.
181
+ */
182
+ export function hasMeshSolid(shape) {
183
+ return getRuntimeState().slots.get(shape)?.meshSolid !== undefined;
184
+ }
185
+ /**
186
+ * 读取该 Shape 的网格实体句柄(无则 undefined)。
187
+ *
188
+ * @param shape - the shape whose mesh solid handle to read.
189
+ * @returns the mesh solid handle, or undefined if none.
190
+ */
191
+ export function meshSolidOf(shape) {
192
+ return getRuntimeState().slots.get(shape)?.meshSolid;
193
+ }
74
194
  /**
75
195
  * 把 BREP 句柄登记到已构造的 Shape(由 `solid` / `curve` 产出)。
76
196
  *
@@ -85,6 +205,11 @@ export function fromBrepCurve(mesh, holder) {
85
205
  function attachBrep(s, holder) {
86
206
  const state = getRuntimeState();
87
207
  const slot = state.slots.get(s) ?? {};
208
+ if (slot.meshSolid !== undefined || slot.meshFace !== undefined) {
209
+ // 互斥红线的另一侧:网格链产物不得再被登记成 BREP 实体(一个 Shape 只能
210
+ // 在精度链或网格链之一上)。
211
+ throw new Error('E_SHAPE_SLOT_EXCLUSIVE: shape already carries a mesh-chain handle — a shape is either on the precision chain or the mesh chain, never both');
212
+ }
88
213
  slot.solid = holder.solid;
89
214
  if (holder.faceEvolution)
90
215
  slot.faceEvolution = holder.faceEvolution;
package/dist/shape.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"shape.js","sourceRoot":"","sources":["../src/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAA;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAgC1D;;;;;GAKG;AACH,MAAM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;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe;IAC1C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AACnD,CAAC","sourcesContent":["/**\n * stdlib shape — 类型化构造器 + 身份槽\n *\n *\n * 变更要点:\n * - 身份表(created / slots / shapeToName)改读全局锚点 runtime-state,\n * 使\"两份 faijs 代码\"共享同一份状态(解决 Shape 身份孤岛)。\n * - 新增 fromBrep(mesh, holder):BREP 产物一次登记句柄与面演化,\n * 库函数不再手动登记(P2 落地)。\n * - 新增 hasBrep / brepOf:引擎侧判定\"某 Shape 是否在 BREP 链上\"。\n */\n\nimport type { Shape } from './mesh/types'\nimport { getRuntimeState, registerFunctionBrep, nameOf, getCurrentStmt, type ShapeSlot } from './runtime-state'\nimport { asStmtId } from './identity'\nimport { runtimeLineage } from './topology/naming/lineage'\n\n// ── Shape 构造器 ──\n\n/** Discriminator for the concrete shape kinds. */\nexport type ShapeKind = 'solid' | 'shape2d' | 'curve' | 'compound'\n\n/** A solid mesh shape produced by a constructor. */\nexport interface SolidShape extends Shape {\n kind: 'solid'\n}\n\n/** A structural compound grouping a list of child shapes. */\nexport interface CompoundShape {\n kind: 'compound'\n children: Shape[]\n}\n\n/**\n * 1D 曲线 Shape(wire / helix / edge-loop 等无三角载荷的 1D 几何)。\n *\n * `kind: 'curve'` 表达「无三角载荷」,与 `'solid'` 对称(见 `curve()` /\n * `fromBrepCurve()`)。执行链路照走 `solidToShape`(wire → 空 0/0 载荷,不抛),\n * 显示经 `wireframe`。\n */\nexport interface CurveShape extends Shape {\n kind: 'curve'\n}\n\n/** A shape that the stdlib exports as a finished result. */\nexport type StdShape = SolidShape | CompoundShape | CurveShape\n\n/**\n * 实体 Shape 构造器:mesh 产物必须经此创建。\n *\n * @param mesh - the mesh shape to wrap as a solid.\n * @returns the created solid shape.\n */\nexport function solid(mesh: Shape): SolidShape {\n const s: SolidShape = { ...mesh, kind: 'solid' }\n getRuntimeState().created.add(s)\n return s\n}\n\n/**\n * 1D 曲线 Shape 构造器(wire / helix / edge-loop 等 1D 产物)。\n *\n * 与 `solid` 对称:登记到 identity 表(供 `isShape` 识别),`kind` 设为 `'curve'`\n * 以表达「无三角载荷的 1D 几何」(执行链路照走 `solidToShape`,显示经 `wireframe`)。\n *\n * @param mesh - the mesh payload (positions/indices) to wrap as a curve.\n * @returns the created curve shape.\n */\nexport function curve(mesh: Shape): CurveShape {\n const s: CurveShape = { ...mesh, kind: 'curve' }\n getRuntimeState().created.add(s)\n return s\n}\n\n/**\n * BREP 产物构造器:同时登记 mesh 与 OCCT 句柄(+ 可选面演化)。\n *\n * 库函数用它替代 `solid(mesh)` + 手动登记句柄两步行:\n * ```ts\n * return fromBrep(solidToShape(kernel, resultSolid), {\n * solid: resultSolid,\n * faceEvolution: identityEvolution(kernel, resultSolid),\n * })\n * ```\n *\n * @param mesh - the mesh shape to register.\n * @param holder - the BREP holder providing the OCCT handle and optional face evolution.\n * @returns the created solid shape with the BREP handle attached.\n */\nexport function fromBrep(mesh: Shape, holder: BrepHolder): SolidShape {\n const s = solid(mesh)\n attachBrep(s, holder)\n return s\n}\n\n/**\n * 1D 曲线产物的 BREP 登记构造器:与 `fromBrep` 对称,但 `kind` 取 `'curve'`\n * (维持既有「有无三角载荷」语义——1D 几何无三角载荷,不得报 `'solid'`)。\n * 登记逻辑与 `fromBrep` 共用 `attachBrep`,保证两种形态走同一份身份/血缘/释放语义。\n *\n * @param mesh - the mesh payload (positions/indices) to wrap as a curve.\n * @param holder - the BREP holder providing the OCCT handle and optional face evolution.\n * @returns the created curve shape with the BREP handle attached.\n */\nexport function fromBrepCurve(mesh: Shape, holder: BrepHolder): CurveShape {\n const s = curve(mesh)\n attachBrep(s, holder)\n return s\n}\n\n/**\n * 把 BREP 句柄登记到已构造的 Shape(由 `solid` / `curve` 产出)。\n *\n * 集中 brep 登记的四步(identity 槽登记已由构造器完成;此处只补:① 身份槽挂载\n * 句柄 / ② 血缘图语句键旁挂 roleTable / ③ 函数 BREP 域登记)。供 `fromBrep` /\n * `fromBrepCurve` 共用——禁止绕开本函数手写登记(否则等于复制一整套身份、血缘与\n * 释放语义)。\n *\n * @param s - the already-constructed shape (solid or curve).\n * @param holder - the BREP holder to attach.\n */\nfunction attachBrep(s: Shape, holder: BrepHolder): void {\n const state = getRuntimeState()\n const slot = state.slots.get(s) ?? {}\n slot.solid = holder.solid\n if (holder.faceEvolution) slot.faceEvolution = holder.faceEvolution\n // 1.10 前置③:roleTable **不再写 slot**(字段已删)——权威落点是下方血缘图\n // 旁挂(语句键 + part 键),解析缓存 miss 由回走重算恢复。\n state.slots.set(s, slot)\n // 1.10 前置③:roleTable 权威旁挂(**语句键**)在血缘图。part 键的记录在\n // define-op.wrapped(impl 返回后 anchor.outputs 名字已定)——此处 shape 还未\n // 被 executor 命名,nameOf(s) 为 undefined,不能在这里记 part 键。\n const stmt = getCurrentStmt()\n if (stmt && (holder.roleTable || holder.solid !== undefined)) {\n runtimeLineage.recordOutput(\n asStmtId(stmt.id),\n holder.roleTable as ReadonlyMap<string, ReadonlyMap<string, readonly number[]>> | undefined,\n holder.solid,\n )\n }\n // 函数 BREP 域(§5.6):函数体内 op 产生的新句柄登记到当前域,函数返回后统一释放\n registerFunctionBrep(holder.solid)\n}\n\n/** BREP 句柄 + 面演化 + 拓扑命名 RoleTable(对应 OCCT 的 ShapeHandle)。类型为 unknown 以保持零依赖。 */\nexport interface BrepHolder {\n solid: unknown\n faceEvolution?: Map<number, number[]>\n /**\n * 1.10 前置③:产形 op 交付 role 表的唯一入口。fromBrep 把它**旁挂到血缘图**\n * (语句键 + part 键);slot 侧的缓存存储已删(ShapeSlot 不再有该字段)。\n */\n roleTable?: unknown\n}\n\n/**\n * compound Shape 构造器:结构(层级)而非新几何。\n *\n * @param children - the child shapes to group.\n * @returns the created compound shape.\n */\nexport function compound(children: Shape[]): CompoundShape {\n const c: CompoundShape = { kind: 'compound', children }\n getRuntimeState().created.add(c)\n return c\n}\n\n/**\n * 是否为构造器产物(终端判定与 compound 检测的依据)。\n *\n * @param v - the value to test.\n * @returns true if the value was created by a shape constructor.\n */\nexport function isShape(v: unknown): v is Shape {\n return !!v && typeof v === 'object' && getRuntimeState().created.has(v)\n}\n\n/**\n * Returns true if the value is a strict compound shape created by a constructor.\n *\n * @param v - the value to test.\n * @returns true if the value is a strict compound shape.\n */\nexport function isCompound(v: unknown): v is CompoundShape {\n return isShape(v) && (v as { kind?: string }).kind === 'compound'\n}\n\n/**\n * 结构判定:是否为 compound 形态(keep-syntax §5.3 D5,对任意库函数零要求)。\n * 引擎内部的终端/消费判定用结构判定;SDK 公开的 isShape/isCompound 保持 WeakSet 严格。\n *\n * @param v - the value to test.\n * @returns true if the value has compound shape structure.\n */\nexport function isCompoundLike(v: unknown): v is CompoundShape {\n return !!v && typeof v === 'object'\n && (v as { kind?: string }).kind === 'compound'\n && Array.isArray((v as { children?: unknown }).children)\n}\n\n/**\n * 1D 曲线判定(1D 判别位,Phase 3):`kind === 'curve'`。\n *\n * 面消费 op(extrude / revolve / sweep 等)用它做**执行前**输入维度预检——\n * 1D 产物(wire / helix / sketch as:'wire')喂给面 op 时必须是明确的预检失败,\n * 不得落进内核深层才报「操作失败」。与 SDK 的 WeakSet 严格 `isShape` 不同,\n * 本判定是结构判定(与 `isCompoundLike` 同族),对跨库产物零要求。\n *\n * @param v - the value to test.\n * @returns true when the value is a 1D curve shape.\n */\nexport function isCurveShape(v: unknown): v is CurveShape {\n return !!v && typeof v === 'object' && (v as { kind?: string }).kind === 'curve'\n}\n\n// ── 身份槽 ──\n\nexport type { ShapeSlot }\n\n/**\n * 读取 Shape 的身份槽(无则 undefined)。\n *\n * @param shape - the shape whose slot to read.\n * @returns the identity slot, or undefined if none is registered.\n */\nexport function getSlot(shape: object): ShapeSlot | undefined {\n return getRuntimeState().slots.get(shape)\n}\n\n/**\n * 读取或创建 Shape 的身份槽。\n *\n * @param shape - the shape whose slot to read or create.\n * @returns the shape's identity slot.\n */\nexport function ensureSlot(shape: object): ShapeSlot {\n const state = getRuntimeState()\n let slot = state.slots.get(shape)\n if (!slot) {\n slot = {}\n state.slots.set(shape, slot)\n }\n return slot\n}\n\n/**\n * 读输入 Shape 的 roleTable(op 实现读**输入**表的唯一读口,1.10 前置③)。\n *\n * 语义 = 旧 `getSlot(shape)?.roleTable`:权威落点在血缘图的 part 键旁挂\n * (上一条语句 fromBrep 时记录),slot 缓存字段已删除。未记录 → undefined\n * (mesh 产物 / 无命名)。\n *\n * @param shape - the input shape whose role table to read.\n * @returns the role table (unknown — callers assert their table type), or undefined.\n */\nexport function inputRoleTable(shape: object): unknown | undefined {\n const name = nameOf(shape)\n return name ? runtimeLineage.tableOfPart(name) : undefined\n}\n\n/**\n * 该 Shape 是否在 BREP 链上(有 OCCT 句柄)。引擎分派与 UI 查询用。\n *\n * @param shape - the shape to test.\n * @returns true if the shape has an attached OCCT handle.\n */\nexport function hasBrep(shape: Shape): boolean {\n return getRuntimeState().slots.get(shape)?.solid !== undefined\n}\n\n/**\n * 读取该 Shape 的 OCCT 句柄(无则 undefined)。库函数用前必须判空。\n *\n * @param shape - the shape whose handle to read.\n * @returns the OCCT handle, or undefined if none.\n */\nexport function brepOf(shape: Shape): unknown | undefined {\n return getRuntimeState().slots.get(shape)?.solid\n}\n\n/**\n * nameOf 批量版:Shape[] → 成员名(装配 memberNames,P6 替代读 IR)。\n *\n * @param shapes - the shapes to name.\n * @returns the member names, one per shape (empty string when unnamed).\n */\nexport function nameOfShapes(shapes: Shape[]): string[] {\n return shapes.map((s) => String(nameOf(s) ?? ''))\n}\n"]}
1
+ {"version":3,"file":"shape.js","sourceRoot":"","sources":["../src/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAA;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AAC,MAAe;IAC1C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AACnD,CAAC","sourcesContent":["/**\n * api shape — 类型化构造器 + 身份槽\n *\n *\n * 变更要点:\n * - 身份表(created / slots / shapeToName)改读全局锚点 runtime-state,\n * 使\"两份 faijs 代码\"共享同一份状态(解决 Shape 身份孤岛)。\n * - 新增 fromBrep(mesh, holder):BREP 产物一次登记句柄与面演化,\n * 库函数不再手动登记(P2 落地)。\n * - 新增 hasBrep / brepOf:引擎侧判定\"某 Shape 是否在 BREP 链上\"。\n */\n\nimport type { Shape } from './mesh/types'\nimport { getRuntimeState, registerFunctionBrep, nameOf, getCurrentStmt, type ShapeSlot } from './runtime-state'\nimport { asStmtId } from './identity'\nimport { runtimeLineage } from './topology/naming/lineage'\n\n// ── Shape 构造器 ──\n\n/** Discriminator for the concrete shape kinds. */\nexport type ShapeKind = 'solid' | 'shape2d' | 'curve' | 'compound'\n\n/** A solid mesh shape produced by a constructor. */\nexport interface SolidShape extends Shape {\n kind: 'solid'\n}\n\n/** A structural compound grouping a list of child shapes. */\nexport interface CompoundShape {\n kind: 'compound'\n children: Shape[]\n}\n\n/**\n * 1D 曲线 Shape(wire / helix / edge-loop 等无三角载荷的 1D 几何)。\n *\n * `kind: 'curve'` 表达「无三角载荷」,与 `'solid'` 对称(见 `curve()` /\n * `fromBrepCurve()`)。执行链路照走 `solidToShape`(wire → 空 0/0 载荷,不抛),\n * 显示经 `wireframe`。\n */\nexport interface CurveShape extends Shape {\n kind: 'curve'\n}\n\n/** A shape that the api layer exports as a finished result. */\nexport type StdShape = SolidShape | CompoundShape | CurveShape\n\n/**\n * 实体 Shape 构造器:mesh 产物必须经此创建。\n *\n * @param mesh - the mesh shape to wrap as a solid.\n * @returns the created solid shape.\n */\nexport function solid(mesh: Shape): SolidShape {\n const s: SolidShape = { ...mesh, kind: 'solid' }\n getRuntimeState().created.add(s)\n return s\n}\n\n/**\n * 1D 曲线 Shape 构造器(wire / helix / edge-loop 等 1D 产物)。\n *\n * 与 `solid` 对称:登记到 identity 表(供 `isShape` 识别),`kind` 设为 `'curve'`\n * 以表达「无三角载荷的 1D 几何」(执行链路照走 `solidToShape`,显示经 `wireframe`)。\n *\n * @param mesh - the mesh payload (positions/indices) to wrap as a curve.\n * @returns the created curve shape.\n */\nexport function curve(mesh: Shape): CurveShape {\n const s: CurveShape = { ...mesh, kind: 'curve' }\n getRuntimeState().created.add(s)\n return s\n}\n\n/**\n * BREP 产物构造器:同时登记 mesh 与 OCCT 句柄(+ 可选面演化)。\n *\n * 库函数用它替代 `solid(mesh)` + 手动登记句柄两步行:\n * ```ts\n * return fromBrep(solidToShape(kernel, resultSolid), {\n * solid: resultSolid,\n * faceEvolution: identityEvolution(kernel, resultSolid),\n * })\n * ```\n *\n * @param mesh - the mesh shape to register.\n * @param holder - the BREP holder providing the OCCT handle and optional face evolution.\n * @returns the created solid shape with the BREP handle attached.\n */\nexport function fromBrep(mesh: Shape, holder: BrepHolder): SolidShape {\n const s = solid(mesh)\n attachBrep(s, holder)\n return s\n}\n\n/**\n * 1D 曲线产物的 BREP 登记构造器:与 `fromBrep` 对称,但 `kind` 取 `'curve'`\n * (维持既有「有无三角载荷」语义——1D 几何无三角载荷,不得报 `'solid'`)。\n * 登记逻辑与 `fromBrep` 共用 `attachBrep`,保证两种形态走同一份身份/血缘/释放语义。\n *\n * @param mesh - the mesh payload (positions/indices) to wrap as a curve.\n * @param holder - the BREP holder providing the OCCT handle and optional face evolution.\n * @returns the created curve shape with the BREP handle attached.\n */\nexport function fromBrepCurve(mesh: Shape, holder: BrepHolder): CurveShape {\n const s = curve(mesh)\n attachBrep(s, holder)\n return s\n}\n\n/**\n * 网格实体产物的构造器:与 `fromBrep` 对称,登记网格实体句柄(近似链)而非\n * BREP 句柄(精度链)。\n *\n * ```ts\n * return fromMeshSolid(displayMesh, { meshSolid: result.solid })\n * ```\n *\n * 与 `fromBrep` 的三点差别(方案 §3.2):\n * 1. 写 `slot.meshSolid`,**不写** `slot.solid`——网格零件永不进 BREP 链;\n * 2. 不登记函数 BREP 域(`registerFunctionBrep`)——句柄所有权在\n * `MeshSolidRegistry`,按 BREP 内核释放是错的(可能是另一个内核);\n * 3. 不旁挂 roleTable(近似拓扑不给语义 role——role 是 BREP 真拓扑的专有能力)。\n *\n * @param mesh - the mesh shape to wrap as a solid (display mesh).\n * @param holder - the mesh-solid holder providing the handle identity.\n * @returns the created solid shape carrying the mesh-solid slot.\n */\nexport function fromMeshSolid(mesh: Shape, holder: MeshSolidHolder): SolidShape {\n const s = solid(mesh)\n attachMeshSolid(s, holder.meshSolid)\n return s\n}\n\n/** 网格实体句柄容器(与 `BrepHolder` 对称;类型为 unknown 以保持零依赖)。 */\nexport interface MeshSolidHolder {\n /** 网格实体句柄的**身份**(句柄本体在 `MeshSolidRegistry`)。 */\n meshSolid: unknown\n}\n\n/**\n * 网格链**面**产物的构造器(方案 2026-10-01 §4 Phase 3)。与 `fromBrep` 的\n * 面产物对称:BREP 侧 `sketchOnFace` 返回 `fromBrep(solidToShape(kernel, face),\n * { solid: face })`,这里返回 `fromMeshFace(meshShape(face), { meshFace: face })`。\n *\n * `kind` 沿用 `'solid'`(不是 `'shape2d'`):与 BREP 侧的面 Shape 保持同一形态,\n * 好让 `extrude` 的 `isCurveShape` 预检在两条链上行为一致——面不是 1D 曲线,\n * 不该被面消费 op 当成曲线拒掉。\n *\n * @param mesh - the face's display mesh (its own tessellation).\n * @param holder - the mesh-face holder providing the handle identity.\n * @returns the created shape carrying the mesh-face slot.\n */\nexport function fromMeshFace(mesh: Shape, holder: MeshFaceHolder): SolidShape {\n const s = solid(mesh)\n attachMeshFace(s, holder.meshFace)\n return s\n}\n\n/** 网格链面句柄容器(与 `MeshSolidHolder` 对称;类型为 unknown 以保持零依赖)。 */\nexport interface MeshFaceHolder {\n /** 网格链面句柄的**身份**。 */\n meshFace: unknown\n}\n\n/**\n * 把网格实体句柄登记到已构造的 Shape。\n *\n * 互斥红线:该 Shape 已有 BREP 句柄或网格链面句柄时**直接抛错**——一个 Shape\n * 同时声称两种链身份是设计缺陷,不能静默覆盖任何一侧。\n *\n * @param s - the already-constructed shape.\n * @param meshSolid - the mesh solid handle.\n * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.\n */\nexport function attachMeshSolid(s: Shape, meshSolid: unknown): void {\n const state = getRuntimeState()\n const slot = state.slots.get(s) ?? {}\n if (slot.solid !== undefined) {\n throw new Error(\n 'E_SHAPE_SLOT_EXCLUSIVE: shape already carries a BREP handle — a shape is either on the precision chain or the mesh chain, never both',\n )\n }\n if (slot.meshFace !== undefined) {\n throw new Error(\n 'E_SHAPE_SLOT_EXCLUSIVE: shape already carries a mesh-chain face handle — a shape is either a mesh solid or a mesh-chain face, never both',\n )\n }\n slot.meshSolid = meshSolid\n state.slots.set(s, slot)\n}\n\n/**\n * 把网格链**面**句柄登记到已构造的 Shape。\n *\n * 与 `attachMeshSolid` 同一条互斥红线:已有任意另一种链身份即抛错。\n *\n * @param s - the already-constructed shape.\n * @param meshFace - the mesh-chain face handle.\n * @throws {Error} `E_SHAPE_SLOT_EXCLUSIVE` when the shape already carries another chain identity.\n */\nexport function attachMeshFace(s: Shape, meshFace: unknown): void {\n const state = getRuntimeState()\n const slot = state.slots.get(s) ?? {}\n if (slot.solid !== undefined || slot.meshSolid !== undefined) {\n throw new Error(\n 'E_SHAPE_SLOT_EXCLUSIVE: shape already carries a BREP or mesh-solid handle — a mesh-chain face is its own identity',\n )\n }\n slot.meshFace = meshFace\n state.slots.set(s, slot)\n}\n\n/**\n * 该 Shape 是否携带网格链面(`sketchOnFace` 在近似拓扑面上的产物)。\n *\n * @param shape - the shape to test.\n * @returns true if the shape carries a mesh-chain face handle.\n */\nexport function hasMeshFace(shape: Shape): boolean {\n return getRuntimeState().slots.get(shape)?.meshFace !== undefined\n}\n\n/**\n * 读取该 Shape 的网格链面句柄(无则 undefined)。\n *\n * @param shape - the shape whose mesh-chain face handle to read.\n * @returns the mesh-chain face handle, or undefined if none.\n */\nexport function meshFaceOf(shape: Shape): unknown | undefined {\n return getRuntimeState().slots.get(shape)?.meshFace\n}\n\n/**\n * 该 Shape 是否携带网格实体(网格零件)。引擎分派与 UI 查询用。\n *\n * 与 `hasBrep` 互斥:正常路径下二者不可能同时为真(`attachMeshSolid` 已经把\n * 互斥钉在写入侧,`assertShapeSlotExclusive` 在分派前再兜一层)。\n *\n * @param shape - the shape to test.\n * @returns true if the shape carries a mesh solid handle.\n */\nexport function hasMeshSolid(shape: Shape): boolean {\n return getRuntimeState().slots.get(shape)?.meshSolid !== undefined\n}\n\n/**\n * 读取该 Shape 的网格实体句柄(无则 undefined)。\n *\n * @param shape - the shape whose mesh solid handle to read.\n * @returns the mesh solid handle, or undefined if none.\n */\nexport function meshSolidOf(shape: Shape): unknown | undefined {\n return getRuntimeState().slots.get(shape)?.meshSolid\n}\n\n/**\n * 把 BREP 句柄登记到已构造的 Shape(由 `solid` / `curve` 产出)。\n *\n * 集中 brep 登记的四步(identity 槽登记已由构造器完成;此处只补:① 身份槽挂载\n * 句柄 / ② 血缘图语句键旁挂 roleTable / ③ 函数 BREP 域登记)。供 `fromBrep` /\n * `fromBrepCurve` 共用——禁止绕开本函数手写登记(否则等于复制一整套身份、血缘与\n * 释放语义)。\n *\n * @param s - the already-constructed shape (solid or curve).\n * @param holder - the BREP holder to attach.\n */\nfunction attachBrep(s: Shape, holder: BrepHolder): void {\n const state = getRuntimeState()\n const slot = state.slots.get(s) ?? {}\n if (slot.meshSolid !== undefined || slot.meshFace !== undefined) {\n // 互斥红线的另一侧:网格链产物不得再被登记成 BREP 实体(一个 Shape 只能\n // 在精度链或网格链之一上)。\n throw new Error(\n 'E_SHAPE_SLOT_EXCLUSIVE: shape already carries a mesh-chain handle — a shape is either on the precision chain or the mesh chain, never both',\n )\n }\n slot.solid = holder.solid\n if (holder.faceEvolution) slot.faceEvolution = holder.faceEvolution\n // 1.10 前置③:roleTable **不再写 slot**(字段已删)——权威落点是下方血缘图\n // 旁挂(语句键 + part 键),解析缓存 miss 由回走重算恢复。\n state.slots.set(s, slot)\n // 1.10 前置③:roleTable 权威旁挂(**语句键**)在血缘图。part 键的记录在\n // define-op.wrapped(impl 返回后 anchor.outputs 名字已定)——此处 shape 还未\n // 被 executor 命名,nameOf(s) 为 undefined,不能在这里记 part 键。\n const stmt = getCurrentStmt()\n if (stmt && (holder.roleTable || holder.solid !== undefined)) {\n runtimeLineage.recordOutput(\n asStmtId(stmt.id),\n holder.roleTable as ReadonlyMap<string, ReadonlyMap<string, readonly number[]>> | undefined,\n holder.solid,\n )\n }\n // 函数 BREP 域(§5.6):函数体内 op 产生的新句柄登记到当前域,函数返回后统一释放\n registerFunctionBrep(holder.solid)\n}\n\n/** BREP 句柄 + 面演化 + 拓扑命名 RoleTable(对应 OCCT 的 ShapeHandle)。类型为 unknown 以保持零依赖。 */\nexport interface BrepHolder {\n solid: unknown\n faceEvolution?: Map<number, number[]>\n /**\n * 1.10 前置③:产形 op 交付 role 表的唯一入口。fromBrep 把它**旁挂到血缘图**\n * (语句键 + part 键);slot 侧的缓存存储已删(ShapeSlot 不再有该字段)。\n */\n roleTable?: unknown\n}\n\n/**\n * compound Shape 构造器:结构(层级)而非新几何。\n *\n * @param children - the child shapes to group.\n * @returns the created compound shape.\n */\nexport function compound(children: Shape[]): CompoundShape {\n const c: CompoundShape = { kind: 'compound', children }\n getRuntimeState().created.add(c)\n return c\n}\n\n/**\n * 是否为构造器产物(终端判定与 compound 检测的依据)。\n *\n * @param v - the value to test.\n * @returns true if the value was created by a shape constructor.\n */\nexport function isShape(v: unknown): v is Shape {\n return !!v && typeof v === 'object' && getRuntimeState().created.has(v)\n}\n\n/**\n * Returns true if the value is a strict compound shape created by a constructor.\n *\n * @param v - the value to test.\n * @returns true if the value is a strict compound shape.\n */\nexport function isCompound(v: unknown): v is CompoundShape {\n return isShape(v) && (v as { kind?: string }).kind === 'compound'\n}\n\n/**\n * 结构判定:是否为 compound 形态(keep-syntax §5.3 D5,对任意库函数零要求)。\n * 引擎内部的终端/消费判定用结构判定;SDK 公开的 isShape/isCompound 保持 WeakSet 严格。\n *\n * @param v - the value to test.\n * @returns true if the value has compound shape structure.\n */\nexport function isCompoundLike(v: unknown): v is CompoundShape {\n return !!v && typeof v === 'object'\n && (v as { kind?: string }).kind === 'compound'\n && Array.isArray((v as { children?: unknown }).children)\n}\n\n/**\n * 1D 曲线判定(1D 判别位,Phase 3):`kind === 'curve'`。\n *\n * 面消费 op(extrude / revolve / sweep 等)用它做**执行前**输入维度预检——\n * 1D 产物(wire / helix / sketch as:'wire')喂给面 op 时必须是明确的预检失败,\n * 不得落进内核深层才报「操作失败」。与 SDK 的 WeakSet 严格 `isShape` 不同,\n * 本判定是结构判定(与 `isCompoundLike` 同族),对跨库产物零要求。\n *\n * @param v - the value to test.\n * @returns true when the value is a 1D curve shape.\n */\nexport function isCurveShape(v: unknown): v is CurveShape {\n return !!v && typeof v === 'object' && (v as { kind?: string }).kind === 'curve'\n}\n\n// ── 身份槽 ──\n\nexport type { ShapeSlot }\n\n/**\n * 读取 Shape 的身份槽(无则 undefined)。\n *\n * @param shape - the shape whose slot to read.\n * @returns the identity slot, or undefined if none is registered.\n */\nexport function getSlot(shape: object): ShapeSlot | undefined {\n return getRuntimeState().slots.get(shape)\n}\n\n/**\n * 读取或创建 Shape 的身份槽。\n *\n * @param shape - the shape whose slot to read or create.\n * @returns the shape's identity slot.\n */\nexport function ensureSlot(shape: object): ShapeSlot {\n const state = getRuntimeState()\n let slot = state.slots.get(shape)\n if (!slot) {\n slot = {}\n state.slots.set(shape, slot)\n }\n return slot\n}\n\n/**\n * 读输入 Shape 的 roleTable(op 实现读**输入**表的唯一读口,1.10 前置③)。\n *\n * 语义 = 旧 `getSlot(shape)?.roleTable`:权威落点在血缘图的 part 键旁挂\n * (上一条语句 fromBrep 时记录),slot 缓存字段已删除。未记录 → undefined\n * (mesh 产物 / 无命名)。\n *\n * @param shape - the input shape whose role table to read.\n * @returns the role table (unknown — callers assert their table type), or undefined.\n */\nexport function inputRoleTable(shape: object): unknown | undefined {\n const name = nameOf(shape)\n return name ? runtimeLineage.tableOfPart(name) : undefined\n}\n\n/**\n * 该 Shape 是否在 BREP 链上(有 OCCT 句柄)。引擎分派与 UI 查询用。\n *\n * @param shape - the shape to test.\n * @returns true if the shape has an attached OCCT handle.\n */\nexport function hasBrep(shape: Shape): boolean {\n return getRuntimeState().slots.get(shape)?.solid !== undefined\n}\n\n/**\n * 读取该 Shape 的 OCCT 句柄(无则 undefined)。库函数用前必须判空。\n *\n * @param shape - the shape whose handle to read.\n * @returns the OCCT handle, or undefined if none.\n */\nexport function brepOf(shape: Shape): unknown | undefined {\n return getRuntimeState().slots.get(shape)?.solid\n}\n\n/**\n * nameOf 批量版:Shape[] → 成员名(装配 memberNames,P6 替代读 IR)。\n *\n * @param shapes - the shapes to name.\n * @returns the member names, one per shape (empty string when unnamed).\n */\nexport function nameOfShapes(shapes: Shape[]): string[] {\n return shapes.map((s) => String(nameOf(s) ?? ''))\n}\n"]}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * tolerance.ts — dimensioned threshold / tolerance constants (D6).
3
+ *
4
+ * These are the magnitude thresholds that were previously bare magic numbers
5
+ * with an implicit "mm" assumption. Each is defined once with an explicit unit,
6
+ * then consumed via `.as(mm)` where a bare float must cross into a numeric
7
+ * kernel (manifold-3d / occt-wasm). This keeps the mm basis readable without
8
+ * hiding it in the runtime value.
9
+ *
10
+ * Not all §2.2 thresholds collapse into one constant — they are not one kind of
11
+ * thing:
12
+ * - `CENTROID_DIST_SQ_MAX_MM2` is a SQUARED magnitude (mm²), so it stays a bare
13
+ * number with the unit spelled out in its name (D6 hard constraint 1).
14
+ * - `angularDeflection`'s default 0.5 is in radians and is intentionally NOT
15
+ * part of the length tolerance family (D6 hard constraint 2).
16
+ */
17
+ import { type ValueWithUnits } from './units.js';
18
+ /** Zero-length gate: a length at or below this is treated as zero. Independent of OCCT's tolerance. */
19
+ export declare const ZERO_LENGTH: ValueWithUnits;
20
+ /** Mesh → STEP sewing tolerance (occtKernel.ts `meshesToStep`). */
21
+ export declare const SEWING_TOLERANCE: ValueWithUnits;
22
+ /** Default chord-error (linear deflection) for tessellation (multiple op sites). */
23
+ export declare const DEFAULT_LINEAR_DEFLECTION: ValueWithUnits;
24
+ /** Fallback bounding box half-extent when a shape has no real bounds (topologyExt). */
25
+ export declare const OCTREE_BBOX_FALLBACK: ValueWithUnits;
26
+ /**
27
+ * Centroid-distance² upper bound used by topology naming (mm²). This is a
28
+ * SQUARED magnitude — it must stay a bare number; writing `(10*mm)^2` would
29
+ * drop the dimension and fail for non-length dimensions (D6 hard constraint 1).
30
+ */
31
+ export declare const CENTROID_DIST_SQ_MAX_MM2 = 100;
32
+ /**
33
+ * Convenience: extract a tolerance's base-unit float (mm) for numeric kernels.
34
+ * @param v - a dimensioned tolerance value.
35
+ * @returns the magnitude in mm (base-unit float).
36
+ */
37
+ export declare function asMm(v: ValueWithUnits): number;
38
+ //# sourceMappingURL=tolerance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tolerance.d.ts","sourceRoot":"","sources":["../src/tolerance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAM,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAEjD,uGAAuG;AACvG,eAAO,MAAM,WAAW,EAAE,cAA+B,CAAA;AAEzD,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,EAAE,cAA6B,CAAA;AAE5D,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,EAAE,cAA4B,CAAA;AAEpE,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,EAAE,cAA4B,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAE9C"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * tolerance.ts — dimensioned threshold / tolerance constants (D6).
3
+ *
4
+ * These are the magnitude thresholds that were previously bare magic numbers
5
+ * with an implicit "mm" assumption. Each is defined once with an explicit unit,
6
+ * then consumed via `.as(mm)` where a bare float must cross into a numeric
7
+ * kernel (manifold-3d / occt-wasm). This keeps the mm basis readable without
8
+ * hiding it in the runtime value.
9
+ *
10
+ * Not all §2.2 thresholds collapse into one constant — they are not one kind of
11
+ * thing:
12
+ * - `CENTROID_DIST_SQ_MAX_MM2` is a SQUARED magnitude (mm²), so it stays a bare
13
+ * number with the unit spelled out in its name (D6 hard constraint 1).
14
+ * - `angularDeflection`'s default 0.5 is in radians and is intentionally NOT
15
+ * part of the length tolerance family (D6 hard constraint 2).
16
+ */
17
+ import { mm } from './units.js';
18
+ /** Zero-length gate: a length at or below this is treated as zero. Independent of OCCT's tolerance. */
19
+ export const ZERO_LENGTH = mm.mul(0.1e-9);
20
+ /** Mesh → STEP sewing tolerance (occtKernel.ts `meshesToStep`). */
21
+ export const SEWING_TOLERANCE = mm.mul(0.01);
22
+ /** Default chord-error (linear deflection) for tessellation (multiple op sites). */
23
+ export const DEFAULT_LINEAR_DEFLECTION = mm.mul(0.1);
24
+ /** Fallback bounding box half-extent when a shape has no real bounds (topologyExt). */
25
+ export const OCTREE_BBOX_FALLBACK = mm.mul(100);
26
+ /**
27
+ * Centroid-distance² upper bound used by topology naming (mm²). This is a
28
+ * SQUARED magnitude — it must stay a bare number; writing `(10*mm)^2` would
29
+ * drop the dimension and fail for non-length dimensions (D6 hard constraint 1).
30
+ */
31
+ export const CENTROID_DIST_SQ_MAX_MM2 = 100;
32
+ /**
33
+ * Convenience: extract a tolerance's base-unit float (mm) for numeric kernels.
34
+ * @param v - a dimensioned tolerance value.
35
+ * @returns the magnitude in mm (base-unit float).
36
+ */
37
+ export function asMm(v) {
38
+ return v.as(mm);
39
+ }
40
+ //# sourceMappingURL=tolerance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tolerance.js","sourceRoot":"","sources":["../src/tolerance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,EAAE,EAAuB,MAAM,SAAS,CAAA;AAEjD,uGAAuG;AACvG,MAAM,CAAC,MAAM,WAAW,GAAmB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAEzD,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAmB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAE5D,oFAAoF;AACpF,MAAM,CAAC,MAAM,yBAAyB,GAAmB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEpE,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAmB,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AAE3C;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,CAAiB;IACpC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;AACjB,CAAC","sourcesContent":["/**\n * tolerance.ts — dimensioned threshold / tolerance constants (D6).\n *\n * These are the magnitude thresholds that were previously bare magic numbers\n * with an implicit \"mm\" assumption. Each is defined once with an explicit unit,\n * then consumed via `.as(mm)` where a bare float must cross into a numeric\n * kernel (manifold-3d / occt-wasm). This keeps the mm basis readable without\n * hiding it in the runtime value.\n *\n * Not all §2.2 thresholds collapse into one constant — they are not one kind of\n * thing:\n * - `CENTROID_DIST_SQ_MAX_MM2` is a SQUARED magnitude (mm²), so it stays a bare\n * number with the unit spelled out in its name (D6 hard constraint 1).\n * - `angularDeflection`'s default 0.5 is in radians and is intentionally NOT\n * part of the length tolerance family (D6 hard constraint 2).\n */\nimport { mm, type ValueWithUnits } from './units'\n\n/** Zero-length gate: a length at or below this is treated as zero. Independent of OCCT's tolerance. */\nexport const ZERO_LENGTH: ValueWithUnits = mm.mul(0.1e-9)\n\n/** Mesh → STEP sewing tolerance (occtKernel.ts `meshesToStep`). */\nexport const SEWING_TOLERANCE: ValueWithUnits = mm.mul(0.01)\n\n/** Default chord-error (linear deflection) for tessellation (multiple op sites). */\nexport const DEFAULT_LINEAR_DEFLECTION: ValueWithUnits = mm.mul(0.1)\n\n/** Fallback bounding box half-extent when a shape has no real bounds (topologyExt). */\nexport const OCTREE_BBOX_FALLBACK: ValueWithUnits = mm.mul(100)\n\n/**\n * Centroid-distance² upper bound used by topology naming (mm²). This is a\n * SQUARED magnitude — it must stay a bare number; writing `(10*mm)^2` would\n * drop the dimension and fail for non-length dimensions (D6 hard constraint 1).\n */\nexport const CENTROID_DIST_SQ_MAX_MM2 = 100\n\n/**\n * Convenience: extract a tolerance's base-unit float (mm) for numeric kernels.\n * @param v - a dimensioned tolerance value.\n * @returns the magnitude in mm (base-unit float).\n */\nexport function asMm(v: ValueWithUnits): number {\n return v.as(mm)\n}"]}
@@ -302,6 +302,12 @@ export declare class LineageGraph {
302
302
  nodeConsuming(part: PartName): LineageNode | undefined;
303
303
  /** 已登记的语句数。 */
304
304
  get size(): number;
305
+ /**
306
+ * 全部已登记语句 id(回走恢复需遍历候选 origin 时用)。
307
+ *
308
+ * @returns the registered statement ids.
309
+ */
310
+ stmtIds(): StmtId[];
305
311
  /** 清空(每次执行开始时调用——一次执行内 `StmtId` 稳定)。 */
306
312
  clear(): void;
307
313
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/topology/naming/lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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AW,GAAG,SAAS;IAI3C;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;IAI1C;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS;IAKnD;;;;;;;;OAQG;IACH,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS;IAOtD,eAAe;IACf,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,OAAO,IAAI,MAAM,EAAE;IAInB,wCAAwC;IACxC,KAAK,IAAI,IAAI;IAQb;;;;;;;;;;OAUG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI;IAM3I;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS;IAIpG;;;;OAIG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIjD;;;;;;;;;OASG;IACH,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS;CAGrG;AAkBD;;;;GAIG;AACH,eAAO,MAAM,cAAc,cAAqB,CAAA"}
@@ -319,6 +319,14 @@ export class LineageGraph {
319
319
  get size() {
320
320
  return this.nodes.size;
321
321
  }
322
+ /**
323
+ * 全部已登记语句 id(回走恢复需遍历候选 origin 时用)。
324
+ *
325
+ * @returns the registered statement ids.
326
+ */
327
+ stmtIds() {
328
+ return [...this.nodes.keys()];
329
+ }
322
330
  /** 清空(每次执行开始时调用——一次执行内 `StmtId` 稳定)。 */
323
331
  clear() {
324
332
  this.nodes.clear();