@faicad/faijs 0.22.2 → 0.29.5

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 (488) 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/appearance.d.ts +138 -0
  7. package/dist/api/appearance.d.ts.map +1 -0
  8. package/dist/api/appearance.js +230 -0
  9. package/dist/api/appearance.js.map +1 -0
  10. package/dist/api/assert.d.ts +2 -2
  11. package/dist/api/assert.js +8 -8
  12. package/dist/api/assert.js.map +1 -1
  13. package/dist/api/asset.d.ts +1 -1
  14. package/dist/api/asset.js +2 -2
  15. package/dist/api/asset.js.map +1 -1
  16. package/dist/api/boolean.d.ts +1 -1
  17. package/dist/api/boolean.d.ts.map +1 -1
  18. package/dist/api/boolean.js +128 -16
  19. package/dist/api/boolean.js.map +1 -1
  20. package/dist/api/cadquery-selectors/borrow-bridge.d.ts +14 -0
  21. package/dist/api/cadquery-selectors/borrow-bridge.d.ts.map +1 -0
  22. package/dist/api/cadquery-selectors/borrow-bridge.js +52 -0
  23. package/dist/api/cadquery-selectors/borrow-bridge.js.map +1 -0
  24. package/dist/api/cadquery-selectors/edge.d.ts +40 -0
  25. package/dist/api/cadquery-selectors/edge.d.ts.map +1 -0
  26. package/dist/api/cadquery-selectors/edge.js +70 -0
  27. package/dist/api/cadquery-selectors/edge.js.map +1 -0
  28. package/dist/api/cadquery-selectors/entity.d.ts +121 -0
  29. package/dist/api/cadquery-selectors/entity.d.ts.map +1 -0
  30. package/dist/api/cadquery-selectors/entity.js +167 -0
  31. package/dist/api/cadquery-selectors/entity.js.map +1 -0
  32. package/dist/api/cadquery-selectors/face.d.ts +33 -0
  33. package/dist/api/cadquery-selectors/face.d.ts.map +1 -0
  34. package/dist/api/cadquery-selectors/face.js +353 -0
  35. package/dist/api/cadquery-selectors/face.js.map +1 -0
  36. package/dist/api/cadquery-selectors/grammar.d.ts +50 -0
  37. package/dist/api/cadquery-selectors/grammar.d.ts.map +1 -0
  38. package/dist/api/cadquery-selectors/grammar.js +345 -0
  39. package/dist/api/cadquery-selectors/grammar.js.map +1 -0
  40. package/dist/api/cadquery-selectors/index.d.ts +18 -0
  41. package/dist/api/cadquery-selectors/index.d.ts.map +1 -0
  42. package/dist/api/cadquery-selectors/index.js +17 -0
  43. package/dist/api/cadquery-selectors/index.js.map +1 -0
  44. package/dist/api/cadquery-selectors/predicates.d.ts +76 -0
  45. package/dist/api/cadquery-selectors/predicates.d.ts.map +1 -0
  46. package/dist/api/cadquery-selectors/predicates.js +85 -0
  47. package/dist/api/cadquery-selectors/predicates.js.map +1 -0
  48. package/dist/api/cadquery-selectors/resolve.d.ts +41 -0
  49. package/dist/api/cadquery-selectors/resolve.d.ts.map +1 -0
  50. package/dist/api/cadquery-selectors/resolve.js +243 -0
  51. package/dist/api/cadquery-selectors/resolve.js.map +1 -0
  52. package/dist/api/cadquery-selectors/types.d.ts +96 -0
  53. package/dist/api/cadquery-selectors/types.d.ts.map +1 -0
  54. package/dist/api/cadquery-selectors/types.js +11 -0
  55. package/dist/api/cadquery-selectors/types.js.map +1 -0
  56. package/dist/api/chamfer.d.ts +13 -5
  57. package/dist/api/chamfer.d.ts.map +1 -1
  58. package/dist/api/chamfer.js +63 -7
  59. package/dist/api/chamfer.js.map +1 -1
  60. package/dist/api/compound-geom.d.ts +1 -1
  61. package/dist/api/compound-geom.js +1 -1
  62. package/dist/api/compound-geom.js.map +1 -1
  63. package/dist/api/draft.d.ts +1 -1
  64. package/dist/api/draft.js +1 -1
  65. package/dist/api/draft.js.map +1 -1
  66. package/dist/api/edge-ref.d.ts +1 -1
  67. package/dist/api/edge-ref.d.ts.map +1 -1
  68. package/dist/api/edge-ref.js +11 -3
  69. package/dist/api/edge-ref.js.map +1 -1
  70. package/dist/api/engrave.d.ts +1 -1
  71. package/dist/api/engrave.js +7 -7
  72. package/dist/api/engrave.js.map +1 -1
  73. package/dist/api/extrude.d.ts +6 -1
  74. package/dist/api/extrude.d.ts.map +1 -1
  75. package/dist/api/extrude.js +59 -5
  76. package/dist/api/extrude.js.map +1 -1
  77. package/dist/api/face-ref.d.ts +1 -1
  78. package/dist/api/face-ref.js +1 -1
  79. package/dist/api/face-ref.js.map +1 -1
  80. package/dist/api/feature-repair.d.ts +1 -1
  81. package/dist/api/feature-repair.js +1 -1
  82. package/dist/api/feature-repair.js.map +1 -1
  83. package/dist/api/fillet-variable.d.ts +1 -1
  84. package/dist/api/fillet-variable.js +1 -1
  85. package/dist/api/fillet-variable.js.map +1 -1
  86. package/dist/api/fillet.d.ts +28 -8
  87. package/dist/api/fillet.d.ts.map +1 -1
  88. package/dist/api/fillet.js +64 -9
  89. package/dist/api/fillet.js.map +1 -1
  90. package/dist/api/geom.d.ts +1 -1
  91. package/dist/api/geom.js +1 -1
  92. package/dist/api/geom.js.map +1 -1
  93. package/dist/api/helix.d.ts +1 -1
  94. package/dist/api/helix.js +1 -1
  95. package/dist/api/helix.js.map +1 -1
  96. package/dist/api/import-brep.d.ts +20 -2
  97. package/dist/api/import-brep.d.ts.map +1 -1
  98. package/dist/api/import-brep.js +28 -3
  99. package/dist/api/import-brep.js.map +1 -1
  100. package/dist/api/import-step.d.ts +17 -2
  101. package/dist/api/import-step.d.ts.map +1 -1
  102. package/dist/api/import-step.js +51 -3
  103. package/dist/api/import-step.js.map +1 -1
  104. package/dist/api/index.d.ts +6 -1
  105. package/dist/api/index.d.ts.map +1 -1
  106. package/dist/api/index.js +7 -2
  107. package/dist/api/index.js.map +1 -1
  108. package/dist/api/internal/compat-op.js +1 -1
  109. package/dist/api/internal/compat-op.js.map +1 -1
  110. package/dist/api/internal/mesh-solid-op.d.ts +236 -0
  111. package/dist/api/internal/mesh-solid-op.d.ts.map +1 -0
  112. package/dist/api/internal/mesh-solid-op.js +352 -0
  113. package/dist/api/internal/mesh-solid-op.js.map +1 -0
  114. package/dist/api/internal/svg-asset-resolver.d.ts +1 -1
  115. package/dist/api/internal/svg-asset-resolver.js +1 -1
  116. package/dist/api/internal/svg-asset-resolver.js.map +1 -1
  117. package/dist/api/knurl.d.ts +1 -1
  118. package/dist/api/knurl.js +2 -2
  119. package/dist/api/knurl.js.map +1 -1
  120. package/dist/api/loft.d.ts +1 -1
  121. package/dist/api/loft.js +1 -1
  122. package/dist/api/loft.js.map +1 -1
  123. package/dist/api/measurement/index.d.ts +9 -5
  124. package/dist/api/measurement/index.d.ts.map +1 -1
  125. package/dist/api/measurement/index.js +47 -20
  126. package/dist/api/measurement/index.js.map +1 -1
  127. package/dist/api/meta.d.ts +93 -0
  128. package/dist/api/meta.d.ts.map +1 -0
  129. package/dist/api/meta.js +99 -0
  130. package/dist/api/meta.js.map +1 -0
  131. package/dist/api/pattern.d.ts +5 -3
  132. package/dist/api/pattern.d.ts.map +1 -1
  133. package/dist/api/pattern.js +32 -4
  134. package/dist/api/pattern.js.map +1 -1
  135. package/dist/api/place.d.ts +1 -1
  136. package/dist/api/place.js +1 -1
  137. package/dist/api/place.js.map +1 -1
  138. package/dist/api/primitives.d.ts +1 -1
  139. package/dist/api/primitives.d.ts.map +1 -1
  140. package/dist/api/primitives.js +119 -4
  141. package/dist/api/primitives.js.map +1 -1
  142. package/dist/api/profile.d.ts +39 -12
  143. package/dist/api/profile.d.ts.map +1 -1
  144. package/dist/api/profile.js +4 -4
  145. package/dist/api/profile.js.map +1 -1
  146. package/dist/api/reconcile.d.ts +1 -1
  147. package/dist/api/reconcile.js +1 -1
  148. package/dist/api/reconcile.js.map +1 -1
  149. package/dist/api/replicate.d.ts.map +1 -1
  150. package/dist/api/replicate.js +122 -1
  151. package/dist/api/replicate.js.map +1 -1
  152. package/dist/api/screw.d.ts +1 -1
  153. package/dist/api/screw.js +3 -3
  154. package/dist/api/screw.js.map +1 -1
  155. package/dist/api/sdf.d.ts +1 -1
  156. package/dist/api/sdf.js +2 -2
  157. package/dist/api/sdf.js.map +1 -1
  158. package/dist/api/section-by-plane.d.ts +1 -1
  159. package/dist/api/section-by-plane.d.ts.map +1 -1
  160. package/dist/api/section-by-plane.js +2 -1
  161. package/dist/api/section-by-plane.js.map +1 -1
  162. package/dist/api/shell.d.ts +11 -4
  163. package/dist/api/shell.d.ts.map +1 -1
  164. package/dist/api/shell.js +53 -7
  165. package/dist/api/shell.js.map +1 -1
  166. package/dist/api/sketch-on-face.d.ts +41 -0
  167. package/dist/api/sketch-on-face.d.ts.map +1 -1
  168. package/dist/api/sketch-on-face.js +100 -1
  169. package/dist/api/sketch-on-face.js.map +1 -1
  170. package/dist/api/sketch-on-plane.d.ts +7 -5
  171. package/dist/api/sketch-on-plane.d.ts.map +1 -1
  172. package/dist/api/sketch-on-plane.js +6 -7
  173. package/dist/api/sketch-on-plane.js.map +1 -1
  174. package/dist/api/split-by-plane.d.ts +1 -1
  175. package/dist/api/split-by-plane.d.ts.map +1 -1
  176. package/dist/api/split-by-plane.js +2 -1
  177. package/dist/api/split-by-plane.js.map +1 -1
  178. package/dist/api/split.d.ts +1 -1
  179. package/dist/api/split.js +2 -2
  180. package/dist/api/split.js.map +1 -1
  181. package/dist/api/sweep.d.ts +1 -1
  182. package/dist/api/sweep.js +1 -1
  183. package/dist/api/sweep.js.map +1 -1
  184. package/dist/api/thicken.d.ts +1 -1
  185. package/dist/api/thicken.js +1 -1
  186. package/dist/api/thicken.js.map +1 -1
  187. package/dist/api/topo-resolve.d.ts +74 -1
  188. package/dist/api/topo-resolve.d.ts.map +1 -1
  189. package/dist/api/topo-resolve.js +180 -2
  190. package/dist/api/topo-resolve.js.map +1 -1
  191. package/dist/api/transform.d.ts +5 -1
  192. package/dist/api/transform.d.ts.map +1 -1
  193. package/dist/api/transform.js +62 -11
  194. package/dist/api/transform.js.map +1 -1
  195. package/dist/api/wire.d.ts +1 -1
  196. package/dist/api/wire.js +1 -1
  197. package/dist/api/wire.js.map +1 -1
  198. package/dist/brep/brep-ops.d.ts +9 -7
  199. package/dist/brep/brep-ops.d.ts.map +1 -1
  200. package/dist/brep/brep-ops.js +50 -26
  201. package/dist/brep/brep-ops.js.map +1 -1
  202. package/dist/brep/brep-topology.d.ts +5 -4
  203. package/dist/brep/brep-topology.d.ts.map +1 -1
  204. package/dist/brep/brep-topology.js +6 -5
  205. package/dist/brep/brep-topology.js.map +1 -1
  206. package/dist/brep/effective-deflection.d.ts +35 -0
  207. package/dist/brep/effective-deflection.d.ts.map +1 -0
  208. package/dist/brep/effective-deflection.js +49 -0
  209. package/dist/brep/effective-deflection.js.map +1 -0
  210. package/dist/brep/engine/adapters/brep-mock.d.ts.map +1 -1
  211. package/dist/brep/engine/adapters/brep-mock.js +27 -0
  212. package/dist/brep/engine/adapters/brep-mock.js.map +1 -1
  213. package/dist/brep/engine/adapters/brepkit.d.ts +18 -0
  214. package/dist/brep/engine/adapters/brepkit.d.ts.map +1 -1
  215. package/dist/brep/engine/adapters/brepkit.js +46 -1
  216. package/dist/brep/engine/adapters/brepkit.js.map +1 -1
  217. package/dist/brep/engine/adapters/occt.d.ts +1 -1
  218. package/dist/brep/engine/adapters/occt.d.ts.map +1 -1
  219. package/dist/brep/engine/adapters/occt.js +4 -2
  220. package/dist/brep/engine/adapters/occt.js.map +1 -1
  221. package/dist/brep/engine/primitives.d.ts +29 -7
  222. package/dist/brep/engine/primitives.d.ts.map +1 -1
  223. package/dist/brep/engine/primitives.js.map +1 -1
  224. package/dist/brep/engine/registry.d.ts +24 -1
  225. package/dist/brep/engine/registry.d.ts.map +1 -1
  226. package/dist/brep/engine/registry.js +24 -0
  227. package/dist/brep/engine/registry.js.map +1 -1
  228. package/dist/brep/engine/types.d.ts +54 -3
  229. package/dist/brep/engine/types.d.ts.map +1 -1
  230. package/dist/brep/engine/types.js +10 -0
  231. package/dist/brep/engine/types.js.map +1 -1
  232. package/dist/brep/export/export-model.d.ts +40 -0
  233. package/dist/brep/export/export-model.d.ts.map +1 -1
  234. package/dist/brep/export/export-model.js +274 -30
  235. package/dist/brep/export/export-model.js.map +1 -1
  236. package/dist/brep/export/step-meta-header.d.ts +102 -0
  237. package/dist/brep/export/step-meta-header.d.ts.map +1 -0
  238. package/dist/brep/export/step-meta-header.js +225 -0
  239. package/dist/brep/export/step-meta-header.js.map +1 -0
  240. package/dist/brep/export/step.d.ts +5 -1
  241. package/dist/brep/export/step.d.ts.map +1 -1
  242. package/dist/brep/export/step.js +11 -2
  243. package/dist/brep/export/step.js.map +1 -1
  244. package/dist/brep/face-evolution.d.ts +1 -1
  245. package/dist/brep/face-evolution.d.ts.map +1 -1
  246. package/dist/brep/face-evolution.js +20 -1
  247. package/dist/brep/face-evolution.js.map +1 -1
  248. package/dist/brep/handle-bridge.d.ts +1 -1
  249. package/dist/brep/handle-bridge.js +1 -1
  250. package/dist/brep/handle-bridge.js.map +1 -1
  251. package/dist/brep/mesh-solid.d.ts +218 -0
  252. package/dist/brep/mesh-solid.d.ts.map +1 -0
  253. package/dist/brep/mesh-solid.js +229 -0
  254. package/dist/brep/mesh-solid.js.map +1 -0
  255. package/dist/brep/text/fontRegistry.d.ts +32 -1
  256. package/dist/brep/text/fontRegistry.d.ts.map +1 -1
  257. package/dist/brep/text/fontRegistry.js +51 -1
  258. package/dist/brep/text/fontRegistry.js.map +1 -1
  259. package/dist/brep/text/text-to-solid.d.ts.map +1 -1
  260. package/dist/brep/text/text-to-solid.js +8 -3
  261. package/dist/brep/text/text-to-solid.js.map +1 -1
  262. package/dist/brepkit-kernel/brepkitKernel.d.ts +18 -2
  263. package/dist/brepkit-kernel/brepkitKernel.d.ts.map +1 -1
  264. package/dist/brepkit-kernel/brepkitKernel.js +449 -123
  265. package/dist/brepkit-kernel/brepkitKernel.js.map +1 -1
  266. package/dist/brepkit-kernel/brepkitWasm.d.ts +8 -0
  267. package/dist/brepkit-kernel/brepkitWasm.d.ts.map +1 -1
  268. package/dist/brepkit-kernel/brepkitWasm.js +10 -0
  269. package/dist/brepkit-kernel/brepkitWasm.js.map +1 -1
  270. package/dist/browser-host/browser-font-provider.d.ts +12 -0
  271. package/dist/browser-host/browser-font-provider.d.ts.map +1 -1
  272. package/dist/browser-host/browser-font-provider.js +25 -0
  273. package/dist/browser-host/browser-font-provider.js.map +1 -1
  274. package/dist/browser.d.ts +6 -3
  275. package/dist/browser.d.ts.map +1 -1
  276. package/dist/browser.js +10 -3
  277. package/dist/browser.js.map +1 -1
  278. package/dist/cad-runtime/backend-dispatch.d.ts +28 -3
  279. package/dist/cad-runtime/backend-dispatch.d.ts.map +1 -1
  280. package/dist/cad-runtime/backend-dispatch.js +119 -4
  281. package/dist/cad-runtime/backend-dispatch.js.map +1 -1
  282. package/dist/cad-runtime/browser-lib-loader.js.map +1 -1
  283. package/dist/cad-runtime/direct-executor.d.ts +15 -3
  284. package/dist/cad-runtime/direct-executor.d.ts.map +1 -1
  285. package/dist/cad-runtime/direct-executor.js +33 -1
  286. package/dist/cad-runtime/direct-executor.js.map +1 -1
  287. package/dist/cad-runtime/ports.d.ts +3 -3
  288. package/dist/cad-runtime/ports.d.ts.map +1 -1
  289. package/dist/cad-runtime/ports.js.map +1 -1
  290. package/dist/cad-runtime/preview-exec.d.ts +4 -4
  291. package/dist/cad-runtime/preview-exec.js +2 -2
  292. package/dist/cad-runtime/preview-exec.js.map +1 -1
  293. package/dist/cad-runtime/runtime.d.ts +42 -7
  294. package/dist/cad-runtime/runtime.d.ts.map +1 -1
  295. package/dist/cad-runtime/runtime.js +68 -5
  296. package/dist/cad-runtime/runtime.js.map +1 -1
  297. package/dist/define-op.d.ts +15 -1
  298. package/dist/define-op.d.ts.map +1 -1
  299. package/dist/define-op.js +73 -2
  300. package/dist/define-op.js.map +1 -1
  301. package/dist/env-agnostic.d.ts +2 -2
  302. package/dist/env-agnostic.d.ts.map +1 -1
  303. package/dist/env-agnostic.js +1 -1
  304. package/dist/env-agnostic.js.map +1 -1
  305. package/dist/geometry2d/adapt.d.ts +39 -4
  306. package/dist/geometry2d/adapt.d.ts.map +1 -1
  307. package/dist/geometry2d/adapt.js +14 -3
  308. package/dist/geometry2d/adapt.js.map +1 -1
  309. package/dist/geometry2d/blueprint.d.ts +2 -2
  310. package/dist/geometry2d/blueprint.js +2 -2
  311. package/dist/geometry2d/blueprint.js.map +1 -1
  312. package/dist/geometry2d/bridge/lift-on-plane.d.ts +18 -8
  313. package/dist/geometry2d/bridge/lift-on-plane.d.ts.map +1 -1
  314. package/dist/geometry2d/bridge/lift-on-plane.js +65 -12
  315. package/dist/geometry2d/bridge/lift-on-plane.js.map +1 -1
  316. package/dist/geometry2d/bridge/plane.d.ts +17 -0
  317. package/dist/geometry2d/bridge/plane.d.ts.map +1 -1
  318. package/dist/geometry2d/bridge/plane.js +22 -0
  319. package/dist/geometry2d/bridge/plane.js.map +1 -1
  320. package/dist/geometry2d/curve2d.d.ts +25 -0
  321. package/dist/geometry2d/curve2d.d.ts.map +1 -1
  322. package/dist/geometry2d/curve2d.js +41 -5
  323. package/dist/geometry2d/curve2d.js.map +1 -1
  324. package/dist/index.d.ts +6 -2
  325. package/dist/index.d.ts.map +1 -1
  326. package/dist/index.js +10 -3
  327. package/dist/index.js.map +1 -1
  328. package/dist/io/bytes-node.d.ts +11 -0
  329. package/dist/io/bytes-node.d.ts.map +1 -0
  330. package/dist/io/bytes-node.js +28 -0
  331. package/dist/io/bytes-node.js.map +1 -0
  332. package/dist/io/bytes.d.ts +33 -0
  333. package/dist/io/bytes.d.ts.map +1 -0
  334. package/dist/io/bytes.js +41 -0
  335. package/dist/io/bytes.js.map +1 -0
  336. package/dist/io/fai-zip/container-read.d.ts +102 -0
  337. package/dist/io/fai-zip/container-read.d.ts.map +1 -0
  338. package/dist/io/fai-zip/container-read.js +305 -0
  339. package/dist/io/fai-zip/container-read.js.map +1 -0
  340. package/dist/io/fai-zip/container-write.d.ts +70 -0
  341. package/dist/io/fai-zip/container-write.d.ts.map +1 -0
  342. package/dist/io/fai-zip/container-write.js +186 -0
  343. package/dist/io/fai-zip/container-write.js.map +1 -0
  344. package/dist/io/fai-zip/container.d.ts +107 -0
  345. package/dist/io/fai-zip/container.d.ts.map +1 -0
  346. package/dist/io/fai-zip/container.js +89 -0
  347. package/dist/io/fai-zip/container.js.map +1 -0
  348. package/dist/io/fai-zip/index.d.ts +18 -0
  349. package/dist/io/fai-zip/index.d.ts.map +1 -0
  350. package/dist/io/fai-zip/index.js +4 -0
  351. package/dist/io/fai-zip/index.js.map +1 -0
  352. package/dist/io/index.d.ts +10 -0
  353. package/dist/io/index.d.ts.map +1 -0
  354. package/dist/io/index.js +13 -0
  355. package/dist/io/index.js.map +1 -0
  356. package/dist/io/zip.d.ts +68 -0
  357. package/dist/io/zip.d.ts.map +1 -0
  358. package/dist/io/zip.js +147 -0
  359. package/dist/io/zip.js.map +1 -0
  360. package/dist/lang/code-to-args.d.ts +1 -1
  361. package/dist/lang/code-to-args.js +1 -1
  362. package/dist/lang/code-to-args.js.map +1 -1
  363. package/dist/lang/metadata-extractor.d.ts.map +1 -1
  364. package/dist/lang/metadata-extractor.js +2 -21
  365. package/dist/lang/metadata-extractor.js.map +1 -1
  366. package/dist/lang/statement-summary.d.ts +1 -1
  367. package/dist/lang/statement-summary.js +1 -1
  368. package/dist/lang/statement-summary.js.map +1 -1
  369. package/dist/lang/types.d.ts +6 -7
  370. package/dist/lang/types.d.ts.map +1 -1
  371. package/dist/lang/types.js +1 -1
  372. package/dist/lang/types.js.map +1 -1
  373. package/dist/mesh/index.d.ts +2 -1
  374. package/dist/mesh/index.d.ts.map +1 -1
  375. package/dist/mesh/index.js +2 -1
  376. package/dist/mesh/index.js.map +1 -1
  377. package/dist/mesh/io.d.ts +13 -0
  378. package/dist/mesh/io.d.ts.map +1 -1
  379. package/dist/mesh/io.js +38 -17
  380. package/dist/mesh/io.js.map +1 -1
  381. package/dist/mesh/primitives.d.ts.map +1 -1
  382. package/dist/mesh/primitives.js +41 -6
  383. package/dist/mesh/primitives.js.map +1 -1
  384. package/dist/mesh/reconcile.d.ts +1 -1
  385. package/dist/mesh/reconcile.js +1 -1
  386. package/dist/mesh/reconcile.js.map +1 -1
  387. package/dist/mesh/rigid-transform.d.ts +3 -3
  388. package/dist/mesh/rigid-transform.js +3 -3
  389. package/dist/mesh/rigid-transform.js.map +1 -1
  390. package/dist/mesh/stl-unit.d.ts +24 -0
  391. package/dist/mesh/stl-unit.d.ts.map +1 -0
  392. package/dist/mesh/stl-unit.js +17 -0
  393. package/dist/mesh/stl-unit.js.map +1 -0
  394. package/dist/mesh/threemf-bambu.d.ts +142 -0
  395. package/dist/mesh/threemf-bambu.d.ts.map +1 -0
  396. package/dist/mesh/threemf-bambu.js +334 -0
  397. package/dist/mesh/threemf-bambu.js.map +1 -0
  398. package/dist/mesh/threemf-loader.d.ts +65 -7
  399. package/dist/mesh/threemf-loader.d.ts.map +1 -1
  400. package/dist/mesh/threemf-loader.js +738 -99
  401. package/dist/mesh/threemf-loader.js.map +1 -1
  402. package/dist/mesh/threemf-view.d.ts +71 -0
  403. package/dist/mesh/threemf-view.d.ts.map +1 -0
  404. package/dist/mesh/threemf-view.js +100 -0
  405. package/dist/mesh/threemf-view.js.map +1 -0
  406. package/dist/mesh/types.d.ts +38 -0
  407. package/dist/mesh/types.d.ts.map +1 -1
  408. package/dist/mesh/types.js.map +1 -1
  409. package/dist/node-host/cli.d.ts +44 -6
  410. package/dist/node-host/cli.d.ts.map +1 -1
  411. package/dist/node-host/cli.js +76 -26
  412. package/dist/node-host/cli.js.map +1 -1
  413. package/dist/node-host/font-family-index.d.ts +93 -0
  414. package/dist/node-host/font-family-index.d.ts.map +1 -0
  415. package/dist/node-host/font-family-index.js +273 -0
  416. package/dist/node-host/font-family-index.js.map +1 -0
  417. package/dist/node-host/fs-asset-resolver.d.ts +8 -3
  418. package/dist/node-host/fs-asset-resolver.d.ts.map +1 -1
  419. package/dist/node-host/fs-asset-resolver.js +13 -5
  420. package/dist/node-host/fs-asset-resolver.js.map +1 -1
  421. package/dist/node-host/index.d.ts +8 -0
  422. package/dist/node-host/index.d.ts.map +1 -1
  423. package/dist/node-host/index.js +1 -0
  424. package/dist/node-host/index.js.map +1 -1
  425. package/dist/node-host/node-font-provider.d.ts +28 -0
  426. package/dist/node-host/node-font-provider.d.ts.map +1 -1
  427. package/dist/node-host/node-font-provider.js +49 -0
  428. package/dist/node-host/node-font-provider.js.map +1 -1
  429. package/dist/node.d.ts +1 -0
  430. package/dist/node.d.ts.map +1 -1
  431. package/dist/node.js +1 -0
  432. package/dist/node.js.map +1 -1
  433. package/dist/occt-kernel/highLevelApi.d.ts +4 -1
  434. package/dist/occt-kernel/highLevelApi.d.ts.map +1 -1
  435. package/dist/occt-kernel/highLevelApi.js +4 -2
  436. package/dist/occt-kernel/highLevelApi.js.map +1 -1
  437. package/dist/occt-kernel/occt-primitives.d.ts.map +1 -1
  438. package/dist/occt-kernel/occt-primitives.js +36 -3
  439. package/dist/occt-kernel/occt-primitives.js.map +1 -1
  440. package/dist/occt-kernel/occtKernel.d.ts +19 -14
  441. package/dist/occt-kernel/occtKernel.d.ts.map +1 -1
  442. package/dist/occt-kernel/occtKernel.js +19 -32
  443. package/dist/occt-kernel/occtKernel.js.map +1 -1
  444. package/dist/occt-kernel/stepColorParser.d.ts +18 -0
  445. package/dist/occt-kernel/stepColorParser.d.ts.map +1 -1
  446. package/dist/occt-kernel/stepColorParser.js +38 -0
  447. package/dist/occt-kernel/stepColorParser.js.map +1 -1
  448. package/dist/occt-kernel/stepMetaParser.d.ts +44 -0
  449. package/dist/occt-kernel/stepMetaParser.d.ts.map +1 -0
  450. package/dist/occt-kernel/stepMetaParser.js +166 -0
  451. package/dist/occt-kernel/stepMetaParser.js.map +1 -0
  452. package/dist/occt-kernel/topologyExt.d.ts +1 -1
  453. package/dist/occt-kernel/topologyExt.d.ts.map +1 -1
  454. package/dist/occt-kernel/topologyExt.js +4 -5
  455. package/dist/occt-kernel/topologyExt.js.map +1 -1
  456. package/dist/primitives/text/cjk-font.d.ts +2 -15
  457. package/dist/primitives/text/cjk-font.d.ts.map +1 -1
  458. package/dist/primitives/text/cjk-font.js +13 -1
  459. package/dist/primitives/text/cjk-font.js.map +1 -1
  460. package/dist/runtime-state.d.ts +85 -9
  461. package/dist/runtime-state.d.ts.map +1 -1
  462. package/dist/runtime-state.js +72 -2
  463. package/dist/runtime-state.js.map +1 -1
  464. package/dist/sdk.d.ts +3 -3
  465. package/dist/sdk.d.ts.map +1 -1
  466. package/dist/sdk.js +5 -5
  467. package/dist/sdk.js.map +1 -1
  468. package/dist/shape.d.ts +108 -5
  469. package/dist/shape.d.ts.map +1 -1
  470. package/dist/shape.js +130 -3
  471. package/dist/shape.js.map +1 -1
  472. package/dist/step/stepMetaParser.d.ts +55 -0
  473. package/dist/step/stepMetaParser.d.ts.map +1 -0
  474. package/dist/step/stepMetaParser.js +177 -0
  475. package/dist/step/stepMetaParser.js.map +1 -0
  476. package/dist/topology/naming/lineage.d.ts +6 -0
  477. package/dist/topology/naming/lineage.d.ts.map +1 -1
  478. package/dist/topology/naming/lineage.js +8 -0
  479. package/dist/topology/naming/lineage.js.map +1 -1
  480. package/dist/topology/naming/resolve-edge.d.ts +20 -1
  481. package/dist/topology/naming/resolve-edge.d.ts.map +1 -1
  482. package/dist/topology/naming/resolve-edge.js +54 -20
  483. package/dist/topology/naming/resolve-edge.js.map +1 -1
  484. package/dist/weapp.d.ts +6 -2
  485. package/dist/weapp.d.ts.map +1 -1
  486. package/dist/weapp.js +7 -1
  487. package/dist/weapp.js.map +1 -1
  488. package/package.json +19 -3
package/LICENSE CHANGED
@@ -1,28 +1,202 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Faicad contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
23
- ---
24
-
25
- The brepjs-derived sources (compat facade) in `src/api/` retain their
26
- Apache-2.0 attribution, which now lives in the standalone
27
- `@faicad/faijs-brepjs` package (see `@faicad/faijs-brepjs` NOTICE and
28
- LICENSE). Apache-2.0 text: https://www.apache.org/licenses/LICENSE-2.0
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。
6
6
  *
7
- * 归属(monorepo P5/E-a-1):本文件随 stdlib 出包,是 faijs 默认标准库
7
+ * 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数
8
8
  * (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /
9
9
  * runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)
10
10
  * 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,
@@ -18,9 +18,9 @@
18
18
  * 四个 transform op(translate/rotate_euler/scale/scale3d)按 D1 选项 C 留在此处:
19
19
  * `translate` 是通用几何变换,且是小程序端唯一在用的 transform op。
20
20
  */
21
- import type { StdlibNamespace } from '../runtime-state.js';
21
+ import type { LibNamespace } from '../runtime-state.js';
22
22
  /**
23
- * Assemble stdlib functions into the cad namespace.
23
+ * Assemble api functions into the cad namespace.
24
24
  *
25
25
  * P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+
26
26
  * 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec
@@ -28,7 +28,7 @@ import type { StdlibNamespace } from '../runtime-state.js';
28
28
  * brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与
29
29
  * `api/index.ts` 导出面同源于同一份清单。
30
30
  *
31
- * @returns the assembled StdlibNamespace ready for runtime injection.
31
+ * @returns the assembled LibNamespace ready for runtime injection.
32
32
  */
33
- export declare function createApiNamespace(): StdlibNamespace;
33
+ export declare function createApiNamespace(): LibNamespace;
34
34
  //# sourceMappingURL=api-namespace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-namespace.d.ts","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4CH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAmDpD"}
1
+ {"version":3,"file":"api-namespace.d.ts","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4CH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAmDjD"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。
6
6
  *
7
- * 归属(monorepo P5/E-a-1):本文件随 stdlib 出包,是 faijs 默认标准库
7
+ * 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数
8
8
  * (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /
9
9
  * runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)
10
10
  * 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,
@@ -61,7 +61,7 @@ import { scriptFaceOps } from './generated/script-face.js';
61
61
  import { revolve } from './revolve.js';
62
62
  import { CONTRACT_VERSION } from '../runtime-state.js';
63
63
  /**
64
- * Assemble stdlib functions into the cad namespace.
64
+ * Assemble api functions into the cad namespace.
65
65
  *
66
66
  * P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+
67
67
  * 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec
@@ -69,12 +69,12 @@ import { CONTRACT_VERSION } from '../runtime-state.js';
69
69
  * brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与
70
70
  * `api/index.ts` 导出面同源于同一份清单。
71
71
  *
72
- * @returns the assembled StdlibNamespace ready for runtime injection.
72
+ * @returns the assembled LibNamespace ready for runtime injection.
73
73
  */
74
74
  export function createApiNamespace() {
75
75
  // D-4 strict assembly check: the cad namespace now exports dual-op functions
76
76
  // (defineOp), so registerLib requires a matching contractVersion. Cast is
77
- // needed because StdlibNamespace is an index-signature type.
77
+ // needed because LibNamespace is an index-signature type.
78
78
  return {
79
79
  contractVersion: CONTRACT_VERSION,
80
80
  box, sphere, cylinder, cone, wedge,
@@ -1 +1 @@
1
- {"version":3,"file":"api-namespace.js","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrE,iEAAiE;AACjE,4DAA4D;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AAE,OAAO;QACvC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;QAC/B,6DAA6D;QAC7D,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc;QACnE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,mBAAmB;QAClF,KAAK,EAAE,QAAQ,EAAE,SAAS;QAC1B,OAAO,EAAE,OAAO;QAChB,6DAA6D;QAC7D,2DAA2D;QAC3D,kDAAkD;QAClD,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;QACxC,OAAO;QACP,OAAO;QACP,eAAe,EAAE,iBAAiB,EAAE,YAAY;QAChD,KAAK;QACL,0CAA0C;QAC1C,wDAAwD;QACxD,WAAW;QACX,WAAW;QACX,QAAQ,EAAE,iBAAiB;QAC3B,KAAK;QACL,GAAG,aAAa;QAChB,4EAA4E;QAC5E,gFAAgF;QAChF,GAAG;QACH,4EAA4E;QAC5E,8EAA8E;QAC9E,uEAAuE;QACvE,KAAK;QACL,aAAa;QACb,oDAAoD;QACpD,6DAA6D;QAC7D,iEAAiE;QACjE,0CAA0C;QAC1C,eAAe;QACf,WAAW;QACX,kBAAkB;QAClB,UAAU;QACV,MAAM;QACN,KAAK;KACwB,CAAA;AACjC,CAAC","sourcesContent":["/**\n * api-namespace — 把 L3 API 面(api/ 层的 fp操作)装配为 cad 命名空间(统一 ABI,B2 消灭)\n *\n *\n * 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。\n *\n * 归属(monorepo P5/E-a-1):本文件随 stdlib 出包,是 faijs 默认标准库\n * (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /\n * runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)\n * 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,\n * 引擎并未对 cad 特判,因此不构成 K5 违反。cad 在 core 的 createRuntime 包装中\n * 被注册为 default 命名空间(见 cad-runtime/createRuntimeWithCad.ts)。\n *\n * D1(2026-09-23 扩展库拆分):本命名空间只装配**平台面**。编辑器专属 op\n * (`fai_*` / `group` / `assembly` / `copy` / `load`)与两个非基础 three 链的创建 op\n * (`text` / `svgExtrude`)已迁到 `@faicad/faijs-extra`,由宿主经\n * `mergeEditorNamespace()` 合并后注册——键名与拆分前完全一致,存量 `.fai.js` 零迁移。\n * 四个 transform op(translate/rotate_euler/scale/scale3d)按 D1 选项 C 留在此处:\n * `translate` 是通用几何变换,且是小程序端唯一在用的 transform op。\n */\n\nimport { box, sphere, cylinder, cone, wedge } from './primitives'\nimport { translate, rotate_euler, scale, scale3d } from './transform'\n// cad.extrude 是平台手写 op(承载 upTo;长度形态委托 generated/operations 的投影),\n// 见 api/extrude.ts 的分层说明——up-to 不落在 fai_extrude(后者已随扩展库迁出)。\nimport { extrude } from './extrude'\nimport { knurl } from './knurl'\nimport { sdf } from './sdf'\nimport { screw } from './screw'\nimport { profile } from './profile'\nimport { sketchOnPlane } from './sketch-on-plane'\nimport { sketchOnFace } from './sketch-on-face'\nimport { punchHole } from './punch-hole'\nimport { wire } from './wire'\nimport { helix } from './helix'\nimport { union, subtract, intersect, cut } from './boolean'\nimport { split } from './split'\nimport { sweep } from './sweep'\nimport { loft } from './loft'\nimport { linearPattern } from './pattern'\nimport { circularPattern, gridPattern, rectangularPattern, mirrorJoin, mirror, clone } from './replicate'\nimport { engrave } from './engrave'\nimport { chamfer } from './chamfer'\nimport { fillet } from './fillet'\nimport { shell } from './shell'\nimport { draft } from './draft'\nimport { thicken } from './thicken'\nimport { defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace } from './feature-repair'\nimport { filletVariable } from './fillet-variable'\nimport { splitByPlane } from './split-by-plane'\nimport { sectionByPlane } from './section-by-plane'\nimport { faceNormal, bboxCenter, bboxMin, bboxMax } from './geom'\nimport { edgeRef } from './edge-ref'\nimport { faceRef } from './face-ref'\nimport { jointTrajectory, inverseKinematics, mechanismDOF } from './assembly'\nimport { asset } from './asset'\nimport { import_brep } from './import-brep'\nimport { import_step } from './import-step'\nimport { compound as geometricCompound } from './compound-geom'\nimport { place } from './place'\nimport { scriptFaceOps } from './generated/script-face'\nimport { revolve } from './revolve'\nimport { CONTRACT_VERSION } from '../runtime-state'\nimport type { StdlibNamespace } from '../runtime-state'\n\n/**\n * Assemble stdlib functions into the cad namespace.\n *\n * P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+\n * 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec\n * 的 `scriptFace: true` 条目生成,经 `compatOp(projectBrepOp(…))` 包装的\n * brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与\n * `api/index.ts` 导出面同源于同一份清单。\n *\n * @returns the assembled StdlibNamespace ready for runtime injection.\n */\nexport function createApiNamespace(): StdlibNamespace {\n // D-4 strict assembly check: the cad namespace now exports dual-op functions\n // (defineOp), so registerLib requires a matching contractVersion. Cast is\n // needed because StdlibNamespace is an index-signature type.\n return {\n contractVersion: CONTRACT_VERSION,\n box, sphere, cylinder, cone, wedge,\n screw, profile, sketchOnPlane, sketchOnFace, punchHole, wire, helix, sdf,\n // D1 选项 C:四个 transform op 全留核心(translate 小程序端在用,同族不拆散)。\n translate, rotate_euler, scale, scale3d,\n engrave, chamfer, fillet, knurl,\n // Phase 5:按面/边选的特征族 + 修复薄包装(shell/draft 中立;thicken 平台 occt)。\n shell, draft, thicken, filletVariable, splitByPlane, sectionByPlane,\n defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace,\n union, subtract, intersect,\n extrude, revolve,\n // Phase 4:手写扫掠 / 放样(平台 op engines:['occt'];截面接受 face → 取外环)。\n // arg-spec 里 sweep 保留 brep-op(引擎记录)/ loft 为 skip,两者均不投脚本面,\n // 所以这里不是 override 而是唯一实现(同 extrude / revolve 口径)。\n sweep, loft,\n faceNormal, bboxCenter, bboxMin, bboxMax,\n edgeRef,\n faceRef,\n jointTrajectory, inverseKinematics, mechanismDOF,\n asset,\n // 平台几何 op(H11,方案 §4):FCStd 迁移自此不再借用编辑器 op\n // (group/translate/rotate_euler);这几个与 ../3d_editor 无关系。\n import_brep,\n import_step,\n compound: geometricCompound,\n place,\n ...scriptFaceOps,\n // Phase 3: override generated cut (compatOp, no roleTable propagation) with\n // handwritten cut from boolean.ts (does roleTable propagation via booleanBrep).\n cut,\n // Phase 3: override generated split / linearPattern (compatOp, no roleTable\n // propagation) with handwritten versions that build replica[k] / splinter(#j)\n // role tables (L3 / L4 抗重放词汇). Spread after scriptFaceOps so they win.\n split,\n linearPattern,\n // 覆盖生成版:4 个多副本 pattern 提拔手写(keep + replica[*] 角色表);\n // 2 个单副本(mirror/clone)加 keep 薄 override。transformCopy 不再是脚本面\n // op(arg-spec skip:ComposedTransform 在 .fai.js 不可构造),仅保留 TS 库导出。\n // Spread after scriptFaceOps so they win.\n circularPattern,\n gridPattern,\n rectangularPattern,\n mirrorJoin,\n mirror,\n clone,\n } as unknown as StdlibNamespace\n}\n"]}
1
+ {"version":3,"file":"api-namespace.js","sourceRoot":"","sources":["../../src/api/api-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrE,iEAAiE;AACjE,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B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cAAc,EAAE,mBAAmB;QAClF,KAAK,EAAE,QAAQ,EAAE,SAAS;QAC1B,OAAO,EAAE,OAAO;QAChB,6DAA6D;QAC7D,2DAA2D;QAC3D,kDAAkD;QAClD,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;QACxC,OAAO;QACP,OAAO;QACP,eAAe,EAAE,iBAAiB,EAAE,YAAY;QAChD,KAAK;QACL,0CAA0C;QAC1C,wDAAwD;QACxD,WAAW;QACX,WAAW;QACX,QAAQ,EAAE,iBAAiB;QAC3B,KAAK;QACL,GAAG,aAAa;QAChB,4EAA4E;QAC5E,gFAAgF;QAChF,GAAG;QACH,4EAA4E;QAC5E,8EAA8E;QAC9E,uEAAuE;QACvE,KAAK;QACL,aAAa;QACb,oDAAoD;QACpD,6DAA6D;QAC7D,iEAAiE;QACjE,0CAA0C;QAC1C,eAAe;QACf,WAAW;QACX,kBAAkB;QAClB,UAAU;QACV,MAAM;QACN,KAAK;KACqB,CAAA;AAC9B,CAAC","sourcesContent":["/**\n * api-namespace — 把 L3 API 面(api/ 层的 fp操作)装配为 cad 命名空间(统一 ABI,B2 消灭)\n *\n *\n * 库函数签名 = .fai.js 源码形态(无隐式参数);本文件无任何 per-函数逻辑。\n *\n * 归属(monorepo P5/E-a-1):本文件随 core 出包,是 faijs 默认库函数\n * (cad 命名空间)的装配点。K5(引擎零函数知识)的准确含义是:parser / compile /\n * runtime 不按函数名分支、不区分函数类别,函数信息统一以 defineOp 元数据(均匀数据)\n * 承载。把 cad 这套库数据内置进引擎,与第三方库走完全相同的 registerLib 路径,\n * 引擎并未对 cad 特判,因此不构成 K5 违反。cad 在 core 的 createRuntime 包装中\n * 被注册为 default 命名空间(见 cad-runtime/createRuntimeWithCad.ts)。\n *\n * D1(2026-09-23 扩展库拆分):本命名空间只装配**平台面**。编辑器专属 op\n * (`fai_*` / `group` / `assembly` / `copy` / `load`)与两个非基础 three 链的创建 op\n * (`text` / `svgExtrude`)已迁到 `@faicad/faijs-extra`,由宿主经\n * `mergeEditorNamespace()` 合并后注册——键名与拆分前完全一致,存量 `.fai.js` 零迁移。\n * 四个 transform op(translate/rotate_euler/scale/scale3d)按 D1 选项 C 留在此处:\n * `translate` 是通用几何变换,且是小程序端唯一在用的 transform op。\n */\n\nimport { box, sphere, cylinder, cone, wedge } from './primitives'\nimport { translate, rotate_euler, scale, scale3d } from './transform'\n// cad.extrude 是平台手写 op(承载 upTo;长度形态委托 generated/operations 的投影),\n// 见 api/extrude.ts 的分层说明——up-to 不落在 fai_extrude(后者已随扩展库迁出)。\nimport { extrude } from './extrude'\nimport { knurl } from './knurl'\nimport { sdf } from './sdf'\nimport { screw } from './screw'\nimport { profile } from './profile'\nimport { sketchOnPlane } from './sketch-on-plane'\nimport { sketchOnFace } from './sketch-on-face'\nimport { punchHole } from './punch-hole'\nimport { wire } from './wire'\nimport { helix } from './helix'\nimport { union, subtract, intersect, cut } from './boolean'\nimport { split } from './split'\nimport { sweep } from './sweep'\nimport { loft } from './loft'\nimport { linearPattern } from './pattern'\nimport { circularPattern, gridPattern, rectangularPattern, mirrorJoin, mirror, clone } from './replicate'\nimport { engrave } from './engrave'\nimport { chamfer } from './chamfer'\nimport { fillet } from './fillet'\nimport { shell } from './shell'\nimport { draft } from './draft'\nimport { thicken } from './thicken'\nimport { defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace } from './feature-repair'\nimport { filletVariable } from './fillet-variable'\nimport { splitByPlane } from './split-by-plane'\nimport { sectionByPlane } from './section-by-plane'\nimport { faceNormal, bboxCenter, bboxMin, bboxMax } from './geom'\nimport { edgeRef } from './edge-ref'\nimport { faceRef } from './face-ref'\nimport { jointTrajectory, inverseKinematics, mechanismDOF } from './assembly'\nimport { asset } from './asset'\nimport { import_brep } from './import-brep'\nimport { import_step } from './import-step'\nimport { compound as geometricCompound } from './compound-geom'\nimport { place } from './place'\nimport { scriptFaceOps } from './generated/script-face'\nimport { revolve } from './revolve'\nimport { CONTRACT_VERSION } from '../runtime-state'\nimport type { LibNamespace } from '../runtime-state'\n\n/**\n * Assemble api functions into the cad namespace.\n *\n * P23(§4.2 ②,B1 三源一致):cad 面 = faijs 特有 dual op(下方字面量)+\n * 生成脚本面 op(`scriptFaceOps`——`api/generated/script-face.ts` 按 arg-spec\n * 的 `scriptFace: true` 条目生成,经 `compatOp(projectBrepOp(…))` 包装的\n * brep-only 语句级 op)。`check()` 符号表(`gen-symbol-table.ts`)与\n * `api/index.ts` 导出面同源于同一份清单。\n *\n * @returns the assembled LibNamespace ready for runtime injection.\n */\nexport function createApiNamespace(): LibNamespace {\n // D-4 strict assembly check: the cad namespace now exports dual-op functions\n // (defineOp), so registerLib requires a matching contractVersion. Cast is\n // needed because LibNamespace is an index-signature type.\n return {\n contractVersion: CONTRACT_VERSION,\n box, sphere, cylinder, cone, wedge,\n screw, profile, sketchOnPlane, sketchOnFace, punchHole, wire, helix, sdf,\n // D1 选项 C:四个 transform op 全留核心(translate 小程序端在用,同族不拆散)。\n translate, rotate_euler, scale, scale3d,\n engrave, chamfer, fillet, knurl,\n // Phase 5:按面/边选的特征族 + 修复薄包装(shell/draft 中立;thicken 平台 occt)。\n shell, draft, thicken, filletVariable, splitByPlane, sectionByPlane,\n defeature, reverseShape, unifySameDomain, sew, sewAndSolidify, removeHolesFromFace,\n union, subtract, intersect,\n extrude, revolve,\n // Phase 4:手写扫掠 / 放样(平台 op engines:['occt'];截面接受 face → 取外环)。\n // arg-spec 里 sweep 保留 brep-op(引擎记录)/ loft 为 skip,两者均不投脚本面,\n // 所以这里不是 override 而是唯一实现(同 extrude / revolve 口径)。\n sweep, loft,\n faceNormal, bboxCenter, bboxMin, bboxMax,\n edgeRef,\n faceRef,\n jointTrajectory, inverseKinematics, mechanismDOF,\n asset,\n // 平台几何 op(H11,方案 §4):FCStd 迁移自此不再借用编辑器 op\n // (group/translate/rotate_euler);这几个与 ../3d_editor 无关系。\n import_brep,\n import_step,\n compound: geometricCompound,\n place,\n ...scriptFaceOps,\n // Phase 3: override generated cut (compatOp, no roleTable propagation) with\n // handwritten cut from boolean.ts (does roleTable propagation via booleanBrep).\n cut,\n // Phase 3: override generated split / linearPattern (compatOp, no roleTable\n // propagation) with handwritten versions that build replica[k] / splinter(#j)\n // role tables (L3 / L4 抗重放词汇). Spread after scriptFaceOps so they win.\n split,\n linearPattern,\n // 覆盖生成版:4 个多副本 pattern 提拔手写(keep + replica[*] 角色表);\n // 2 个单副本(mirror/clone)加 keep 薄 override。transformCopy 不再是脚本面\n // op(arg-spec skip:ComposedTransform 在 .fai.js 不可构造),仅保留 TS 库导出。\n // Spread after scriptFaceOps so they win.\n circularPattern,\n gridPattern,\n rectangularPattern,\n mirrorJoin,\n mirror,\n clone,\n } as unknown as LibNamespace\n}\n"]}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * api/appearance — faijs PBR 外观规格(颜色/材质/透明度)权威类型与 Shape 方法
3
+ *
4
+ * 设计文档:docs/plans/2026-10-05-faijs-pbr-appearance-api-design.md(v2)
5
+ *
6
+ * 定位:
7
+ * - 外观设置**不是 op**(不进 defineOp/api-namespace/args-schema),是 Shape
8
+ * 实例方法(`box1.setColor(...)`,复用 `asm1.solve()` 的成员调用语句形态)。
9
+ * - `PbrAppearance` 引擎无关、JSON 可序列化,随 Shape 走 mesh/brep 双链路
10
+ * (`Shape.appearance`),编辑器/查看器只读字段,不依赖方法。
11
+ * - 本文件零依赖(不 import THREE / occt / store);唯一 import 是 mesh/types
12
+ * 的 `Shape` 类型(type-only),mesh/types 亦只 type-import 本文件的类型,
13
+ * 两者为类型环、无运行时环(值依赖单向:shape.ts → api/appearance.ts)。
14
+ *
15
+ * 颜色约定:
16
+ * - 内部归一形态:`color: [r, g, b]`(sRGB,0–1);`opacity` 是透明度的唯一
17
+ * 权威字段(0–1)。
18
+ * - 输入接受 hex(#rgb / #rrggbb / #rrggbbaa)与数组([r,g,b] / [r,g,b,a]);
19
+ * `#rrggbbaa` / 数组第 4 分量的 alpha 等价于 `opacity`(显式 setOpacity 后
20
+ * 写入的 opacity 优先于后续无 alpha 的 setColor 推导,见 setColor 注释)。
21
+ * - CSS 颜色名:P1 不支持(抛错),由宿主或后续版本扩展。
22
+ */
23
+ import type { Shape } from '../mesh/types.js';
24
+ /** 颜色输入:hex(#rgb/#rrggbb/#rrggbbaa)或 sRGB 0–1 数组([r,g,b] / [r,g,b,a])。 */
25
+ export type PbrColor = string | [number, number, number] | [number, number, number, number];
26
+ /** glTF 透明度约定(与 3d_editor MaterialAppearance.alphaMode 对齐)。 */
27
+ export type PbrAlphaMode = 'OPAQUE' | 'MASK' | 'BLEND';
28
+ /**
29
+ * faijs PBR 外观规格 —— 引擎无关、JSON 可序列化、随 Shape 走双链路。
30
+ *
31
+ * 全字段可选:未设置字段 = 继承上游 / 宿主默认,不隐式清零。
32
+ * 归一形态约定:`color` 为 [r,g,b](sRGB 0–1)数组;`opacity`(0–1)为
33
+ * 透明度唯一权威字段(color 的 aa 分量在 set 时归一为 opacity)。
34
+ */
35
+ export interface PbrAppearance {
36
+ /** 基色(sRGB 0–1)。 */
37
+ color?: [number, number, number];
38
+ /** 透明度 0–1。 */
39
+ opacity?: number;
40
+ /** 金属度 0–1;粗糙度 0–1。 */
41
+ metalness?: number;
42
+ roughness?: number;
43
+ /** 自发光:颜色 + 强度(>0 时启用,默认 1)。 */
44
+ emissive?: [number, number, number];
45
+ emissiveIntensity?: number;
46
+ /** 透射/玻璃。 */
47
+ transmission?: number;
48
+ thickness?: number;
49
+ ior?: number;
50
+ attenuationColor?: [number, number, number];
51
+ attenuationDistance?: number;
52
+ /** 清漆。 */
53
+ clearcoat?: number;
54
+ clearcoatRoughness?: number;
55
+ /** 织物/丝绒。 */
56
+ sheen?: number;
57
+ sheenColor?: [number, number, number];
58
+ sheenRoughness?: number;
59
+ /** 拉丝金属。 */
60
+ anisotropy?: number;
61
+ anisotropyRotation?: number;
62
+ /** 高光工作流(替代 metalness 工作流)。 */
63
+ specularIntensity?: number;
64
+ specularColor?: [number, number, number];
65
+ /** 环境光强度(IBL 贡献)。 */
66
+ envMapIntensity?: number;
67
+ /** 透明度模式:默认 OPAQUE;opacity<1 未显式指定时宿主按 BLEND 处理。 */
68
+ alphaMode?: PbrAlphaMode;
69
+ alphaCutoff?: number;
70
+ /** 双面渲染。 */
71
+ doubleSided?: boolean;
72
+ /** 无光照。 */
73
+ unlit?: boolean;
74
+ }
75
+ /** 材质参数(不含颜色/透明度,`cad` 便捷方法 setMaterial 的入参)。 */
76
+ export type MaterialSpec = Omit<PbrAppearance, 'color' | 'opacity'>;
77
+ /** Shape 外观方法签名(运行时由 attachAppearanceMethods 挂载;纯数据判定不受影响)。 */
78
+ export interface ShapeAppearanceMethods {
79
+ /** 合并外观:`{...cur, ...spec}`,spec 中 undefined 字段保留旧值。 */
80
+ setAppearance(spec: PbrAppearance): this;
81
+ /** 便捷:等价 setAppearance({ color });#rrggbbaa / [r,g,b,a] 的 alpha 归一为 opacity。 */
82
+ setColor(color: PbrColor): this;
83
+ /** 便捷:等价 setAppearance(spec)。 */
84
+ setMaterial(spec: MaterialSpec): this;
85
+ /** 便捷:透明度权威字段(0–1)。 */
86
+ setOpacity(opacity: number): this;
87
+ /** 读取当前外观(可能 undefined)。 */
88
+ getAppearance(): Readonly<PbrAppearance> | undefined;
89
+ /**
90
+ * 面级设色:把 faceIds 指定的面(面序号契约见 `Shape.faceRanges`,参数化
91
+ * primitives 才有)写入 `materialGroups`。无面结构(布尔/组合/导入产物)抛
92
+ * `E_FACE_UNAVAILABLE`;面序号越界抛 `E_FACE_INDEX`。
93
+ */
94
+ setFaceColor(faces: number[], color: PbrColor): this;
95
+ /** 面级材质:等价 setFaceColor 的 material 版本。 */
96
+ setFaceMaterial(faces: number[], spec: MaterialSpec): this;
97
+ }
98
+ /**
99
+ * 归一颜色输入 → { rgb, alpha? }。
100
+ * hex 与 [r,g,b] / [r,g,b,a](sRGB 0–1);CSS 颜色名 P1 不支持。
101
+ * @param color 颜色输入:`#rgb` / `#rrggbb` / `#rrggbbaa`,或 `[r,g,b]` / `[r,g,b,a]`(sRGB 0–1)
102
+ * @returns 归一后的 sRGB 颜色(0–1)与可选 alpha;带 alpha 的输入在 alpha 通道返回
103
+ */
104
+ export declare function normalizeColor(color: PbrColor): {
105
+ rgb: [number, number, number];
106
+ alpha?: number;
107
+ };
108
+ /**
109
+ * 合并外观:spec 中 undefined 字段不覆盖旧值。
110
+ * @param cur 当前外观(可为 undefined)
111
+ * @param spec 待合并字段(undefined 字段被跳过)
112
+ * @returns 合并后的外观(新对象;cur 为 undefined 时仅含 spec 非空字段)
113
+ */
114
+ export declare function mergeAppearance(cur: PbrAppearance | undefined, spec: PbrAppearance): PbrAppearance;
115
+ /**
116
+ * 把 faceIds 指定的面(面序号 → `Shape.faceRanges` 三角形区间)合并进
117
+ * `shape.materialGroups`。多次设置同一面 → 外观合并(spec 未设置字段保留旧值);
118
+ * 不同面同外观 → 相邻区间合并为一个分组。输出按三角形起始排序。
119
+ *
120
+ * 无面结构(`faceRanges` 缺失——布尔/组合/导入产物)抛 `E_FACE_UNAVAILABLE`;
121
+ * 面序号越界/非整数抛 `E_FACE_INDEX`。
122
+ * @param shape 目标 Shape(必须携带 faceRanges)
123
+ * @param faceIds 面序号列表(PbrAppearance 面序契约见 mesh/primitives.ts 各构造点注释)
124
+ * @param spec 待合并到目标面的外观字段
125
+ */
126
+ export declare function mergeFaceAppearance(shape: Shape, faceIds: number[], spec: PbrAppearance): void;
127
+ /**
128
+ * 给 Shape 实例挂载外观方法(幂等:已有 setAppearance 则跳过)。
129
+ *
130
+ * 所有产物构造点(solid/curve → fromBrep/fromMeshSolid/fromBrepCurve)统一
131
+ * 调用本函数,保证 mesh/brep 双链路产物都可用 `box1.setColor(...)`。
132
+ * 方法**不序列化**(JSON 丢弃函数);`appearance` 字段随产物跨 worker 传递,
133
+ * 编辑器/查看器只读字段即可,不依赖方法。
134
+ * @param shape 产物 Shape 实例(solid/curve 产物)
135
+ * @returns 挂载后的 shape(类型提升为 `Shape & ShapeAppearanceMethods`;同一实例原地挂载)
136
+ */
137
+ export declare function attachAppearanceMethods(shape: Shape): Shape & ShapeAppearanceMethods;
138
+ //# sourceMappingURL=appearance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/api/appearance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAI1C,0EAA0E;AAC1E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE3F,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,aAAa;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B,UAAU;IACV,SAAS,CAAC,EAAE,M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