@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,345 @@
1
+ /**
2
+ * cadquery-selectors/grammar — CadQuery string-syntax selector grammar.
3
+ *
4
+ * Hand-rolled recursive-descent parser mirroring the upstream grammar
5
+ * `cadquery/selectors.py::_makeGrammar` + `_makeExpressionGrammar`. No
6
+ * pyparsing dependency is introduced; this small grammar is hand-parsed.
7
+ *
8
+ * Precedence (pyparsing infix_notation lists operators lowest→highest):
9
+ * `and` (lowest) < `or` < `exc`/`except` < `not` (highest)
10
+ * so `not` binds tightest and `and` sits at the root of the tree.
11
+ *
12
+ * Atom forms (upstream `_makeGrammar`):
13
+ * * bare direction `X`|`Y`|`Z`|`XY`|`XZ`|`YZ`|`(x,y,z)` → DirectionSelector
14
+ * * named view `front`|`back`|`left`|`right`|`top`|`bottom` → DirectionMinMax
15
+ * * `%TYPE` type_op + caseless LUT member (upcased) → TypeSelector
16
+ * * `>A` / `>A[k]` direction_op + dir + optional index → DirectionNth
17
+ * * `>>A` / `<<A[k]` center_nth_op + dir + optional index → CenterNth
18
+ * * `|A`|`#A`|`+A`|`-A` other_op + direction → Parallel / Perp / Direction
19
+ *
20
+ * Binary operators fold their operands into a single n-ary node, matching the
21
+ * pyparsing odd-indexed reduce in the upstream callbacks.
22
+ */
23
+ /**
24
+ * The complete set of syntax features this grammar supports, in one place.
25
+ * The selector-parity plan drives its coverage gate off this list — adding a
26
+ * syntax feature without a coverage entry fails that gate.
27
+ */
28
+ export const SYNTAX_FEATURES = [
29
+ // operator modifiers
30
+ ...['>', '<', '>>', '<<', '|', '#', '+', '-', '%'].map((token) => ({
31
+ group: 'modifier',
32
+ name: token,
33
+ token,
34
+ })),
35
+ // axes
36
+ ...['X', 'Y', 'Z', 'XY', 'XZ', 'YZ', '(x,y,z)'].map((token) => ({
37
+ group: 'axis',
38
+ name: token,
39
+ token,
40
+ })),
41
+ // type filter
42
+ ...['PLANE', 'CYLINDER', 'CONE', 'SPHERE', 'TORUS', 'BEZIER', 'BSPLINE', 'REVOLUTION', 'EXTRUSION', 'OFFSET', 'OTHER', 'LINE', 'CIRCLE', 'ELLIPSE', 'HYPERBOLA', 'PARABOLA'].map((token) => ({ group: 'type', name: token.toLowerCase(), token })),
43
+ // named views
44
+ ...['front', 'back', 'left', 'right', 'top', 'bottom'].map((token) => ({
45
+ group: 'view',
46
+ name: token,
47
+ token,
48
+ })),
49
+ // logical connectives
50
+ ...['and', 'or', 'exc', 'except', 'not'].map((token) => ({
51
+ group: 'logical',
52
+ name: token,
53
+ token,
54
+ })),
55
+ // index suffix
56
+ { group: 'index', name: '[k]', token: '[k]' },
57
+ ];
58
+ /** Named views → (direction, max) — upstream `_SimpleStringSyntaxSelector.namedViews`. */
59
+ export const NAMED_VIEW = {
60
+ front: { vec: { x: 0, y: 0, z: 1 }, max: true },
61
+ back: { vec: { x: 0, y: 0, z: 1 }, max: false },
62
+ left: { vec: { x: 1, y: 0, z: 0 }, max: false },
63
+ right: { vec: { x: 1, y: 0, z: 0 }, max: true },
64
+ top: { vec: { x: 0, y: 1, z: 0 }, max: true },
65
+ bottom: { vec: { x: 0, y: 1, z: 0 }, max: false },
66
+ };
67
+ /** Axes table — upstream `_SimpleStringSyntaxSelector.axes` (kept NON-unit). */
68
+ export const AXES = {
69
+ X: { x: 1, y: 0, z: 0 },
70
+ Y: { x: 0, y: 1, z: 0 },
71
+ Z: { x: 0, y: 0, z: 1 },
72
+ XY: { x: 1, y: 1, z: 0 },
73
+ YZ: { x: 0, y: 1, z: 1 },
74
+ XZ: { x: 1, y: 0, z: 1 },
75
+ };
76
+ /** Valid `%type` names — union of upstream geom_LUT_EDGE ∪ geom_LUT_FACE values. */
77
+ export const TYPE_NAMES = new Set([
78
+ 'PLANE', 'CYLINDER', 'CONE', 'SPHERE', 'TORUS', 'BEZIER', 'BSPLINE',
79
+ 'REVOLUTION', 'EXTRUSION', 'OFFSET', 'OTHER',
80
+ 'LINE', 'CIRCLE', 'ELLIPSE', 'HYPERBOLA', 'PARABOLA',
81
+ ]);
82
+ function lex(src) {
83
+ const out = [];
84
+ let i = 0;
85
+ const n = src.length;
86
+ while (i < n) {
87
+ const c = src[i];
88
+ if (/\s/.test(c)) {
89
+ i++;
90
+ continue;
91
+ }
92
+ // multi-char direction selectors must be checked before their single char
93
+ if ((c === '>' || c === '<') && src[i + 1] === c) {
94
+ out.push({ t: 'op', v: c + c });
95
+ i += 2;
96
+ continue;
97
+ }
98
+ if (c === '(' || c === ')' || c === '[' || c === ']' || c === ',') {
99
+ out.push({ t: 'op', v: c });
100
+ i++;
101
+ continue;
102
+ }
103
+ if (c === '>' || c === '<' || c === '|' || c === '#' || c === '%') {
104
+ out.push({ t: 'op', v: c });
105
+ i++;
106
+ continue;
107
+ }
108
+ // `+` and `-` are context-dependent: operator (`+Z`) or sign (`[-1]`, `(-1,0,0)`).
109
+ if (c === '+' || c === '-') {
110
+ out.push({ t: 'op', v: c });
111
+ i++;
112
+ continue;
113
+ }
114
+ if (/[0-9]/.test(c) || c === '.') {
115
+ let j = i;
116
+ while (j < n && /[0-9.]/.test(src[j]))
117
+ j++;
118
+ out.push({ t: 'num', v: src.slice(i, j) });
119
+ i = j;
120
+ continue;
121
+ }
122
+ if (/[A-Za-z]/.test(c)) {
123
+ let j = i;
124
+ while (j < n && /[A-Za-z0-9_]/.test(src[j]))
125
+ j++;
126
+ out.push({ t: 'word', v: src.slice(i, j) });
127
+ i = j;
128
+ continue;
129
+ }
130
+ throw new SyntaxError(`[cadquery-selectors] unexpected character "${c}" at ${i}`);
131
+ }
132
+ return out;
133
+ }
134
+ // ── Parser (recursive descent over tokens) ──────────────────────────────────
135
+ class Parser {
136
+ toks;
137
+ pos = 0;
138
+ constructor(src) {
139
+ this.toks = lex(src);
140
+ }
141
+ peek() {
142
+ return this.toks[this.pos];
143
+ }
144
+ next() {
145
+ return this.toks[this.pos++];
146
+ }
147
+ eof() {
148
+ return this.pos >= this.toks.length;
149
+ }
150
+ /** Consume an operator token with value `v`, or throw. */
151
+ eatOp(v) {
152
+ const t = this.peek();
153
+ if (!t || t.t !== 'op' || t.v !== v) {
154
+ throw new SyntaxError(`[cadquery-selectors] expected "${v}"`);
155
+ }
156
+ this.pos++;
157
+ }
158
+ /** Look at current token: is it an operator token with value v? */
159
+ atOp(v) {
160
+ const t = this.peek();
161
+ return !!t && t.t === 'op' && t.v === v;
162
+ }
163
+ /** Look at current token: is it the given keyword (case-insensitive)? */
164
+ atWord(w) {
165
+ const t = this.peek();
166
+ return !!t && t.t === 'word' && t.v.toLowerCase() === w;
167
+ }
168
+ parse() {
169
+ const expr = this.parseAnd();
170
+ if (!this.eof()) {
171
+ throw new SyntaxError(`[cadquery-selectors] trailing input at position ${this.pos}`);
172
+ }
173
+ return expr;
174
+ }
175
+ // `and` — lowest precedence; left-associative n-ary fold.
176
+ parseAnd() {
177
+ const terms = [this.parseOr()];
178
+ while (this.atWord('and')) {
179
+ this.pos++;
180
+ terms.push(this.parseOr());
181
+ }
182
+ return terms.length === 1 ? terms[0] : { op: 'and', terms };
183
+ }
184
+ parseOr() {
185
+ const terms = [this.parseExc()];
186
+ while (this.atWord('or')) {
187
+ this.pos++;
188
+ terms.push(this.parseExc());
189
+ }
190
+ return terms.length === 1 ? terms[0] : { op: 'or', terms };
191
+ }
192
+ parseExc() {
193
+ const terms = [this.parseNot()];
194
+ while (this.atWord('exc') || this.atWord('except')) {
195
+ this.pos++;
196
+ terms.push(this.parseNot());
197
+ }
198
+ return terms.length === 1 ? terms[0] : { op: 'exc', terms };
199
+ }
200
+ // `not` — highest precedence, unary, right-associative.
201
+ parseNot() {
202
+ if (this.atWord('not')) {
203
+ this.pos++;
204
+ return { op: 'not', term: this.parseNot() };
205
+ }
206
+ if (this.atOp('(')) {
207
+ this.pos++;
208
+ const inner = this.parseAnd();
209
+ this.eatOp(')');
210
+ return inner;
211
+ }
212
+ return { op: 'atom', desc: this.parseAtom() };
213
+ }
214
+ /** Parse an axis directive: bare word (X/Y/Z/XY/YZ/XZ) or `(x,y,z)` vector. */
215
+ parseDirection() {
216
+ const t = this.peek();
217
+ if (t && t.t === 'word') {
218
+ const up = t.v.toUpperCase();
219
+ if (up in AXES) {
220
+ this.pos++;
221
+ return AXES[up];
222
+ }
223
+ return null;
224
+ }
225
+ if (t && t.t === 'op' && t.v === '(') {
226
+ this.pos++;
227
+ const x = this.parseNumber();
228
+ this.eatOp(',');
229
+ const y = this.parseNumber();
230
+ this.eatOp(',');
231
+ const z = this.parseNumber();
232
+ this.eatOp(')');
233
+ return { x, y, z };
234
+ }
235
+ return null;
236
+ }
237
+ /**
238
+ * Parse a numeric literal, allowing an optional leading `+`/`-`. Numeric
239
+ * grammar from upstream: integer [. [integer]] where integer = sign? digits.
240
+ */
241
+ parseNumber() {
242
+ let sign = 1;
243
+ if (this.atOp('-') || this.atOp('+')) {
244
+ if (this.atOp('-'))
245
+ sign = -1;
246
+ this.pos++;
247
+ }
248
+ // ensure a numeric literal follows the sign
249
+ if (!this.peek() || this.peek().t !== 'num') {
250
+ throw new SyntaxError('[cadquery-selectors] expected a number');
251
+ }
252
+ const raw = this.next().v;
253
+ const v = Number(raw);
254
+ if (!Number.isFinite(v))
255
+ throw this.error('invalid number');
256
+ return sign * v;
257
+ }
258
+ /** Consume an optional index `[k]` where k is a signed integer; null if absent. */
259
+ parseIndex() {
260
+ if (!this.atOp('['))
261
+ return null;
262
+ this.pos++;
263
+ const n = Math.trunc(this.parseNumber());
264
+ this.eatOp(']');
265
+ return { n };
266
+ }
267
+ error(msg) {
268
+ return new SyntaxError(`[cadquery-selectors] ${msg}`);
269
+ }
270
+ /** Parse a single atom (a leaf of the expression). Throws on unknown atom. */
271
+ parseAtom() {
272
+ const t = this.peek();
273
+ if (!t)
274
+ throw this.error('unexpected end of expression');
275
+ // 1. bare direction — a word that is an axis name maps to DirectionSelector.
276
+ if (t.t === 'word' && t.v.toUpperCase() in AXES) {
277
+ this.pos++;
278
+ return { kind: 'dir', vec: AXES[t.v.toUpperCase()] };
279
+ }
280
+ // 2. %TYPE
281
+ if (t.t === 'op' && t.v === '%') {
282
+ this.pos++;
283
+ const nameT = this.next();
284
+ if (!nameT || nameT.t !== 'word')
285
+ throw this.error('`%` must be followed by a geometry type');
286
+ const up = nameT.v.toUpperCase();
287
+ if (!TYPE_NAMES.has(up))
288
+ throw this.error(`invalid geometry type "%${nameT.v}"`);
289
+ return { kind: 'type', name: up };
290
+ }
291
+ // 3./4. direction ops and center nth ops
292
+ if (t.t === 'op' && (t.v === '>>' || t.v === '<<')) {
293
+ this.pos++;
294
+ const vec = this.parseDirection();
295
+ if (!vec)
296
+ throw this.error('expected an axis or vector after `' + t.v + '`');
297
+ const idx = this.parseIndex();
298
+ const max = t.v === '>>';
299
+ return { kind: 'centerNth', vec, max, n: idx ? idx.n : null };
300
+ }
301
+ if (t.t === 'op' && (t.v === '>' || t.v === '<')) {
302
+ this.pos++;
303
+ const vec = this.parseDirection();
304
+ if (!vec)
305
+ throw this.error('expected an axis direction after `' + t.v + '`');
306
+ const max = t.v === '>';
307
+ const idx = this.parseIndex();
308
+ if (idx)
309
+ return { kind: 'minmaxNth', vec, max, n: idx.n };
310
+ return { kind: 'minmax', vec, max };
311
+ }
312
+ // 5. other_op — `|` `#` `+` `-`
313
+ if (t.t === 'op' && (t.v === '|' || t.v === '#' || t.v === '+' || t.v === '-')) {
314
+ this.pos++;
315
+ const vec = this.parseDirection();
316
+ if (!vec)
317
+ throw this.error(`expected an axis direction after \`${t.v}\``);
318
+ if (t.v === '|')
319
+ return { kind: 'parallel', vec };
320
+ if (t.v === '#')
321
+ return { kind: 'perpendicular', vec };
322
+ return { kind: 'signed', vec, sign: t.v === '+' ? 1 : -1 };
323
+ }
324
+ // 6. named view
325
+ if (t.t === 'word' && t.v.toLowerCase() in NAMED_VIEW) {
326
+ this.pos++;
327
+ const nv = NAMED_VIEW[t.v.toLowerCase()];
328
+ return { kind: 'minmax', vec: nv.vec, max: nv.max };
329
+ }
330
+ throw this.error(`unsupported selector atom near "${JSON.stringify(t)}"`);
331
+ }
332
+ }
333
+ /**
334
+ * Parse a raw CadQuery selector expression string into an AST.
335
+ *
336
+ * @param expr - The CadQuery selector string (e.g. `">Z and |X"`).
337
+ * @returns The parsed selector AST.
338
+ */
339
+ export function parseSelector(expr) {
340
+ if (expr == null || expr.trim() === '') {
341
+ throw new SyntaxError('[cadquery-selectors] selector expression may not be empty');
342
+ }
343
+ return new Parser(expr).parse();
344
+ }
345
+ //# sourceMappingURL=grammar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grammar.js","sourceRoot":"","sources":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E,CAAC,GAAG,EAAE,CAAA;QACrD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC3E,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,WAAW,CAAC,2DAA2D,CAAC,CAAA;IACpF,CAAC;IACD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;AACjC,CAAC","sourcesContent":["/**\n * cadquery-selectors/grammar — CadQuery string-syntax selector grammar.\n *\n * Hand-rolled recursive-descent parser mirroring the upstream grammar\n * `cadquery/selectors.py::_makeGrammar` + `_makeExpressionGrammar`. No\n * pyparsing dependency is introduced; this small grammar is hand-parsed.\n *\n * Precedence (pyparsing infix_notation lists operators lowest→highest):\n * `and` (lowest) < `or` < `exc`/`except` < `not` (highest)\n * so `not` binds tightest and `and` sits at the root of the tree.\n *\n * Atom forms (upstream `_makeGrammar`):\n * * bare direction `X`|`Y`|`Z`|`XY`|`XZ`|`YZ`|`(x,y,z)` → DirectionSelector\n * * named view `front`|`back`|`left`|`right`|`top`|`bottom` → DirectionMinMax\n * * `%TYPE` type_op + caseless LUT member (upcased) → TypeSelector\n * * `>A` / `>A[k]` direction_op + dir + optional index → DirectionNth\n * * `>>A` / `<<A[k]` center_nth_op + dir + optional index → CenterNth\n * * `|A`|`#A`|`+A`|`-A` other_op + direction → Parallel / Perp / Direction\n *\n * Binary operators fold their operands into a single n-ary node, matching the\n * pyparsing odd-indexed reduce in the upstream callbacks.\n */\n\nimport type { AtomDesc, SelectorExpr, Vec3 } from './types'\n\n/**\n * The complete set of syntax features this grammar supports, in one place.\n * The selector-parity plan drives its coverage gate off this list — adding a\n * syntax feature without a coverage entry fails that gate.\n */\nexport const SYNTAX_FEATURES: { group: string; name: string; token: string }[] = [\n // operator modifiers\n ...['>', '<', '>>', '<<', '|', '#', '+', '-', '%'].map((token) => ({\n group: 'modifier',\n name: token,\n token,\n })),\n // axes\n ...['X', 'Y', 'Z', 'XY', 'XZ', 'YZ', '(x,y,z)'].map((token) => ({\n group: 'axis',\n name: token,\n token,\n })),\n // type filter\n ...['PLANE', 'CYLINDER', 'CONE', 'SPHERE', 'TORUS', 'BEZIER', 'BSPLINE', 'REVOLUTION', 'EXTRUSION', 'OFFSET', 'OTHER', 'LINE', 'CIRCLE', 'ELLIPSE', 'HYPERBOLA', 'PARABOLA'].map(\n (token) => ({ group: 'type', name: token.toLowerCase(), token }),\n ),\n // named views\n ...['front', 'back', 'left', 'right', 'top', 'bottom'].map((token) => ({\n group: 'view',\n name: token,\n token,\n })),\n // logical connectives\n ...['and', 'or', 'exc', 'except', 'not'].map((token) => ({\n group: 'logical',\n name: token,\n token,\n })),\n // index suffix\n { group: 'index', name: '[k]', token: '[k]' },\n]\n\n/** Named views → (direction, max) — upstream `_SimpleStringSyntaxSelector.namedViews`. */\nexport const NAMED_VIEW: Record<string, { vec: Vec3; max: boolean }> = {\n front: { vec: { x: 0, y: 0, z: 1 }, max: true },\n back: { vec: { x: 0, y: 0, z: 1 }, max: false },\n left: { vec: { x: 1, y: 0, z: 0 }, max: false },\n right: { vec: { x: 1, y: 0, z: 0 }, max: true },\n top: { vec: { x: 0, y: 1, z: 0 }, max: true },\n bottom: { vec: { x: 0, y: 1, z: 0 }, max: false },\n}\n\n/** Axes table — upstream `_SimpleStringSyntaxSelector.axes` (kept NON-unit). */\nexport const AXES: Record<string, Vec3> = {\n X: { x: 1, y: 0, z: 0 },\n Y: { x: 0, y: 1, z: 0 },\n Z: { x: 0, y: 0, z: 1 },\n XY: { x: 1, y: 1, z: 0 },\n YZ: { x: 0, y: 1, z: 1 },\n XZ: { x: 1, y: 0, z: 1 },\n}\n\n/** Valid `%type` names — union of upstream geom_LUT_EDGE ∪ geom_LUT_FACE values. */\nexport const TYPE_NAMES: ReadonlySet<string> = new Set([\n 'PLANE', 'CYLINDER', 'CONE', 'SPHERE', 'TORUS', 'BEZIER', 'BSPLINE',\n 'REVOLUTION', 'EXTRUSION', 'OFFSET', 'OTHER',\n 'LINE', 'CIRCLE', 'ELLIPSE', 'HYPERBOLA', 'PARABOLA',\n])\n\n// ── Lexer ───────────────────────────────────────────────────────────────────\n\ntype Tok =\n | { t: 'op'; v: string } // multi/single-char operator or bracket / comma\n | { t: 'word'; v: string } // identifier / keyword (upstream Word())\n | { t: 'num'; v: string } // numeric literal string (kept raw; no sign)\n\nfunction lex(src: string): Tok[] {\n const out: Tok[] = []\n let i = 0\n const n = src.length\n while (i < n) {\n const c = src[i]\n if (/\\s/.test(c)) {\n i++\n continue\n }\n // multi-char direction selectors must be checked before their single char\n if ((c === '>' || c === '<') && src[i + 1] === c) {\n out.push({ t: 'op', v: c + c })\n i += 2\n continue\n }\n if (c === '(' || c === ')' || c === '[' || c === ']' || c === ',') {\n out.push({ t: 'op', v: c })\n i++\n continue\n }\n if (c === '>' || c === '<' || c === '|' || c === '#' || c === '%') {\n out.push({ t: 'op', v: c })\n i++\n continue\n }\n // `+` and `-` are context-dependent: operator (`+Z`) or sign (`[-1]`, `(-1,0,0)`).\n if (c === '+' || c === '-') {\n out.push({ t: 'op', v: c })\n i++\n continue\n }\n if (/[0-9]/.test(c) || c === '.') {\n let j = i\n while (j < n && /[0-9.]/.test(src[j])) j++\n out.push({ t: 'num', v: src.slice(i, j) })\n i = j\n continue\n }\n if (/[A-Za-z]/.test(c)) {\n let j = i\n while (j < n && /[A-Za-z0-9_]/.test(src[j])) j++\n out.push({ t: 'word', v: src.slice(i, j) })\n i = j\n continue\n }\n throw new SyntaxError(`[cadquery-selectors] unexpected character \"${c}\" at ${i}`)\n }\n return out\n}\n\n// ── Parser (recursive descent over tokens) ──────────────────────────────────\n\nclass Parser {\n private readonly toks: Tok[]\n private pos = 0\n\n constructor(src: string) {\n this.toks = lex(src)\n }\n\n private peek(): Tok | undefined {\n return this.toks[this.pos]\n }\n\n private next(): Tok | undefined {\n return this.toks[this.pos++]\n }\n\n private eof(): boolean {\n return this.pos >= this.toks.length\n }\n\n /** Consume an operator token with value `v`, or throw. */\n private eatOp(v: string): void {\n const t = this.peek()\n if (!t || t.t !== 'op' || t.v !== v) {\n throw new SyntaxError(`[cadquery-selectors] expected \"${v}\"`)\n }\n this.pos++\n }\n\n /** Look at current token: is it an operator token with value v? */\n private atOp(v: string): boolean {\n const t = this.peek()\n return !!t && t.t === 'op' && t.v === v\n }\n\n /** Look at current token: is it the given keyword (case-insensitive)? */\n private atWord(w: string): boolean {\n const t = this.peek()\n return !!t && t.t === 'word' && t.v.toLowerCase() === w\n }\n\n parse(): SelectorExpr {\n const expr = this.parseAnd()\n if (!this.eof()) {\n throw new SyntaxError(`[cadquery-selectors] trailing input at position ${this.pos}`)\n }\n return expr\n }\n\n // `and` — lowest precedence; left-associative n-ary fold.\n private parseAnd(): SelectorExpr {\n const terms: SelectorExpr[] = [this.parseOr()]\n while (this.atWord('and')) {\n this.pos++\n terms.push(this.parseOr())\n }\n return terms.length === 1 ? terms[0]! : { op: 'and', terms }\n }\n\n private parseOr(): SelectorExpr {\n const terms: SelectorExpr[] = [this.parseExc()]\n while (this.atWord('or')) {\n this.pos++\n terms.push(this.parseExc())\n }\n return terms.length === 1 ? terms[0]! : { op: 'or', terms }\n }\n\n private parseExc(): SelectorExpr {\n const terms: SelectorExpr[] = [this.parseNot()]\n while (this.atWord('exc') || this.atWord('except')) {\n this.pos++\n terms.push(this.parseNot())\n }\n return terms.length === 1 ? terms[0]! : { op: 'exc', terms }\n }\n\n // `not` — highest precedence, unary, right-associative.\n private parseNot(): SelectorExpr {\n if (this.atWord('not')) {\n this.pos++\n return { op: 'not', term: this.parseNot() }\n }\n if (this.atOp('(')) {\n this.pos++\n const inner = this.parseAnd()\n this.eatOp(')')\n return inner\n }\n return { op: 'atom', desc: this.parseAtom() }\n }\n\n /** Parse an axis directive: bare word (X/Y/Z/XY/YZ/XZ) or `(x,y,z)` vector. */\n private parseDirection(): Vec3 | null {\n const t = this.peek()\n if (t && t.t === 'word') {\n const up = t.v.toUpperCase()\n if (up in AXES) {\n this.pos++\n return AXES[up]!\n }\n return null\n }\n if (t && t.t === 'op' && t.v === '(') {\n this.pos++\n const x = this.parseNumber()\n this.eatOp(',')\n const y = this.parseNumber()\n this.eatOp(',')\n const z = this.parseNumber()\n this.eatOp(')')\n return { x, y, z }\n }\n return null\n }\n\n /**\n * Parse a numeric literal, allowing an optional leading `+`/`-`. Numeric\n * grammar from upstream: integer [. [integer]] where integer = sign? digits.\n */\n private parseNumber(): number {\n let sign = 1\n if (this.atOp('-') || this.atOp('+')) {\n if (this.atOp('-')) sign = -1\n this.pos++\n }\n // ensure a numeric literal follows the sign\n if (!this.peek() || this.peek()!.t !== 'num') {\n throw new SyntaxError('[cadquery-selectors] expected a number')\n }\n const raw = (this.next() as Tok & { t: 'num' }).v\n const v = Number(raw)\n if (!Number.isFinite(v)) throw this.error('invalid number')\n return sign * v\n }\n\n /** Consume an optional index `[k]` where k is a signed integer; null if absent. */\n private parseIndex(): { n: number } | null {\n if (!this.atOp('[')) return null\n this.pos++\n const n = Math.trunc(this.parseNumber())\n this.eatOp(']')\n return { n }\n }\n\n private error(msg: string): SyntaxError {\n return new SyntaxError(`[cadquery-selectors] ${msg}`)\n }\n\n /** Parse a single atom (a leaf of the expression). Throws on unknown atom. */\n private parseAtom(): AtomDesc {\n const t = this.peek()\n if (!t) throw this.error('unexpected end of expression')\n\n // 1. bare direction — a word that is an axis name maps to DirectionSelector.\n if (t.t === 'word' && t.v.toUpperCase() in AXES) {\n this.pos++\n return { kind: 'dir', vec: AXES[t.v.toUpperCase()]! }\n }\n\n // 2. %TYPE\n if (t.t === 'op' && t.v === '%') {\n this.pos++\n const nameT = this.next()\n if (!nameT || nameT.t !== 'word') throw this.error('`%` must be followed by a geometry type')\n const up = nameT.v.toUpperCase()\n if (!TYPE_NAMES.has(up)) throw this.error(`invalid geometry type \"%${nameT.v}\"`)\n return { kind: 'type', name: up }\n }\n\n // 3./4. direction ops and center nth ops\n if (t.t === 'op' && (t.v === '>>' || t.v === '<<')) {\n this.pos++\n const vec = this.parseDirection()\n if (!vec) throw this.error('expected an axis or vector after `' + t.v + '`')\n const idx = this.parseIndex()\n const max = t.v === '>>'\n return { kind: 'centerNth', vec, max, n: idx ? idx.n : null }\n }\n if (t.t === 'op' && (t.v === '>' || t.v === '<')) {\n this.pos++\n const vec = this.parseDirection()\n if (!vec) throw this.error('expected an axis direction after `' + t.v + '`')\n const max = t.v === '>'\n const idx = this.parseIndex()\n if (idx) return { kind: 'minmaxNth', vec, max, n: idx.n }\n return { kind: 'minmax', vec, max }\n }\n // 5. other_op — `|` `#` `+` `-`\n if (t.t === 'op' && (t.v === '|' || t.v === '#' || t.v === '+' || t.v === '-')) {\n this.pos++\n const vec = this.parseDirection()\n if (!vec) throw this.error(`expected an axis direction after \\`${t.v}\\``)\n if (t.v === '|') return { kind: 'parallel', vec }\n if (t.v === '#') return { kind: 'perpendicular', vec }\n return { kind: 'signed', vec, sign: t.v === '+' ? 1 : -1 }\n }\n\n // 6. named view\n if (t.t === 'word' && t.v.toLowerCase() in NAMED_VIEW) {\n this.pos++\n const nv = NAMED_VIEW[t.v.toLowerCase()]!\n return { kind: 'minmax', vec: nv.vec, max: nv.max }\n }\n\n throw this.error(`unsupported selector atom near \"${JSON.stringify(t)}\"`)\n }\n}\n\n/**\n * Parse a raw CadQuery selector expression string into an AST.\n *\n * @param expr - The CadQuery selector string (e.g. `\">Z and |X\"`).\n * @returns The parsed selector AST.\n */\nexport function parseSelector(expr: string): SelectorExpr {\n if (expr == null || expr.trim() === '') {\n throw new SyntaxError('[cadquery-selectors] selector expression may not be empty')\n }\n return new Parser(expr).parse()\n}"]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * cadquery-selectors — CadQuery 拓扑选择器子系统(独立物理边界)
3
+ *
4
+ * 单一选择器真相的边界(plan §4.5/§4.6):grammar → parseSelector、实体投影
5
+ * (entity.ts)、谓词(predicates.ts)、链式收窄求值(resolve.ts),以及面向
6
+ * faijs `Shape` 的薄适配(face/edge)。cq-compat 只经此处 re-export 消费,
7
+ * 与 faijs 自有的命名 / 血缘 TopoRef 系统物理隔离,不依赖之。
8
+ */
9
+ export { asBrepShape } from './borrow-bridge.js';
10
+ export { resolveFaceSelector } from './face.js';
11
+ export { resolveEdgeSelection, resolveFaceEdgeSelection, resolveVertexSelection } from './edge.js';
12
+ export { parseSelector, SYNTAX_FEATURES, NAMED_VIEW, AXES, TYPE_NAMES } from './grammar.js';
13
+ export type { SelectorExpr, AtomDesc, EntityKind, SelStep, Vec3 } from './types.js';
14
+ export { faceGeom, edgeGeom, vertexGeom, subShapeHandles, orientedFaceNormal, faceGeomType, edgeGeomType, type EntityGeom, type P3, type ShapeHandle, } from './entity.js';
15
+ export { DIR_TOLERANCE, NTH_TOLERANCE, } from './predicates.js';
16
+ export { isParallel, isPerpendicular, isAligned, isDirectionCandidate, typeMatches, entityDirection, } from './predicates.js';
17
+ export { resolveSelection, resolveStepHandles, EmptyNthError, type ChainResult, type Selection, } from './resolve.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAC/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACxF,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,EAAE,EACP,KAAK,WAAW,GACjB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,UAAU,EACV,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,eAAe,GAChB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,WAAW,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * cadquery-selectors — CadQuery 拓扑选择器子系统(独立物理边界)
3
+ *
4
+ * 单一选择器真相的边界(plan §4.5/§4.6):grammar → parseSelector、实体投影
5
+ * (entity.ts)、谓词(predicates.ts)、链式收窄求值(resolve.ts),以及面向
6
+ * faijs `Shape` 的薄适配(face/edge)。cq-compat 只经此处 re-export 消费,
7
+ * 与 faijs 自有的命名 / 血缘 TopoRef 系统物理隔离,不依赖之。
8
+ */
9
+ export { asBrepShape } from './borrow-bridge.js';
10
+ export { resolveFaceSelector } from './face.js';
11
+ export { resolveEdgeSelection, resolveFaceEdgeSelection, resolveVertexSelection } from './edge.js';
12
+ export { parseSelector, SYNTAX_FEATURES, NAMED_VIEW, AXES, TYPE_NAMES } from './grammar.js';
13
+ export { faceGeom, edgeGeom, vertexGeom, subShapeHandles, orientedFaceNormal, faceGeomType, edgeGeomType, } from './entity.js';
14
+ export { DIR_TOLERANCE, NTH_TOLERANCE, } from './predicates.js';
15
+ export { isParallel, isPerpendicular, isAligned, isDirectionCandidate, typeMatches, entityDirection, } from './predicates.js';
16
+ export { resolveSelection, resolveStepHandles, EmptyNthError, } from './resolve.js';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAC/F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAExF,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,YAAY,GAIb,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,UAAU,EACV,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,eAAe,GAChB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GAGd,MAAM,WAAW,CAAA","sourcesContent":["/**\n * cadquery-selectors — CadQuery 拓扑选择器子系统(独立物理边界)\n *\n * 单一选择器真相的边界(plan §4.5/§4.6):grammar → parseSelector、实体投影\n * (entity.ts)、谓词(predicates.ts)、链式收窄求值(resolve.ts),以及面向\n * faijs `Shape` 的薄适配(face/edge)。cq-compat 只经此处 re-export 消费,\n * 与 faijs 自有的命名 / 血缘 TopoRef 系统物理隔离,不依赖之。\n */\n\nexport { asBrepShape } from './borrow-bridge'\nexport { resolveFaceSelector } from './face'\nexport { resolveEdgeSelection, resolveFaceEdgeSelection, resolveVertexSelection } from './edge'\nexport { parseSelector, SYNTAX_FEATURES, NAMED_VIEW, AXES, TYPE_NAMES } from './grammar'\nexport type { SelectorExpr, AtomDesc, EntityKind, SelStep, Vec3 } from './types'\nexport {\n faceGeom,\n edgeGeom,\n vertexGeom,\n subShapeHandles,\n orientedFaceNormal,\n faceGeomType,\n edgeGeomType,\n type EntityGeom,\n type P3,\n type ShapeHandle,\n} from './entity'\nexport {\n DIR_TOLERANCE,\n NTH_TOLERANCE,\n} from './predicates'\nexport {\n isParallel,\n isPerpendicular,\n isAligned,\n isDirectionCandidate,\n typeMatches,\n entityDirection,\n} from './predicates'\nexport {\n resolveSelection,\n resolveStepHandles,\n EmptyNthError,\n type ChainResult,\n type Selection,\n} from './resolve'"]}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * cadquery-selectors/predicates — per-entity boolean tests mirroring
3
+ * cadquery/selectors.py (plan §4.4). These are the clean-room re-encoding of
4
+ * the upstream selector classes, grounded by a probe of the LOCKED cadquery
5
+ * 2.8.0 reference behavior.
6
+ *
7
+ * Two families:
8
+ * - **cluster-free tests** — direction / parallel / perpendicular / type;
9
+ * evaluated per candidate entity over the ordered set.
10
+ * - **cluster-based extraction** — minmax / center-nth / direction-nth;
11
+ * these sort candidates by center-projection on an axis and pick a cluster,
12
+ * mirroring `_NthSelector.cluster` + `filter` (implemented in resolve.ts).
13
+ *
14
+ * The base direction-motivated selectors apply ONLY to *linear edges* and
15
+ * *planar faces*; every other entity is dropped (upstream `BaseDirSelector`
16
+ * `continue`s for those, selectors.py:174-184).
17
+ */
18
+ import type { EntityGeom, P3, ShapeHandle } from './entity.js';
19
+ /** Tolerance used by the direction selectors (upstream default 1e-4 rad). */
20
+ export declare const DIR_TOLERANCE = 0.0001;
21
+ /** Tolerance used by the N-th clustering (upstream `_NthSelector.tolerance`). */
22
+ export declare const NTH_TOLERANCE = 0.0001;
23
+ /**
24
+ * `ParallelDirSelector` semantics: the direction (normal/tangent) is parallel
25
+ * to `axis` — the unit dot is ≈ ±1.
26
+ *
27
+ * @param dir - The candidate direction vector (face normal / edge tangent).
28
+ * @param axis - The unit direction of the selector axis.
29
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
30
+ * @returns `true` when `dir` is (anti)parallel to `axis`.
31
+ */
32
+ export declare function isParallel(dir: P3, axis: P3, tolerance?: number): boolean;
33
+ /**
34
+ * `PerpendicularDirSelector` semantics: angle between direction and axis ≈ π/2.
35
+ *
36
+ * @param dir - The candidate direction (face normal / edge tangent).
37
+ * @param axis - The unit direction of the selector axis.
38
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
39
+ * @returns `true` when `dir` is perpendicular to `axis`.
40
+ */
41
+ export declare function isPerpendicular(dir: P3, axis: P3, tolerance?: number): boolean;
42
+ /**
43
+ * `DirectionSelector` (`+`/`-`/bare) semantics: the direction is within
44
+ * tolerance of the *signed* axis.
45
+ *
46
+ * @param dir - The candidate direction (face normal / edge tangent).
47
+ * @param axis - The unit direction of the selector axis.
48
+ * @param sign - `+1` to match the positive axis, `-1` for the negative axis.
49
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
50
+ * @returns `true` when `dir` is aligned to `sign * axis`.
51
+ */
52
+ export declare function isAligned(dir: P3, axis: P3, sign: number, tolerance?: number): boolean;
53
+ /**
54
+ * Whether an entity is examined by a direction test (linear edges, planar faces).
55
+ *
56
+ * @param geom - The candidate entity geometry.
57
+ * @returns `true` when the entity carries a meaningful direction (PLANE / LINE).
58
+ */
59
+ export declare function isDirectionCandidate(geom: EntityGeom): boolean;
60
+ /**
61
+ * `TypeSelector` semantics — match the upcased `geomType()` name.
62
+ *
63
+ * @param geom - The candidate entity geometry.
64
+ * @param want - The upcased CadQuery geometry-type name to match (e.g. `PLANE`).
65
+ * @returns `true` when the entity's `geomType()` equals `want`.
66
+ */
67
+ export declare function typeMatches(geom: EntityGeom, want: string): boolean;
68
+ /**
69
+ * Resolve the direction-bearing vector for an entity, or null when skipped.
70
+ *
71
+ * @param geom - The candidate entity geometry.
72
+ * @param owner - Optional owning shape handle used to orient a face normal.
73
+ * @returns The direction vector for a linear edge / planar face, else `null`.
74
+ */
75
+ export declare function entityDirection(geom: EntityGeom, owner?: ShapeHandle): P3 | null;
76
+ //# sourceMappingURL=predicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/predicates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3D,6EAA6E;AAC7E,eAAO,MAAM,aAAa,SAAO,CAAA;AAEjC,iFAAiF;AACjF,eAAO,MAAM,aAAa,SAAS,CAAA;AAQnC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,SAAgB,GAAG,OAAO,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,SAAgB,GAAG,OAAO,CAErF;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,SAAgB,GAAG,OAAO,CAG7F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAS9D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,EAAE,GAAG,IAAI,CAGhF"}
@@ -0,0 +1,85 @@
1
+ /** Tolerance used by the direction selectors (upstream default 1e-4 rad). */
2
+ export const DIR_TOLERANCE = 1e-4;
3
+ /** Tolerance used by the N-th clustering (upstream `_NthSelector.tolerance`). */
4
+ export const NTH_TOLERANCE = 0.0001;
5
+ function unitDot(a, b) {
6
+ const al = Math.hypot(a.x, a.y, a.z) || 1;
7
+ const bl = Math.hypot(b.x, b.y, b.z) || 1;
8
+ return (a.x * b.x + a.y * b.y + a.z * b.z) / (al * bl);
9
+ }
10
+ /**
11
+ * `ParallelDirSelector` semantics: the direction (normal/tangent) is parallel
12
+ * to `axis` — the unit dot is ≈ ±1.
13
+ *
14
+ * @param dir - The candidate direction vector (face normal / edge tangent).
15
+ * @param axis - The unit direction of the selector axis.
16
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
17
+ * @returns `true` when `dir` is (anti)parallel to `axis`.
18
+ */
19
+ export function isParallel(dir, axis, tolerance = DIR_TOLERANCE) {
20
+ return Math.abs(unitDot(dir, axis)) >= 1 - tolerance;
21
+ }
22
+ /**
23
+ * `PerpendicularDirSelector` semantics: angle between direction and axis ≈ π/2.
24
+ *
25
+ * @param dir - The candidate direction (face normal / edge tangent).
26
+ * @param axis - The unit direction of the selector axis.
27
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
28
+ * @returns `true` when `dir` is perpendicular to `axis`.
29
+ */
30
+ export function isPerpendicular(dir, axis, tolerance = DIR_TOLERANCE) {
31
+ return Math.abs(unitDot(dir, axis)) <= tolerance;
32
+ }
33
+ /**
34
+ * `DirectionSelector` (`+`/`-`/bare) semantics: the direction is within
35
+ * tolerance of the *signed* axis.
36
+ *
37
+ * @param dir - The candidate direction (face normal / edge tangent).
38
+ * @param axis - The unit direction of the selector axis.
39
+ * @param sign - `+1` to match the positive axis, `-1` for the negative axis.
40
+ * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).
41
+ * @returns `true` when `dir` is aligned to `sign * axis`.
42
+ */
43
+ export function isAligned(dir, axis, sign, tolerance = DIR_TOLERANCE) {
44
+ const d = unitDot(dir, axis);
45
+ return sign >= 0 ? d >= 1 - tolerance : d <= -(1 - tolerance);
46
+ }
47
+ /**
48
+ * Whether an entity is examined by a direction test (linear edges, planar faces).
49
+ *
50
+ * @param geom - The candidate entity geometry.
51
+ * @returns `true` when the entity carries a meaningful direction (PLANE / LINE).
52
+ */
53
+ export function isDirectionCandidate(geom) {
54
+ switch (geom.kind) {
55
+ case 'face':
56
+ return geom.geomType() === 'PLANE';
57
+ case 'edge':
58
+ return geom.geomType() === 'LINE';
59
+ case 'vertex':
60
+ return false;
61
+ }
62
+ }
63
+ /**
64
+ * `TypeSelector` semantics — match the upcased `geomType()` name.
65
+ *
66
+ * @param geom - The candidate entity geometry.
67
+ * @param want - The upcased CadQuery geometry-type name to match (e.g. `PLANE`).
68
+ * @returns `true` when the entity's `geomType()` equals `want`.
69
+ */
70
+ export function typeMatches(geom, want) {
71
+ return geom.geomType() === want;
72
+ }
73
+ /**
74
+ * Resolve the direction-bearing vector for an entity, or null when skipped.
75
+ *
76
+ * @param geom - The candidate entity geometry.
77
+ * @param owner - Optional owning shape handle used to orient a face normal.
78
+ * @returns The direction vector for a linear edge / planar face, else `null`.
79
+ */
80
+ export function entityDirection(geom, owner) {
81
+ if (!isDirectionCandidate(geom))
82
+ return null;
83
+ return geom.direction(owner);
84
+ }
85
+ //# sourceMappingURL=predicates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../../src/api/cadquery-selectors/predicates.ts"],"names":[],"mappings":"AAmBA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAA;AAEjC,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAA;AAEnC,SAAS,OAAO,CAAC,CAAK,EAAE,CAAK;IAC3B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,EAAE,GAAG,IAAI,CAAC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AA;QACpC,KAAK,MAAM;YACT,OAAO,IAAI,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAA;QACnC,KAAK,QAAQ;YACX,OAAO,KAAK,CAAA;IAChB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,IAAY;IACxD,OAAO,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAA;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAgB,EAAE,KAAmB;IACnE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAoB,CAAC,CAAA;AAC7C,CAAC","sourcesContent":["/**\n * cadquery-selectors/predicates — per-entity boolean tests mirroring\n * cadquery/selectors.py (plan §4.4). These are the clean-room re-encoding of\n * the upstream selector classes, grounded by a probe of the LOCKED cadquery\n * 2.8.0 reference behavior.\n *\n * Two families:\n * - **cluster-free tests** — direction / parallel / perpendicular / type;\n * evaluated per candidate entity over the ordered set.\n * - **cluster-based extraction** — minmax / center-nth / direction-nth;\n * these sort candidates by center-projection on an axis and pick a cluster,\n * mirroring `_NthSelector.cluster` + `filter` (implemented in resolve.ts).\n *\n * The base direction-motivated selectors apply ONLY to *linear edges* and\n * *planar faces*; every other entity is dropped (upstream `BaseDirSelector`\n * `continue`s for those, selectors.py:174-184).\n */\nimport type { EntityGeom, P3, ShapeHandle } from './entity'\n\n/** Tolerance used by the direction selectors (upstream default 1e-4 rad). */\nexport const DIR_TOLERANCE = 1e-4\n\n/** Tolerance used by the N-th clustering (upstream `_NthSelector.tolerance`). */\nexport const NTH_TOLERANCE = 0.0001\n\nfunction unitDot(a: P3, b: P3): number {\n const al = Math.hypot(a.x, a.y, a.z) || 1\n const bl = Math.hypot(b.x, b.y, b.z) || 1\n return (a.x * b.x + a.y * b.y + a.z * b.z) / (al * bl)\n}\n\n/**\n * `ParallelDirSelector` semantics: the direction (normal/tangent) is parallel\n * to `axis` — the unit dot is ≈ ±1.\n *\n * @param dir - The candidate direction vector (face normal / edge tangent).\n * @param axis - The unit direction of the selector axis.\n * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).\n * @returns `true` when `dir` is (anti)parallel to `axis`.\n */\nexport function isParallel(dir: P3, axis: P3, tolerance = DIR_TOLERANCE): boolean {\n return Math.abs(unitDot(dir, axis)) >= 1 - tolerance\n}\n\n/**\n * `PerpendicularDirSelector` semantics: angle between direction and axis ≈ π/2.\n *\n * @param dir - The candidate direction (face normal / edge tangent).\n * @param axis - The unit direction of the selector axis.\n * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).\n * @returns `true` when `dir` is perpendicular to `axis`.\n */\nexport function isPerpendicular(dir: P3, axis: P3, tolerance = DIR_TOLERANCE): boolean {\n return Math.abs(unitDot(dir, axis)) <= tolerance\n}\n\n/**\n * `DirectionSelector` (`+`/`-`/bare) semantics: the direction is within\n * tolerance of the *signed* axis.\n *\n * @param dir - The candidate direction (face normal / edge tangent).\n * @param axis - The unit direction of the selector axis.\n * @param sign - `+1` to match the positive axis, `-1` for the negative axis.\n * @param tolerance - Angular tolerance in radians (default `DIR_TOLERANCE`).\n * @returns `true` when `dir` is aligned to `sign * axis`.\n */\nexport function isAligned(dir: P3, axis: P3, sign: number, tolerance = DIR_TOLERANCE): boolean {\n const d = unitDot(dir, axis)\n return sign >= 0 ? d >= 1 - tolerance : d <= -(1 - tolerance)\n}\n\n/**\n * Whether an entity is examined by a direction test (linear edges, planar faces).\n *\n * @param geom - The candidate entity geometry.\n * @returns `true` when the entity carries a meaningful direction (PLANE / LINE).\n */\nexport function isDirectionCandidate(geom: EntityGeom): boolean {\n switch (geom.kind) {\n case 'face':\n return geom.geomType() === 'PLANE'\n case 'edge':\n return geom.geomType() === 'LINE'\n case 'vertex':\n return false\n }\n}\n\n/**\n * `TypeSelector` semantics — match the upcased `geomType()` name.\n *\n * @param geom - The candidate entity geometry.\n * @param want - The upcased CadQuery geometry-type name to match (e.g. `PLANE`).\n * @returns `true` when the entity's `geomType()` equals `want`.\n */\nexport function typeMatches(geom: EntityGeom, want: string): boolean {\n return geom.geomType() === want\n}\n\n/**\n * Resolve the direction-bearing vector for an entity, or null when skipped.\n *\n * @param geom - The candidate entity geometry.\n * @param owner - Optional owning shape handle used to orient a face normal.\n * @returns The direction vector for a linear edge / planar face, else `null`.\n */\nexport function entityDirection(geom: EntityGeom, owner?: ShapeHandle): P3 | null {\n if (!isDirectionCandidate(geom)) return null\n return geom.direction(owner as ShapeHandle)\n}"]}