fluidcad 0.0.33 → 0.0.35

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 (363) hide show
  1. package/README.md +72 -2
  2. package/bin/commands/init.js +55 -0
  3. package/bin/commands/login.js +120 -0
  4. package/bin/commands/mcp.js +33 -0
  5. package/bin/commands/pack.js +49 -0
  6. package/bin/commands/publish.js +136 -0
  7. package/bin/commands/serve.js +77 -0
  8. package/bin/fluidcad.js +21 -107
  9. package/bin/lib/api-client.js +40 -0
  10. package/bin/lib/browser.js +16 -0
  11. package/bin/lib/config.js +39 -0
  12. package/bin/lib/model-config.js +38 -0
  13. package/bin/lib/workspace.js +57 -0
  14. package/lib/dist/common/scene-object.d.ts +2 -1
  15. package/lib/dist/common/scene-object.js +3 -2
  16. package/lib/dist/common/shape-factory.d.ts +2 -1
  17. package/lib/dist/common/shape-factory.js +4 -0
  18. package/lib/dist/common/transformable-primitive.d.ts +6 -5
  19. package/lib/dist/common/transformable-primitive.js +8 -7
  20. package/lib/dist/common/vertex.js +0 -1
  21. package/lib/dist/core/2d/aline.d.ts +4 -3
  22. package/lib/dist/core/2d/aline.js +3 -2
  23. package/lib/dist/core/2d/arc.d.ts +3 -2
  24. package/lib/dist/core/2d/arc.js +4 -3
  25. package/lib/dist/core/2d/bezier.d.ts +8 -6
  26. package/lib/dist/core/2d/circle.d.ts +4 -3
  27. package/lib/dist/core/2d/circle.js +3 -2
  28. package/lib/dist/core/2d/ellipse.d.ts +5 -4
  29. package/lib/dist/core/2d/ellipse.js +5 -4
  30. package/lib/dist/core/2d/hline.d.ts +4 -3
  31. package/lib/dist/core/2d/hline.js +5 -3
  32. package/lib/dist/core/2d/line.js +1 -0
  33. package/lib/dist/core/2d/offset.d.ts +3 -2
  34. package/lib/dist/core/2d/offset.js +6 -5
  35. package/lib/dist/core/2d/polygon.d.ts +5 -4
  36. package/lib/dist/core/2d/polygon.js +10 -9
  37. package/lib/dist/core/2d/rect.d.ts +4 -3
  38. package/lib/dist/core/2d/rect.js +10 -9
  39. package/lib/dist/core/2d/slot.d.ts +14 -6
  40. package/lib/dist/core/2d/slot.js +19 -8
  41. package/lib/dist/core/2d/tarc.d.ts +20 -2
  42. package/lib/dist/core/2d/tarc.js +24 -0
  43. package/lib/dist/core/2d/vline.d.ts +4 -3
  44. package/lib/dist/core/2d/vline.js +5 -3
  45. package/lib/dist/core/chamfer.d.ts +5 -4
  46. package/lib/dist/core/chamfer.js +7 -6
  47. package/lib/dist/core/color.d.ts +3 -2
  48. package/lib/dist/core/color.js +2 -1
  49. package/lib/dist/core/cut.d.ts +4 -3
  50. package/lib/dist/core/cut.js +5 -4
  51. package/lib/dist/core/cylinder.d.ts +2 -1
  52. package/lib/dist/core/cylinder.js +2 -1
  53. package/lib/dist/core/draft.d.ts +3 -2
  54. package/lib/dist/core/draft.js +3 -2
  55. package/lib/dist/core/extrude.d.ts +4 -3
  56. package/lib/dist/core/extrude.js +5 -4
  57. package/lib/dist/core/fillet.d.ts +5 -4
  58. package/lib/dist/core/fillet.js +6 -5
  59. package/lib/dist/core/index.d.ts +1 -0
  60. package/lib/dist/core/index.js +1 -0
  61. package/lib/dist/core/interfaces.d.ts +55 -25
  62. package/lib/dist/core/param.d.ts +74 -0
  63. package/lib/dist/core/param.js +147 -0
  64. package/lib/dist/core/repeat.d.ts +2 -1
  65. package/lib/dist/core/repeat.js +72 -54
  66. package/lib/dist/core/revolve.d.ts +2 -1
  67. package/lib/dist/core/revolve.js +3 -2
  68. package/lib/dist/core/rib.d.ts +3 -2
  69. package/lib/dist/core/rib.js +6 -2
  70. package/lib/dist/core/rotate.d.ts +5 -4
  71. package/lib/dist/core/rotate.js +4 -3
  72. package/lib/dist/core/shell.d.ts +3 -2
  73. package/lib/dist/core/shell.js +3 -2
  74. package/lib/dist/core/sphere.d.ts +3 -2
  75. package/lib/dist/core/sphere.js +2 -1
  76. package/lib/dist/core/translate.d.ts +7 -6
  77. package/lib/dist/core/translate.js +6 -5
  78. package/lib/dist/features/2d/arc.d.ts +8 -2
  79. package/lib/dist/features/2d/arc.js +94 -17
  80. package/lib/dist/features/2d/back.js +3 -2
  81. package/lib/dist/features/2d/bezier.js +16 -16
  82. package/lib/dist/features/2d/circle.js +4 -0
  83. package/lib/dist/features/2d/ellipse.js +4 -0
  84. package/lib/dist/features/2d/hline.d.ts +3 -0
  85. package/lib/dist/features/2d/hline.js +9 -2
  86. package/lib/dist/features/2d/line.d.ts +3 -0
  87. package/lib/dist/features/2d/line.js +11 -3
  88. package/lib/dist/features/2d/sketch.d.ts +4 -0
  89. package/lib/dist/features/2d/sketch.js +25 -0
  90. package/lib/dist/features/2d/slot.d.ts +5 -0
  91. package/lib/dist/features/2d/slot.js +52 -7
  92. package/lib/dist/features/2d/tarc-constrained.d.ts +2 -0
  93. package/lib/dist/features/2d/tarc-constrained.js +8 -0
  94. package/lib/dist/features/2d/tarc-radius-to-object.d.ts +16 -0
  95. package/lib/dist/features/2d/tarc-radius-to-object.js +58 -0
  96. package/lib/dist/features/2d/tarc-to-object.d.ts +18 -0
  97. package/lib/dist/features/2d/tarc-to-object.js +66 -0
  98. package/lib/dist/features/2d/tarc-to-point-tangent.d.ts +2 -0
  99. package/lib/dist/features/2d/tarc-to-point-tangent.js +6 -0
  100. package/lib/dist/features/2d/tarc-to-point.d.ts +2 -0
  101. package/lib/dist/features/2d/tarc-to-point.js +6 -0
  102. package/lib/dist/features/2d/tarc-with-tangent.d.ts +2 -0
  103. package/lib/dist/features/2d/tarc-with-tangent.js +6 -0
  104. package/lib/dist/features/2d/tarc.d.ts +2 -0
  105. package/lib/dist/features/2d/tarc.js +6 -0
  106. package/lib/dist/features/2d/vline.d.ts +3 -0
  107. package/lib/dist/features/2d/vline.js +9 -2
  108. package/lib/dist/features/copy-circular.d.ts +4 -3
  109. package/lib/dist/features/copy-circular.js +16 -9
  110. package/lib/dist/features/copy-circular2d.js +16 -9
  111. package/lib/dist/features/copy-linear.d.ts +4 -3
  112. package/lib/dist/features/copy-linear.js +18 -12
  113. package/lib/dist/features/copy-linear2d.js +18 -12
  114. package/lib/dist/features/extrude-base.d.ts +13 -3
  115. package/lib/dist/features/extrude-base.js +32 -3
  116. package/lib/dist/features/extrude-to-face.js +1 -5
  117. package/lib/dist/features/extrude-two-distances.js +1 -2
  118. package/lib/dist/features/extrude.js +1 -2
  119. package/lib/dist/features/mirror-feature.d.ts +3 -2
  120. package/lib/dist/features/mirror-feature.js +1 -1
  121. package/lib/dist/features/mirror-shape2d.js +2 -2
  122. package/lib/dist/features/repeat-base.d.ts +13 -0
  123. package/lib/dist/features/repeat-base.js +21 -0
  124. package/lib/dist/features/repeat-circular.d.ts +8 -7
  125. package/lib/dist/features/repeat-circular.js +7 -3
  126. package/lib/dist/features/repeat-linear.d.ts +9 -7
  127. package/lib/dist/features/repeat-linear.js +9 -3
  128. package/lib/dist/features/repeat-matrix.d.ts +3 -1
  129. package/lib/dist/features/repeat-matrix.js +7 -2
  130. package/lib/dist/features/shell.d.ts +4 -1
  131. package/lib/dist/features/shell.js +14 -3
  132. package/lib/dist/helpers/clone-transform.d.ts +2 -1
  133. package/lib/dist/index.d.ts +12 -1
  134. package/lib/dist/index.js +11 -4
  135. package/lib/dist/io/file-import.d.ts +7 -0
  136. package/lib/dist/io/file-import.js +30 -10
  137. package/lib/dist/math/lazy-matrix.d.ts +36 -0
  138. package/lib/dist/math/lazy-matrix.js +134 -0
  139. package/lib/dist/oc/boolean-ops.d.ts +2 -2
  140. package/lib/dist/oc/constraints/constraint-solver-adaptor.d.ts +5 -0
  141. package/lib/dist/oc/constraints/constraint-solver-adaptor.js +16 -0
  142. package/lib/dist/oc/constraints/constraint-solver.d.ts +4 -0
  143. package/lib/dist/oc/constraints/curve/curve-constraint-solver.d.ts +4 -0
  144. package/lib/dist/oc/constraints/curve/curve-constraint-solver.js +3 -0
  145. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.d.ts +6 -1
  146. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.js +4 -0
  147. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.d.ts +8 -0
  148. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.js +111 -0
  149. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.d.ts +8 -0
  150. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.js +161 -0
  151. package/lib/dist/oc/mesh.d.ts +9 -4
  152. package/lib/dist/oc/mesh.js +14 -13
  153. package/lib/dist/oc/shell-ops.d.ts +2 -1
  154. package/lib/dist/oc/shell-ops.js +5 -2
  155. package/lib/dist/param-registry.d.ts +34 -0
  156. package/lib/dist/param-registry.js +60 -0
  157. package/lib/dist/rendering/mesh-builder.d.ts +3 -0
  158. package/lib/dist/rendering/mesh-builder.js +10 -5
  159. package/lib/dist/rendering/render-edge.d.ts +2 -1
  160. package/lib/dist/rendering/render-edge.js +2 -2
  161. package/lib/dist/rendering/render-face.d.ts +2 -1
  162. package/lib/dist/rendering/render-face.js +2 -2
  163. package/lib/dist/rendering/render-solid.d.ts +2 -1
  164. package/lib/dist/rendering/render-solid.js +2 -2
  165. package/lib/dist/rendering/render-wire.d.ts +2 -1
  166. package/lib/dist/rendering/render-wire.js +2 -2
  167. package/lib/dist/rendering/render.d.ts +3 -0
  168. package/lib/dist/rendering/render.js +7 -2
  169. package/lib/dist/scene-manager.d.ts +4 -2
  170. package/lib/dist/scene-manager.js +12 -4
  171. package/lib/dist/tests/features/2d/arc.test.js +64 -0
  172. package/lib/dist/tests/features/2d/back.test.js +17 -1
  173. package/lib/dist/tests/features/2d/tarc.test.js +157 -0
  174. package/lib/dist/tests/features/copy-circular.test.js +1 -1
  175. package/lib/dist/tests/features/copy-linear.test.js +10 -10
  176. package/lib/dist/tests/features/repeat-user-repro-cache.test.d.ts +1 -0
  177. package/lib/dist/tests/features/repeat-user-repro-cache.test.js +97 -0
  178. package/lib/dist/tests/features/repeat-user-repro.test.d.ts +1 -0
  179. package/lib/dist/tests/features/repeat-user-repro.test.js +60 -0
  180. package/lib/dist/tests/features/shell.test.js +36 -0
  181. package/lib/dist/tests/global-setup.js +2 -1
  182. package/lib/dist/tests/helpers/extract-blocks.d.ts +9 -0
  183. package/lib/dist/tests/helpers/extract-blocks.js +56 -0
  184. package/lib/dist/tests/llm-docs-examples.test.d.ts +1 -0
  185. package/lib/dist/tests/llm-docs-examples.test.js +62 -0
  186. package/lib/dist/tests/setup.js +2 -1
  187. package/lib/dist/tsconfig.tsbuildinfo +1 -1
  188. package/llm-docs/.coverage-allowlist.txt +9 -0
  189. package/llm-docs/api/arc.md +48 -0
  190. package/llm-docs/api/axis.md +42 -0
  191. package/llm-docs/api/bezier.md +41 -0
  192. package/llm-docs/api/booleans.md +44 -0
  193. package/llm-docs/api/chamfer.md +40 -0
  194. package/llm-docs/api/circle.md +36 -0
  195. package/llm-docs/api/color.md +34 -0
  196. package/llm-docs/api/connect.md +41 -0
  197. package/llm-docs/api/constraint-qualifiers.md +48 -0
  198. package/llm-docs/api/copy.md +63 -0
  199. package/llm-docs/api/cursor-lines.md +50 -0
  200. package/llm-docs/api/cursor-move.md +61 -0
  201. package/llm-docs/api/cut.md +55 -0
  202. package/llm-docs/api/draft.md +36 -0
  203. package/llm-docs/api/edge-filter.md +57 -0
  204. package/llm-docs/api/ellipse.md +34 -0
  205. package/llm-docs/api/extrude.md +74 -0
  206. package/llm-docs/api/face-filter.md +61 -0
  207. package/llm-docs/api/fillet.md +51 -0
  208. package/llm-docs/api/index.json +139 -0
  209. package/llm-docs/api/line.md +42 -0
  210. package/llm-docs/api/load.md +37 -0
  211. package/llm-docs/api/local.md +38 -0
  212. package/llm-docs/api/loft.md +37 -0
  213. package/llm-docs/api/mirror.md +44 -0
  214. package/llm-docs/api/offset.md +36 -0
  215. package/llm-docs/api/part.md +40 -0
  216. package/llm-docs/api/plane.md +44 -0
  217. package/llm-docs/api/polygon.md +37 -0
  218. package/llm-docs/api/primitive-solids.md +39 -0
  219. package/llm-docs/api/project-intersect.md +48 -0
  220. package/llm-docs/api/rect.md +48 -0
  221. package/llm-docs/api/remove.md +32 -0
  222. package/llm-docs/api/repeat.md +79 -0
  223. package/llm-docs/api/revolve.md +38 -0
  224. package/llm-docs/api/rib.md +40 -0
  225. package/llm-docs/api/rotate.md +37 -0
  226. package/llm-docs/api/select.md +41 -0
  227. package/llm-docs/api/shell.md +41 -0
  228. package/llm-docs/api/sketch.md +76 -0
  229. package/llm-docs/api/slot.md +36 -0
  230. package/llm-docs/api/split-trim.md +42 -0
  231. package/llm-docs/api/sweep.md +43 -0
  232. package/llm-docs/api/tarc.md +45 -0
  233. package/llm-docs/api/tcircle.md +38 -0
  234. package/llm-docs/api/tline.md +42 -0
  235. package/llm-docs/api/translate.md +40 -0
  236. package/llm-docs/api/types/aline.md +35 -0
  237. package/llm-docs/api/types/arc-angles.md +29 -0
  238. package/llm-docs/api/types/arc-points.md +48 -0
  239. package/llm-docs/api/types/axis-like.md +38 -0
  240. package/llm-docs/api/types/axis.md +21 -0
  241. package/llm-docs/api/types/boolean-operation.md +50 -0
  242. package/llm-docs/api/types/circular-repeat-options.md +31 -0
  243. package/llm-docs/api/types/common.md +32 -0
  244. package/llm-docs/api/types/cut.md +125 -0
  245. package/llm-docs/api/types/draft.md +21 -0
  246. package/llm-docs/api/types/extrudable-geometry.md +23 -0
  247. package/llm-docs/api/types/extrude.md +194 -0
  248. package/llm-docs/api/types/geometry.md +51 -0
  249. package/llm-docs/api/types/hline.md +35 -0
  250. package/llm-docs/api/types/linear-repeat-options.md +31 -0
  251. package/llm-docs/api/types/loft.md +154 -0
  252. package/llm-docs/api/types/mirror.md +35 -0
  253. package/llm-docs/api/types/offset.md +31 -0
  254. package/llm-docs/api/types/plane-like.md +35 -0
  255. package/llm-docs/api/types/plane-transform-options.md +29 -0
  256. package/llm-docs/api/types/plane.md +21 -0
  257. package/llm-docs/api/types/point-like.md +22 -0
  258. package/llm-docs/api/types/point2dlike.md +26 -0
  259. package/llm-docs/api/types/polygon.md +46 -0
  260. package/llm-docs/api/types/rect.md +128 -0
  261. package/llm-docs/api/types/revolve.md +102 -0
  262. package/llm-docs/api/types/rib.md +133 -0
  263. package/llm-docs/api/types/scene-object.md +33 -0
  264. package/llm-docs/api/types/select.md +21 -0
  265. package/llm-docs/api/types/shell.md +54 -0
  266. package/llm-docs/api/types/slot.md +43 -0
  267. package/llm-docs/api/types/sweep.md +189 -0
  268. package/llm-docs/api/types/tangent-arc-two-objects.md +46 -0
  269. package/llm-docs/api/types/transformable.md +93 -0
  270. package/llm-docs/api/types/trim.md +27 -0
  271. package/llm-docs/api/types/two-objects-tangent-line.md +46 -0
  272. package/llm-docs/api/types/vertex.md +17 -0
  273. package/llm-docs/api/types/vline.md +35 -0
  274. package/llm-docs/concepts/coordinate-system.md +45 -0
  275. package/llm-docs/concepts/history-and-rollback.md +40 -0
  276. package/llm-docs/concepts/last-selection.md +49 -0
  277. package/llm-docs/concepts/scene-graph.md +37 -0
  278. package/llm-docs/index.json +1750 -0
  279. package/mcp/dist/client.d.ts +65 -0
  280. package/mcp/dist/client.js +255 -0
  281. package/mcp/dist/discovery.d.ts +11 -0
  282. package/mcp/dist/discovery.js +78 -0
  283. package/mcp/dist/docs-index.d.ts +81 -0
  284. package/mcp/dist/docs-index.js +261 -0
  285. package/mcp/dist/resources.d.ts +4 -0
  286. package/mcp/dist/resources.js +115 -0
  287. package/mcp/dist/server.d.ts +12 -0
  288. package/mcp/dist/server.js +502 -0
  289. package/mcp/dist/tools/coordination.d.ts +9 -0
  290. package/mcp/dist/tools/coordination.js +46 -0
  291. package/mcp/dist/tools/docs.d.ts +66 -0
  292. package/mcp/dist/tools/docs.js +122 -0
  293. package/mcp/dist/tools/engine.d.ts +72 -0
  294. package/mcp/dist/tools/engine.js +190 -0
  295. package/mcp/dist/tools/inspection.d.ts +75 -0
  296. package/mcp/dist/tools/inspection.js +121 -0
  297. package/mcp/dist/tools/screenshot.d.ts +63 -0
  298. package/mcp/dist/tools/screenshot.js +263 -0
  299. package/mcp/dist/tools/source.d.ts +84 -0
  300. package/mcp/dist/tools/source.js +434 -0
  301. package/mcp/dist/tools/workspaces.d.ts +13 -0
  302. package/mcp/dist/tools/workspaces.js +33 -0
  303. package/mcp/dist/types.d.ts +18 -0
  304. package/mcp/dist/types.js +11 -0
  305. package/package.json +27 -7
  306. package/server/dist/api.d.ts +37 -0
  307. package/server/dist/api.js +44 -0
  308. package/server/dist/code-editor.d.ts +100 -0
  309. package/server/dist/code-editor.js +528 -2
  310. package/server/dist/fluidcad-server.d.ts +118 -1
  311. package/server/dist/fluidcad-server.js +350 -62
  312. package/server/dist/global-registry.d.ts +30 -0
  313. package/server/dist/global-registry.js +126 -0
  314. package/server/dist/host/blocked-imports.d.ts +8 -0
  315. package/server/dist/host/blocked-imports.js +30 -0
  316. package/server/dist/{vite-manager.d.ts → host/local-scene-host.d.ts} +3 -1
  317. package/server/dist/{vite-manager.js → host/local-scene-host.js} +6 -26
  318. package/server/dist/host/scene-host.d.ts +19 -0
  319. package/server/dist/host/scene-host.js +1 -0
  320. package/server/dist/index.js +175 -123
  321. package/server/dist/instance-file.d.ts +31 -0
  322. package/server/dist/instance-file.js +73 -0
  323. package/server/dist/lint-fluid-js.d.ts +15 -0
  324. package/server/dist/lint-fluid-js.js +271 -0
  325. package/server/dist/model-package/capture-params.d.ts +19 -0
  326. package/server/dist/model-package/capture-params.js +42 -0
  327. package/server/dist/model-package/pack.d.ts +23 -0
  328. package/server/dist/model-package/pack.js +229 -0
  329. package/server/dist/model-package/types.d.ts +78 -0
  330. package/server/dist/model-package/types.js +17 -0
  331. package/server/dist/routes/editor.d.ts +24 -0
  332. package/server/dist/routes/editor.js +44 -0
  333. package/server/dist/routes/export.d.ts +1 -1
  334. package/server/dist/routes/export.js +45 -8
  335. package/server/dist/routes/health.d.ts +7 -0
  336. package/server/dist/routes/health.js +14 -0
  337. package/server/dist/routes/hit-test.d.ts +3 -0
  338. package/server/dist/routes/hit-test.js +17 -0
  339. package/server/dist/routes/lint.d.ts +10 -0
  340. package/server/dist/routes/lint.js +28 -0
  341. package/server/dist/routes/pack.d.ts +10 -0
  342. package/server/dist/routes/pack.js +47 -0
  343. package/server/dist/routes/params.d.ts +3 -0
  344. package/server/dist/routes/params.js +75 -0
  345. package/server/dist/routes/render.d.ts +33 -0
  346. package/server/dist/routes/render.js +34 -0
  347. package/server/dist/routes/scene.d.ts +5 -0
  348. package/server/dist/routes/scene.js +48 -0
  349. package/server/dist/routes/screenshot.js +68 -1
  350. package/server/dist/routes/sketch-edits.d.ts +3 -0
  351. package/server/dist/routes/sketch-edits.js +542 -0
  352. package/server/dist/routes/timeline.d.ts +3 -0
  353. package/server/dist/routes/timeline.js +49 -0
  354. package/server/dist/server-core.d.ts +53 -0
  355. package/server/dist/server-core.js +147 -0
  356. package/server/dist/ws-protocol.d.ts +156 -3
  357. package/ui/dist/assets/index-CDJmUpFI.css +2 -0
  358. package/ui/dist/assets/index-MRqwG9Vh.js +5417 -0
  359. package/ui/dist/index.html +2 -2
  360. package/server/dist/routes/actions.d.ts +0 -3
  361. package/server/dist/routes/actions.js +0 -309
  362. package/ui/dist/assets/index-CFi9p7wR.js +0 -4946
  363. package/ui/dist/assets/index-DR7c2Qk9.css +0 -2
@@ -5,6 +5,7 @@ import type { EdgeFilterBuilder } from "../filters/edge/edge-filter.js";
5
5
  import type { Matrix4 } from "../math/matrix4.js";
6
6
  import type { AxisLike } from "../math/axis.js";
7
7
  import type { PlaneLike } from "../math/plane.js";
8
+ import type { NumberParam } from "./param.js";
8
9
  export interface ISceneObject {
9
10
  /**
10
11
  * Sets a custom display name for this object, overriding the default type-based name.
@@ -81,15 +82,15 @@ export interface ITransformable extends ISceneObject {
81
82
  * Translate along X.
82
83
  * @param x - Distance along world X.
83
84
  */
84
- translate(x: number): this;
85
+ translate(x: NumberParam): this;
85
86
  /**
86
87
  * Translate along X and Y.
87
88
  */
88
- translate(x: number, y: number): this;
89
+ translate(x: NumberParam, y: NumberParam): this;
89
90
  /**
90
91
  * Translate along X, Y, and Z.
91
92
  */
92
- translate(x: number, y: number, z: number): this;
93
+ translate(x: NumberParam, y: NumberParam, z: NumberParam): this;
93
94
  /**
94
95
  * Translate by a point-like offset in world space.
95
96
  */
@@ -98,13 +99,13 @@ export interface ITransformable extends ISceneObject {
98
99
  * Rotate by an angle around world Z through the origin.
99
100
  * @param angle - Rotation in degrees.
100
101
  */
101
- rotate(angle: number): this;
102
+ rotate(angle: NumberParam): this;
102
103
  /**
103
104
  * Rotate around an axis by an angle.
104
105
  * @param axis - The axis to rotate around. Use `local(...)` to reference a sketch-local axis.
105
106
  * @param angle - Rotation in degrees.
106
107
  */
107
- rotate(axis: AxisLike, angle: number): this;
108
+ rotate(axis: AxisLike, angle: NumberParam): this;
108
109
  /**
109
110
  * Mirror across a plane.
110
111
  */
@@ -157,13 +158,27 @@ export interface IArcPoints extends IExtrudableGeometry {
157
158
  * Positive = CCW, negative = CW.
158
159
  * @param value - The bulge radius.
159
160
  */
160
- radius(value: number): this;
161
+ radius(value: NumberParam): IArcRadius;
161
162
  /**
162
163
  * Specifies the circle center point for the arc.
163
164
  * Mutually exclusive with `.radius()`.
164
165
  * @param value - The center point of the arc's circle.
165
166
  */
166
- center(value: Point2DLike): this;
167
+ center(value: Point2DLike): IArcCenter;
168
+ }
169
+ export interface IArcRadius extends IExtrudableGeometry {
170
+ /**
171
+ * Switches to the major arc (> 180°).
172
+ * By default, `.radius()` produces the minor arc (< 180°);
173
+ * `.major()` switches to the complementary major arc on the same circle.
174
+ */
175
+ major(): this;
176
+ }
177
+ export interface IArcCenter extends IExtrudableGeometry {
178
+ /**
179
+ * Sweeps the arc clockwise from start to end instead of the default counter-clockwise.
180
+ */
181
+ cw(): this;
167
182
  }
168
183
  export interface IArcAngles extends IExtrudableGeometry {
169
184
  /**
@@ -245,7 +260,7 @@ export interface ISlot extends IExtrudableGeometry {
245
260
  * Sets the rotation angle of the slot's primary axis.
246
261
  * @param angle - Rotation in degrees.
247
262
  */
248
- rotate(angle: number): this;
263
+ rotate(angle: NumberParam): this;
249
264
  }
250
265
  export interface IALine extends IGeometry {
251
266
  /**
@@ -298,6 +313,14 @@ export interface ITwoObjectsTangentLine extends IGeometry {
298
313
  */
299
314
  end(index?: number): LazyVertex;
300
315
  }
316
+ export interface ITangentArcToObject extends IGeometry {
317
+ /**
318
+ * Flips the arc to the opposite side of the start tangent. By default,
319
+ * the arc curves to the left of the current tangent direction;
320
+ * `.flip()` switches it to the right.
321
+ */
322
+ flip(): this;
323
+ }
301
324
  export interface ITangentArcTwoObjects extends IGeometry {
302
325
  /**
303
326
  * Returns the start vertex of the tangent arc.
@@ -378,12 +401,12 @@ export interface IExtrude extends IBooleanOperation {
378
401
  * Applies a draft (taper) angle to the extrusion walls.
379
402
  * @param value - A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft.
380
403
  */
381
- draft(value: number | [number, number]): this;
404
+ draft(value: NumberParam | [NumberParam, NumberParam]): this;
382
405
  /**
383
406
  * Offsets the end face by a specified distance along the extrusion direction.
384
407
  * @param value - The offset distance.
385
408
  */
386
- endOffset(value: number): this;
409
+ endOffset(value: NumberParam): this;
387
410
  /**
388
411
  * Enables or disables drill mode, which partitions the sketch into face regions
389
412
  * before extruding.
@@ -400,7 +423,7 @@ export interface IExtrude extends IBooleanOperation {
400
423
  * instead of extruding filled faces. Positive values offset outward, negative values offset inward.
401
424
  * @param offset - The wall offset distance. Positive = outward, negative = inward.
402
425
  */
403
- thin(offset: number): this;
426
+ thin(offset: NumberParam): this;
404
427
  /**
405
428
  * Enables thin extrude mode with two offset directions.
406
429
  * The two offsets must go in opposite directions. If both have the same sign,
@@ -408,7 +431,7 @@ export interface IExtrude extends IBooleanOperation {
408
431
  * @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
409
432
  * @param offset2 - The second wall offset distance, in the opposite direction of offset1.
410
433
  */
411
- thin(offset1: number, offset2: number): this;
434
+ thin(offset1: NumberParam, offset2: NumberParam): this;
412
435
  }
413
436
  export interface ICut extends ISceneObject {
414
437
  /**
@@ -425,12 +448,12 @@ export interface ICut extends ISceneObject {
425
448
  * Applies a draft (taper) angle to the cut walls.
426
449
  * @param value - A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft.
427
450
  */
428
- draft(value: number | [number, number]): this;
451
+ draft(value: NumberParam | [NumberParam, NumberParam]): this;
429
452
  /**
430
453
  * Offsets the cut end face by a specified distance along the cut direction.
431
454
  * @param value - The offset distance.
432
455
  */
433
- endOffset(value: number): this;
456
+ endOffset(value: NumberParam): this;
434
457
  /**
435
458
  * Selects edges at the start of the cut path, classified by signed distance from the cut plane.
436
459
  * @param args - Numeric indices or {@link EdgeFilterBuilder} instances to filter the selection.
@@ -461,7 +484,7 @@ export interface ICut extends ISceneObject {
461
484
  * instead of cutting filled faces. Positive values offset outward, negative values offset inward.
462
485
  * @param offset - The wall offset distance. Positive = outward, negative = inward.
463
486
  */
464
- thin(offset: number): this;
487
+ thin(offset: NumberParam): this;
465
488
  /**
466
489
  * Enables thin cut mode with two offset directions.
467
490
  * The two offsets must go in opposite directions. If both have the same sign,
@@ -469,7 +492,7 @@ export interface ICut extends ISceneObject {
469
492
  * @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
470
493
  * @param offset2 - The second wall offset distance, in the opposite direction of offset1.
471
494
  */
472
- thin(offset1: number, offset2: number): this;
495
+ thin(offset1: NumberParam, offset2: NumberParam): this;
473
496
  }
474
497
  export interface IRevolve extends IBooleanOperation {
475
498
  /**
@@ -487,7 +510,7 @@ export interface IRevolve extends IBooleanOperation {
487
510
  * outward, negative values offset inward.
488
511
  * @param offset - The wall offset distance. Positive = outward, negative = inward.
489
512
  */
490
- thin(offset: number): this;
513
+ thin(offset: NumberParam): this;
491
514
  /**
492
515
  * Enables thin revolve mode with two offset directions.
493
516
  * The two offsets must go in opposite directions. If both have the same sign,
@@ -495,7 +518,7 @@ export interface IRevolve extends IBooleanOperation {
495
518
  * @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
496
519
  * @param offset2 - The second wall offset distance, in the opposite direction of offset1.
497
520
  */
498
- thin(offset1: number, offset2: number): this;
521
+ thin(offset1: NumberParam, offset2: NumberParam): this;
499
522
  /**
500
523
  * Selects faces created inside the solid during revolution (e.g., the inner
501
524
  * wall of a thin-walled revolve from a closed profile).
@@ -556,7 +579,7 @@ export interface ILoft extends IBooleanOperation {
556
579
  * and share the same topology. Positive values offset outward, negative offsets inward.
557
580
  * @param offset - The wall offset distance. Positive = outward, negative = inward.
558
581
  */
559
- thin(offset: number): this;
582
+ thin(offset: NumberParam): this;
560
583
  /**
561
584
  * Enables thin loft mode with two offset directions.
562
585
  * The two offsets must go in opposite directions. If both have the same sign,
@@ -564,7 +587,7 @@ export interface ILoft extends IBooleanOperation {
564
587
  * @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
565
588
  * @param offset2 - The second wall offset distance, in the opposite direction of offset1.
566
589
  */
567
- thin(offset1: number, offset2: number): this;
590
+ thin(offset1: NumberParam, offset2: NumberParam): this;
568
591
  /**
569
592
  * Selects faces created inside the solid during loft (e.g., the inner
570
593
  * wall of a thin-walled loft from closed profiles).
@@ -633,12 +656,12 @@ export interface ISweep extends IBooleanOperation {
633
656
  * Applies a draft (taper) angle to the sweep walls.
634
657
  * @param value - A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft.
635
658
  */
636
- draft(value: number | [number, number]): this;
659
+ draft(value: NumberParam | [NumberParam, NumberParam]): this;
637
660
  /**
638
661
  * Offsets the end face by a specified distance along the sweep direction.
639
662
  * @param value - The offset distance.
640
663
  */
641
- endOffset(value: number): this;
664
+ endOffset(value: NumberParam): this;
642
665
  /**
643
666
  * Enables or disables drill mode.
644
667
  * @param value - `true` to enable (default), `false` to disable.
@@ -655,7 +678,7 @@ export interface ISweep extends IBooleanOperation {
655
678
  * negative values offset inward.
656
679
  * @param offset - The wall offset distance. Positive = outward, negative = inward.
657
680
  */
658
- thin(offset: number): this;
681
+ thin(offset: NumberParam): this;
659
682
  /**
660
683
  * Enables thin sweep mode with two offset directions.
661
684
  * The two offsets must go in opposite directions. If both have the same sign,
@@ -663,7 +686,7 @@ export interface ISweep extends IBooleanOperation {
663
686
  * @param offset1 - The first wall offset distance. Positive = outward, negative = inward.
664
687
  * @param offset2 - The second wall offset distance, in the opposite direction of offset1.
665
688
  */
666
- thin(offset1: number, offset2: number): this;
689
+ thin(offset1: NumberParam, offset2: NumberParam): this;
667
690
  /**
668
691
  * Selects the cap faces at the open ends of a thin-walled sweep from an open profile.
669
692
  * These are the small faces connecting the inner and outer walls at the profile endpoints.
@@ -759,7 +782,7 @@ export interface IRib extends IBooleanOperation {
759
782
  * Applies a draft (taper) angle to the rib walls.
760
783
  * @param value - A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft.
761
784
  */
762
- draft(value: number | [number, number]): this;
785
+ draft(value: NumberParam | [NumberParam, NumberParam]): this;
763
786
  /**
764
787
  * Switches the extrusion direction to parallel to the sketch plane
765
788
  * (perpendicular to the spine within the plane) instead of normal to it.
@@ -771,6 +794,7 @@ export interface IRib extends IBooleanOperation {
771
794
  */
772
795
  extend(): this;
773
796
  }
797
+ export type ShellJoinType = 'arc' | 'intersection' | 'tangent';
774
798
  export interface IShell extends ISceneObject {
775
799
  /**
776
800
  * Selects the inner wall faces created by the shell operation (from thickness removal).
@@ -783,4 +807,10 @@ export interface IShell extends ISceneObject {
783
807
  * @param args - Numeric indices or {@link EdgeFilterBuilder} instances to filter the selection.
784
808
  */
785
809
  internalEdges(...args: (number | EdgeFilterBuilder)[]): ISceneObject;
810
+ /**
811
+ * Sets the join type used at inner-wall corners.
812
+ * @param type - `'arc'` (default) for rounded blends, `'intersection'` for sharp corners,
813
+ * or `'tangent'` for tangent-continuous blends.
814
+ */
815
+ join(type: ShellJoinType): this;
786
816
  }
@@ -0,0 +1,74 @@
1
+ import { type MultiControlType, type SelectOption } from "../param-registry.js";
2
+ export type ParamType = 'number' | 'slider' | 'text' | 'select' | 'checkbox' | 'color';
3
+ interface BaseParamOptions {
4
+ group?: string;
5
+ description?: string;
6
+ }
7
+ export interface NumberParamOptions extends BaseParamOptions {
8
+ min?: number;
9
+ max?: number;
10
+ step?: number;
11
+ }
12
+ export interface SliderParamOptions extends BaseParamOptions {
13
+ min?: number;
14
+ max?: number;
15
+ step?: number;
16
+ }
17
+ export interface SelectParamOptions extends BaseParamOptions {
18
+ options: SelectOption[];
19
+ multi?: boolean;
20
+ multiControlType?: MultiControlType;
21
+ }
22
+ export type CheckboxParamOptions = BaseParamOptions;
23
+ export type TextParamOptions = BaseParamOptions;
24
+ export type ColorParamOptions = BaseParamOptions;
25
+ export interface ParamOptionsMap {
26
+ number: NumberParamOptions;
27
+ slider: SliderParamOptions;
28
+ select: SelectParamOptions;
29
+ checkbox: CheckboxParamOptions;
30
+ text: TextParamOptions;
31
+ color: ColorParamOptions;
32
+ }
33
+ /** @deprecated Use `param()` with a `ParamOptions` object instead. */
34
+ export declare class ParamValue<T extends string | number | boolean> {
35
+ private _value;
36
+ private _definition;
37
+ constructor(label: string, defaultValue: T);
38
+ slider(opts?: {
39
+ min?: number;
40
+ max?: number;
41
+ step?: number;
42
+ }): this;
43
+ number(opts?: {
44
+ min?: number;
45
+ max?: number;
46
+ step?: number;
47
+ }): this;
48
+ text(): this;
49
+ checkbox(): this;
50
+ select(items: SelectOption[], opts?: {
51
+ multi?: boolean;
52
+ multiControlType?: MultiControlType;
53
+ }): this;
54
+ description(desc: string): this;
55
+ group(name: string): this;
56
+ valueOf(): T;
57
+ toString(): string;
58
+ toJSON(): T;
59
+ [Symbol.toPrimitive](hint: string): T | string;
60
+ }
61
+ export type NumberParam = number | ParamValue<number>;
62
+ export type StringParam = string | ParamValue<string>;
63
+ export type BooleanParam = boolean | ParamValue<boolean>;
64
+ export declare function isNumberParam(v: unknown): v is NumberParam;
65
+ export declare function isBooleanParam(v: unknown): v is BooleanParam;
66
+ export declare function resolveParam(v: NumberParam): number;
67
+ export declare function resolveParam(v: StringParam): string;
68
+ export declare function resolveParam(v: BooleanParam): boolean;
69
+ export default function param<T extends string | number | boolean>(label: string, defaultValue: T): T;
70
+ export default function param<T extends string | number | boolean, K extends ParamType>(label: string, defaultValue: T, type: K, options?: ParamOptionsMap[K]): T;
71
+ export default function param(label: string, defaultValue: (string | number)[], type: 'select', options: SelectParamOptions & {
72
+ multi: true;
73
+ }): (string | number)[];
74
+ export {};
@@ -0,0 +1,147 @@
1
+ import { getParamRegistry } from "../param-registry.js";
2
+ /** @deprecated Use `param()` with a `ParamOptions` object instead. */
3
+ export class ParamValue {
4
+ _value;
5
+ _definition;
6
+ constructor(label, defaultValue) {
7
+ const registry = getParamRegistry();
8
+ this._value = registry.resolve(label, defaultValue);
9
+ this._definition = {
10
+ label,
11
+ defaultValue,
12
+ currentValue: this._value,
13
+ controlType: typeof defaultValue === 'boolean' ? 'checkbox'
14
+ : typeof defaultValue === 'number' ? 'number'
15
+ : 'text',
16
+ };
17
+ registry.register(this._definition);
18
+ }
19
+ slider(opts) {
20
+ this._definition.controlType = 'slider';
21
+ if (opts) {
22
+ if (opts.min != null) {
23
+ this._definition.min = opts.min;
24
+ }
25
+ if (opts.max != null) {
26
+ this._definition.max = opts.max;
27
+ }
28
+ if (opts.step != null) {
29
+ this._definition.step = opts.step;
30
+ }
31
+ }
32
+ return this;
33
+ }
34
+ number(opts) {
35
+ this._definition.controlType = 'number';
36
+ if (opts) {
37
+ if (opts.min != null) {
38
+ this._definition.min = opts.min;
39
+ }
40
+ if (opts.max != null) {
41
+ this._definition.max = opts.max;
42
+ }
43
+ if (opts.step != null) {
44
+ this._definition.step = opts.step;
45
+ }
46
+ }
47
+ return this;
48
+ }
49
+ text() {
50
+ this._definition.controlType = 'text';
51
+ return this;
52
+ }
53
+ checkbox() {
54
+ this._definition.controlType = 'checkbox';
55
+ return this;
56
+ }
57
+ select(items, opts) {
58
+ this._definition.controlType = 'select';
59
+ this._definition.options = items;
60
+ if (opts?.multi) {
61
+ this._definition.multi = true;
62
+ }
63
+ if (opts?.multiControlType) {
64
+ this._definition.multiControlType = opts.multiControlType;
65
+ }
66
+ return this;
67
+ }
68
+ description(desc) {
69
+ this._definition.description = desc;
70
+ return this;
71
+ }
72
+ group(name) {
73
+ this._definition.group = name;
74
+ return this;
75
+ }
76
+ valueOf() {
77
+ return this._value;
78
+ }
79
+ toString() {
80
+ return String(this._value);
81
+ }
82
+ toJSON() {
83
+ return this._value;
84
+ }
85
+ [Symbol.toPrimitive](hint) {
86
+ if (hint === 'string') {
87
+ return String(this._value);
88
+ }
89
+ return this._value;
90
+ }
91
+ }
92
+ export function isNumberParam(v) {
93
+ return typeof v === 'number' || (v instanceof ParamValue && typeof v.valueOf() === 'number');
94
+ }
95
+ export function isBooleanParam(v) {
96
+ return typeof v === 'boolean' || (v instanceof ParamValue && typeof v.valueOf() === 'boolean');
97
+ }
98
+ export function resolveParam(v) {
99
+ if (v instanceof ParamValue) {
100
+ return v.valueOf();
101
+ }
102
+ return v;
103
+ }
104
+ export default function param(label, defaultValue, type, options) {
105
+ const registry = getParamRegistry();
106
+ const value = Array.isArray(defaultValue)
107
+ ? registry.resolve(label, defaultValue)
108
+ : registry.resolve(label, defaultValue);
109
+ const controlType = type
110
+ ?? (typeof defaultValue === 'boolean' ? 'checkbox'
111
+ : typeof defaultValue === 'number' ? 'number'
112
+ : 'text');
113
+ const definition = {
114
+ label,
115
+ defaultValue,
116
+ currentValue: value,
117
+ controlType,
118
+ };
119
+ if (options) {
120
+ if ('group' in options && options.group != null) {
121
+ definition.group = options.group;
122
+ }
123
+ if ('description' in options && options.description != null) {
124
+ definition.description = options.description;
125
+ }
126
+ if ('min' in options && options.min != null) {
127
+ definition.min = options.min;
128
+ }
129
+ if ('max' in options && options.max != null) {
130
+ definition.max = options.max;
131
+ }
132
+ if ('step' in options && options.step != null) {
133
+ definition.step = options.step;
134
+ }
135
+ if ('options' in options && options.options != null) {
136
+ definition.options = options.options;
137
+ }
138
+ if ('multi' in options && options.multi != null) {
139
+ definition.multi = options.multi;
140
+ }
141
+ if ('multiControlType' in options && options.multiControlType != null) {
142
+ definition.multiControlType = options.multiControlType;
143
+ }
144
+ }
145
+ registry.register(definition);
146
+ return value;
147
+ }
@@ -3,6 +3,7 @@ import { Matrix4 } from "../math/matrix4.js";
3
3
  import { LinearRepeatOptions } from "../features/repeat-linear.js";
4
4
  import { CircularRepeatOptions } from "../features/repeat-circular.js";
5
5
  import { ISceneObject } from "./interfaces.js";
6
+ import { type NumberParam } from "./param.js";
6
7
  import { PlaneLike } from "../math/plane.js";
7
8
  export type RepeatType = 'linear' | 'circular' | 'mirror' | 'rotate';
8
9
  interface RepeatFunction {
@@ -44,7 +45,7 @@ interface RepeatFunction {
44
45
  * @param angle - The rotation angle in degrees (defaults to 90)
45
46
  * @param objects - The objects to rotate (defaults to last object)
46
47
  */
47
- (type: 'rotate', axis: AxisLike, angle?: number, ...objects: ISceneObject[]): ISceneObject;
48
+ (type: 'rotate', axis: AxisLike, angle?: NumberParam, ...objects: ISceneObject[]): ISceneObject;
48
49
  /**
49
50
  * Creates a transformed clone of objects using an arbitrary matrix.
50
51
  * @param matrix - The transformation matrix to apply