@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
@@ -0,0 +1,121 @@
1
+ /**
2
+ * cadquery-selectors/entity — projection of kernel handles into the geometric
3
+ * quantities the selector predicates need.
4
+ *
5
+ * Each helper mirrors the CadQuery shape method it stands in for (plan §4.3):
6
+ * · `Vertex.Center()` → vertex position
7
+ * · `Edge.Center()` → linear centre of mass (LinearProperties centroid)
8
+ * · `Face.Center()` → surface centre of mass (SurfaceProperties centroid)
9
+ * · `Face.normalAt(None)` → parametric surface normal at the uv midpoint,
10
+ * oriented outward via `containsPoint` on the owner
11
+ * · `Edge.tangentAt()` → curve tangent at the parameter midpoint,
12
+ * oriented along the edge parameter direction
13
+ * · `Face/Edge.geomType()` → kernel surface/curve kind mapped to the CadQuery
14
+ * geom_LUT uppercased names
15
+ *
16
+ * These are deliberately decoupled from any single entity type so the
17
+ * predicates (predicates.ts) and the narrowing engine (resolve.ts) stay
18
+ * type-agnostic. All quantities are computed lazily by the caller via the
19
+ * projection object below.
20
+ *
21
+ * @platform occt — the projection resolves occt-wasm `ShapeHandle`s via the
22
+ * native kernel (`getKernel()`: getSubShapes / hashCode / isSame / bounds /
23
+ * surface & curve queries), so this module is occt-coupled by nature.
24
+ */
25
+ import type { OcctKernel, ShapeHandle } from 'occt-wasm';
26
+ /** Resolve the kernel geometry-kind → CadQuery LUT upcased name. */
27
+ export interface GeomKindMap {
28
+ surface: Record<string, string>;
29
+ curve: Record<string, string>;
30
+ }
31
+ /**
32
+ * Map a kernel surface-kind string to the CadQuery `geomType()` name.
33
+ *
34
+ * @param kind - The kernel surface kind (e.g. `plane`, `cylinder`, `torus`).
35
+ * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.
36
+ */
37
+ export declare function faceGeomType(kind: string): string;
38
+ /**
39
+ * Map a kernel curve-kind string to the CadQuery `geomType()` name.
40
+ *
41
+ * @param kind - The kernel curve kind (e.g. `line`, `circle`, `bspline`).
42
+ * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.
43
+ */
44
+ export declare function edgeGeomType(kind: string): string;
45
+ /** World-space cartesian coordinates of an entity center point. */
46
+ export interface EntityCenter {
47
+ x: number;
48
+ y: number;
49
+ z: number;
50
+ }
51
+ /** Plain 3-D vector in faijs' internal convention. */
52
+ export type P3 = {
53
+ x: number;
54
+ y: number;
55
+ z: number;
56
+ };
57
+ export type { ShapeHandle };
58
+ /**
59
+ * The lazily-evaluable geometry of one candidate entity. Predicates only access
60
+ * the fields they need so the heavy computation (surface normal, etc.) is only
61
+ * paid for when a direction/parallel filter is actually applied.
62
+ */
63
+ export interface EntityGeom {
64
+ kind: 'face' | 'edge' | 'vertex';
65
+ /** Internal kernel handle for identity comparison (not part of the public surface). */
66
+ _handle: ShapeHandle;
67
+ /** Kernel handle box-identity hash (stable key across narrowing). */
68
+ hash(): number;
69
+ /** Kernel handle `isSame(...)` equality predicate. */
70
+ same(other: EntityGeom): boolean;
71
+ /** CadQuery `Shape.Center()` for this entity kind. */
72
+ center(): P3;
73
+ /**
74
+ * The direction used by direction-motivated selectors: the outward normal for
75
+ * a face (requires the owning shape for orientation) or the mid-parameter
76
+ * tangent for an edge. Null for vertices (no usable direction, upstream
77
+ * `BaseSelector` drops them).
78
+ */
79
+ direction(owner: ShapeHandle): P3 | null;
80
+ /** Face/Edge geometry type (upcased LUT name), or undefined for vertices. */
81
+ geomType(): string | undefined;
82
+ }
83
+ /**
84
+ * Project a face handle into its `EntityGeom`.
85
+ *
86
+ * @param face - The kernel face handle to project.
87
+ * @returns The lazily-evaluable face geometry (normal oriented on demand).
88
+ */
89
+ export declare function faceGeom(face: ShapeHandle): EntityGeom;
90
+ /**
91
+ * Orient a parametric face normal outward: offset probe → inside ⇒ flip.
92
+ *
93
+ * @param k - The active kernel instance used for surface/containment queries.
94
+ * @param face - The kernel face handle whose normal is oriented.
95
+ * @param owner - The owning shape handle used for the containment probe.
96
+ * @returns The outward-facing unit normal of `face`.
97
+ */
98
+ export declare function orientedFaceNormal(k: OcctKernel, face: ShapeHandle, owner: ShapeHandle): P3;
99
+ /**
100
+ * Project an edge handle into its `EntityGeom`.
101
+ *
102
+ * @param edge - The kernel edge handle to project.
103
+ * @returns The lazily-evaluable edge geometry (mid-parameter tangent).
104
+ */
105
+ export declare function edgeGeom(edge: ShapeHandle): EntityGeom;
106
+ /**
107
+ * Project a vertex handle into its `EntityGeom`.
108
+ *
109
+ * @param vertex - The kernel vertex handle to project.
110
+ * @returns The lazily-evaluable vertex geometry (no direction / type).
111
+ */
112
+ export declare function vertexGeom(vertex: ShapeHandle): EntityGeom;
113
+ /**
114
+ * Get the sub-entity handles of the given topological type from a shape.
115
+ *
116
+ * @param shape - The kernel handle to query.
117
+ * @param type - The topological type to enumerate.
118
+ * @returns The ordered kernel sub-shape handles of that type.
119
+ */
120
+ export declare function subShapeHandles(shape: ShapeHandle, type: 'face' | 'edge' | 'vertex'): ShapeHandle[];
121
+ //# sourceMappingURL=entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAQ,MAAM,WAAW,CAAA;AAE9D,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9B;AA2BD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,sDAAsD;AACtD,MAAM,MAAM,EAAE,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,YAAY,EAAE,WAAW,EAAE,CAAA;AAM3B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;IAChC,uFAAuF;IACvF,OAAO,EAAE,WAAW,CAAA;IACpB,qEAAqE;IACrE,IAAI,IAAI,MAAM,CAAA;IACd,sDAAsD;IACtD,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAA;IAChC,sDAAsD;IACtD,MAAM,IAAI,EAAE,CAAA;IACZ;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,EAAE,GAAG,IAAI,CAAA;IACxC,6EAA6E;IAC7E,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAA;CAC/B;AAID;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAWtD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,UAAU,EACb,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,GACjB,EAAE,CAgBJ;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAetD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAY1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,EAAE,CAGnG"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * cadquery-selectors/entity — projection of kernel handles into the geometric
3
+ * quantities the selector predicates need.
4
+ *
5
+ * Each helper mirrors the CadQuery shape method it stands in for (plan §4.3):
6
+ * · `Vertex.Center()` → vertex position
7
+ * · `Edge.Center()` → linear centre of mass (LinearProperties centroid)
8
+ * · `Face.Center()` → surface centre of mass (SurfaceProperties centroid)
9
+ * · `Face.normalAt(None)` → parametric surface normal at the uv midpoint,
10
+ * oriented outward via `containsPoint` on the owner
11
+ * · `Edge.tangentAt()` → curve tangent at the parameter midpoint,
12
+ * oriented along the edge parameter direction
13
+ * · `Face/Edge.geomType()` → kernel surface/curve kind mapped to the CadQuery
14
+ * geom_LUT uppercased names
15
+ *
16
+ * These are deliberately decoupled from any single entity type so the
17
+ * predicates (predicates.ts) and the narrowing engine (resolve.ts) stay
18
+ * type-agnostic. All quantities are computed lazily by the caller via the
19
+ * projection object below.
20
+ *
21
+ * @platform occt — the projection resolves occt-wasm `ShapeHandle`s via the
22
+ * native kernel (`getKernel()`: getSubShapes / hashCode / isSame / bounds /
23
+ * surface & curve queries), so this module is occt-coupled by nature.
24
+ */
25
+ import { getKernel } from '../../occt-kernel/occtKernel.js';
26
+ const NAMED_GEOM = {
27
+ surface: {
28
+ plane: 'PLANE',
29
+ cylinder: 'CYLINDER',
30
+ cone: 'CONE',
31
+ sphere: 'SPHERE',
32
+ torus: 'TORUS',
33
+ bspline: 'BSPLINE',
34
+ bezier: 'BEZIER',
35
+ offset: 'OFFSET',
36
+ revolution: 'REVOLUTION',
37
+ extrusion: 'EXTRUSION',
38
+ },
39
+ curve: {
40
+ line: 'LINE',
41
+ circle: 'CIRCLE',
42
+ ellipse: 'ELLIPSE',
43
+ hyperbola: 'HYPERBOLA',
44
+ parabola: 'PARABOLA',
45
+ bspline: 'BSPLINE',
46
+ bezier: 'BEZIER',
47
+ offset: 'OFFSET',
48
+ },
49
+ };
50
+ /**
51
+ * Map a kernel surface-kind string to the CadQuery `geomType()` name.
52
+ *
53
+ * @param kind - The kernel surface kind (e.g. `plane`, `cylinder`, `torus`).
54
+ * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.
55
+ */
56
+ export function faceGeomType(kind) {
57
+ return NAMED_GEOM.surface[kind] ?? 'OTHER';
58
+ }
59
+ /**
60
+ * Map a kernel curve-kind string to the CadQuery `geomType()` name.
61
+ *
62
+ * @param kind - The kernel curve kind (e.g. `line`, `circle`, `bspline`).
63
+ * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.
64
+ */
65
+ export function edgeGeomType(kind) {
66
+ return NAMED_GEOM.curve[kind] ?? 'OTHER';
67
+ }
68
+ function v(v) {
69
+ return { x: v.x, y: v.y, z: v.z };
70
+ }
71
+ const kern = () => getKernel();
72
+ /**
73
+ * Project a face handle into its `EntityGeom`.
74
+ *
75
+ * @param face - The kernel face handle to project.
76
+ * @returns The lazily-evaluable face geometry (normal oriented on demand).
77
+ */
78
+ export function faceGeom(face) {
79
+ const k = kern();
80
+ return {
81
+ kind: 'face',
82
+ _handle: face,
83
+ hash: () => k.hashCode(face, 1e9),
84
+ same: (other) => k.isSame(face, other._handle),
85
+ center: () => v(k.getSurfaceCenterOfMass(face)),
86
+ direction: (owner) => orientedFaceNormal(k, face, owner),
87
+ geomType: () => faceGeomType(k.surfaceType(face)),
88
+ };
89
+ }
90
+ /**
91
+ * Orient a parametric face normal outward: offset probe → inside ⇒ flip.
92
+ *
93
+ * @param k - The active kernel instance used for surface/containment queries.
94
+ * @param face - The kernel face handle whose normal is oriented.
95
+ * @param owner - The owning shape handle used for the containment probe.
96
+ * @returns The outward-facing unit normal of `face`.
97
+ */
98
+ export function orientedFaceNormal(k, face, owner) {
99
+ const uv = k.uvBounds(face);
100
+ const u = (uv.uMin + uv.uMax) / 2;
101
+ const vv = (uv.vMin + uv.vMax) / 2;
102
+ const n = k.surfaceNormal(face, u, vv);
103
+ const db = k.getBoundingBox(face);
104
+ const ext = [db.xmax - db.xmin, db.ymax - db.ymin, db.zmax - db.zmin];
105
+ const minExt = Math.min(...ext, 1);
106
+ const eps = minExt * 1e-3 + 1e-6;
107
+ const center = k.pointOnSurface(face, u, vv);
108
+ const probe = { x: center.x + n.x * eps, y: center.y + n.y * eps, z: center.z + n.z * eps };
109
+ // inside owner ⇒ the candidate normal points inward, so flip it.
110
+ if (k.containsPoint(owner, probe, 1e-9)) {
111
+ return { x: -n.x, y: -n.y, z: -n.z };
112
+ }
113
+ return v(n);
114
+ }
115
+ /**
116
+ * Project an edge handle into its `EntityGeom`.
117
+ *
118
+ * @param edge - The kernel edge handle to project.
119
+ * @returns The lazily-evaluable edge geometry (mid-parameter tangent).
120
+ */
121
+ export function edgeGeom(edge) {
122
+ const k = kern();
123
+ const midParams = () => {
124
+ const cp = k.curveParameters(edge);
125
+ return (cp.first + cp.last) / 2;
126
+ };
127
+ return {
128
+ kind: 'edge',
129
+ _handle: edge,
130
+ hash: () => k.hashCode(edge, 1e9),
131
+ same: (other) => k.isSame(edge, other._handle),
132
+ center: () => v(k.curvePointAtParam(edge, midParams())),
133
+ direction: () => v(k.curveTangent(edge, midParams())),
134
+ geomType: () => edgeGeomType(k.curveType(edge)),
135
+ };
136
+ }
137
+ /**
138
+ * Project a vertex handle into its `EntityGeom`.
139
+ *
140
+ * @param vertex - The kernel vertex handle to project.
141
+ * @returns The lazily-evaluable vertex geometry (no direction / type).
142
+ */
143
+ export function vertexGeom(vertex) {
144
+ const k = kern();
145
+ const p = k.vertexPosition(vertex);
146
+ return {
147
+ kind: 'vertex',
148
+ _handle: vertex,
149
+ hash: () => k.hashCode(vertex, 1e9),
150
+ same: (other) => k.isSame(vertex, other._handle),
151
+ center: () => v(p),
152
+ direction: () => null,
153
+ geomType: () => undefined,
154
+ };
155
+ }
156
+ /**
157
+ * Get the sub-entity handles of the given topological type from a shape.
158
+ *
159
+ * @param shape - The kernel handle to query.
160
+ * @param type - The topological type to enumerate.
161
+ * @returns The ordered kernel sub-shape handles of that type.
162
+ */
163
+ export function subShapeHandles(shape, type) {
164
+ const k = kern();
165
+ return k.getSubShapes(shape, type);
166
+ }
167
+ //# sourceMappingURL=entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AASxD,MAAM,UAAU,GAAuE;IACrF,OAAO,EAAE;QACP,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;QAChB,KAAK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AAE,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACrD,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAChD,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAmB;IAC5C,MAAM,CAAC,GAAG,IAAI,EAAE,CAAA;IAChB,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;IAClC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;QACnC,IAAI,EAAE,CAAC,KAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC;QAC5D,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI;QACrB,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;KAC1B,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAkB,EAAE,IAAgC;IAClF,MAAM,CAAC,GAAG,IAAI,EAAE,CAAA;IAChB,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAkB,CAAA;AACrD,CAAC","sourcesContent":["/**\n * cadquery-selectors/entity — projection of kernel handles into the geometric\n * quantities the selector predicates need.\n *\n * Each helper mirrors the CadQuery shape method it stands in for (plan §4.3):\n * · `Vertex.Center()` → vertex position\n * · `Edge.Center()` → linear centre of mass (LinearProperties centroid)\n * · `Face.Center()` → surface centre of mass (SurfaceProperties centroid)\n * · `Face.normalAt(None)` → parametric surface normal at the uv midpoint,\n * oriented outward via `containsPoint` on the owner\n * · `Edge.tangentAt()` → curve tangent at the parameter midpoint,\n * oriented along the edge parameter direction\n * · `Face/Edge.geomType()` → kernel surface/curve kind mapped to the CadQuery\n * geom_LUT uppercased names\n *\n * These are deliberately decoupled from any single entity type so the\n * predicates (predicates.ts) and the narrowing engine (resolve.ts) stay\n * type-agnostic. All quantities are computed lazily by the caller via the\n * projection object below.\n *\n * @platform occt — the projection resolves occt-wasm `ShapeHandle`s via the\n * native kernel (`getKernel()`: getSubShapes / hashCode / isSame / bounds /\n * surface & curve queries), so this module is occt-coupled by nature.\n */\n\nimport { getKernel } from '../../occt-kernel/occtKernel'\nimport type { OcctKernel, ShapeHandle, Vec3 } from 'occt-wasm'\n\n/** Resolve the kernel geometry-kind → CadQuery LUT upcased name. */\nexport interface GeomKindMap {\n surface: Record<string, string>\n curve: Record<string, string>\n}\n\nconst NAMED_GEOM: { surface: Record<string, string>; curve: Record<string, string> } = {\n surface: {\n plane: 'PLANE',\n cylinder: 'CYLINDER',\n cone: 'CONE',\n sphere: 'SPHERE',\n torus: 'TORUS',\n bspline: 'BSPLINE',\n bezier: 'BEZIER',\n offset: 'OFFSET',\n revolution: 'REVOLUTION',\n extrusion: 'EXTRUSION',\n },\n curve: {\n line: 'LINE',\n circle: 'CIRCLE',\n ellipse: 'ELLIPSE',\n hyperbola: 'HYPERBOLA',\n parabola: 'PARABOLA',\n bspline: 'BSPLINE',\n bezier: 'BEZIER',\n offset: 'OFFSET',\n },\n}\n\n/**\n * Map a kernel surface-kind string to the CadQuery `geomType()` name.\n *\n * @param kind - The kernel surface kind (e.g. `plane`, `cylinder`, `torus`).\n * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.\n */\nexport function faceGeomType(kind: string): string {\n return NAMED_GEOM.surface[kind] ?? 'OTHER'\n}\n\n/**\n * Map a kernel curve-kind string to the CadQuery `geomType()` name.\n *\n * @param kind - The kernel curve kind (e.g. `line`, `circle`, `bspline`).\n * @returns The uppercased CadQuery geometry name, or `OTHER` when unmapped.\n */\nexport function edgeGeomType(kind: string): string {\n return NAMED_GEOM.curve[kind] ?? 'OTHER'\n}\n\n/** World-space cartesian coordinates of an entity center point. */\nexport interface EntityCenter {\n x: number\n y: number\n z: number\n}\n\n/** Plain 3-D vector in faijs' internal convention. */\nexport type P3 = { x: number; y: number; z: number }\n\nexport type { ShapeHandle }\n\nfunction v(v: Vec3 | P3): P3 {\n return { x: v.x, y: v.y, z: v.z }\n}\n\n/**\n * The lazily-evaluable geometry of one candidate entity. Predicates only access\n * the fields they need so the heavy computation (surface normal, etc.) is only\n * paid for when a direction/parallel filter is actually applied.\n */\nexport interface EntityGeom {\n kind: 'face' | 'edge' | 'vertex'\n /** Internal kernel handle for identity comparison (not part of the public surface). */\n _handle: ShapeHandle\n /** Kernel handle box-identity hash (stable key across narrowing). */\n hash(): number\n /** Kernel handle `isSame(...)` equality predicate. */\n same(other: EntityGeom): boolean\n /** CadQuery `Shape.Center()` for this entity kind. */\n center(): P3\n /**\n * The direction used by direction-motivated selectors: the outward normal for\n * a face (requires the owning shape for orientation) or the mid-parameter\n * tangent for an edge. Null for vertices (no usable direction, upstream\n * `BaseSelector` drops them).\n */\n direction(owner: ShapeHandle): P3 | null\n /** Face/Edge geometry type (upcased LUT name), or undefined for vertices. */\n geomType(): string | undefined\n}\n\nconst kern = (): OcctKernel => getKernel() as unknown as OcctKernel\n\n/**\n * Project a face handle into its `EntityGeom`.\n *\n * @param face - The kernel face handle to project.\n * @returns The lazily-evaluable face geometry (normal oriented on demand).\n */\nexport function faceGeom(face: ShapeHandle): EntityGeom {\n const k = kern()\n return {\n kind: 'face',\n _handle: face,\n hash: () => k.hashCode(face, 1e9),\n same: (other: EntityGeom) => k.isSame(face, other._handle),\n center: () => v(k.getSurfaceCenterOfMass(face)),\n direction: (owner: ShapeHandle) => orientedFaceNormal(k, face, owner),\n geomType: () => faceGeomType(k.surfaceType(face)),\n }\n}\n\n/**\n * Orient a parametric face normal outward: offset probe → inside ⇒ flip.\n *\n * @param k - The active kernel instance used for surface/containment queries.\n * @param face - The kernel face handle whose normal is oriented.\n * @param owner - The owning shape handle used for the containment probe.\n * @returns The outward-facing unit normal of `face`.\n */\nexport function orientedFaceNormal(\n k: OcctKernel,\n face: ShapeHandle,\n owner: ShapeHandle,\n): P3 {\n const uv = k.uvBounds(face)\n const u = (uv.uMin + uv.uMax) / 2\n const vv = (uv.vMin + uv.vMax) / 2\n const n = k.surfaceNormal(face, u, vv)\n const db = k.getBoundingBox(face)\n const ext = [db.xmax - db.xmin, db.ymax - db.ymin, db.zmax - db.zmin]\n const minExt = Math.min(...ext, 1)\n const eps = minExt * 1e-3 + 1e-6\n const center = k.pointOnSurface(face, u, vv)\n const probe = { x: center.x + n.x * eps, y: center.y + n.y * eps, z: center.z + n.z * eps }\n // inside owner ⇒ the candidate normal points inward, so flip it.\n if (k.containsPoint(owner, probe, 1e-9)) {\n return { x: -n.x, y: -n.y, z: -n.z }\n }\n return v(n)\n}\n\n/**\n * Project an edge handle into its `EntityGeom`.\n *\n * @param edge - The kernel edge handle to project.\n * @returns The lazily-evaluable edge geometry (mid-parameter tangent).\n */\nexport function edgeGeom(edge: ShapeHandle): EntityGeom {\n const k = kern()\n const midParams = () => {\n const cp = k.curveParameters(edge)\n return (cp.first + cp.last) / 2\n }\n return {\n kind: 'edge',\n _handle: edge,\n hash: () => k.hashCode(edge, 1e9),\n same: (other: EntityGeom) => k.isSame(edge, other._handle),\n center: () => v(k.curvePointAtParam(edge, midParams())),\n direction: () => v(k.curveTangent(edge, midParams())),\n geomType: () => edgeGeomType(k.curveType(edge)),\n }\n}\n\n/**\n * Project a vertex handle into its `EntityGeom`.\n *\n * @param vertex - The kernel vertex handle to project.\n * @returns The lazily-evaluable vertex geometry (no direction / type).\n */\nexport function vertexGeom(vertex: ShapeHandle): EntityGeom {\n const k = kern()\n const p = k.vertexPosition(vertex)\n return {\n kind: 'vertex',\n _handle: vertex,\n hash: () => k.hashCode(vertex, 1e9),\n same: (other: EntityGeom) => k.isSame(vertex, other._handle),\n center: () => v(p),\n direction: () => null,\n geomType: () => undefined,\n }\n}\n\n/**\n * Get the sub-entity handles of the given topological type from a shape.\n *\n * @param shape - The kernel handle to query.\n * @param type - The topological type to enumerate.\n * @returns The ordered kernel sub-shape handles of that type.\n */\nexport function subShapeHandles(shape: ShapeHandle, type: 'face' | 'edge' | 'vertex'): ShapeHandle[] {\n const k = kern()\n return k.getSubShapes(shape, type) as ShapeHandle[]\n}"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * cadquery-selectors/face — CadQuery face 字符串选择器
3
+ *
4
+ * 等价搬运自 `packages/faijs-cadquery/src/workplane.ts` 的 `resolveFaceSelector`
5
+ * (含其私有 `NAMED_VIEW_TO_AXIS`、`bboxMax`/`bboxMin`、`cad` 单例)。仅 import
6
+ * 路径改为 core 内部相对路径,逻辑逐行不变,零功能增减。
7
+ *
8
+ * @platform occt — face 选择对 BREP 面做枚举/比较,经 `getKernel()` 与
9
+ * `getBrepApi()` 访问 occt 原生内核(getSubShapes / surface 查询等)。
10
+ */
11
+ import type { Shape } from '../../mesh/types.js';
12
+ /**
13
+ * Resolve a CadQuery-style face selector string to the selected face's center
14
+ * point and outward normal.
15
+ *
16
+ * Supported forms: ">Z", "<Z", ">X", "<X", ">Y", "<Y", each with an optional
17
+ * CadQuery-style index suffix like ">Z[-2]", plus the six named views
18
+ * ("front"/"back"/"left"/"right"/"top"/"bottom") which are aliases for the
19
+ * corresponding axis selectors per cadquery/selectors.py:687-694.
20
+ * @param shape - Shape whose BREP faces are enumerated for selection.
21
+ * @param sel - Selector string, e.g. ">Z", "front", ">Z[-2]".
22
+ * @param centerOption - Optional center computation option forwarded to the
23
+ * face-center evaluation.
24
+ * @returns Promise resolving to the selected face's center point and outward
25
+ * normal.
26
+ * @throws Error when the selector matches no face or has unknown syntax
27
+ * (never falls back silently).
28
+ */
29
+ export declare function resolveFaceSelector(shape: Shape, sel: string, centerOption?: string): Promise<{
30
+ center: [number, number, number];
31
+ normal: [number, number, number];
32
+ }>;
33
+ //# sourceMappingURL=face.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAuE7C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CAsQjF"}