fluidcad 0.0.32 → 0.0.34

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 (279) hide show
  1. package/README.md +3 -2
  2. package/bin/commands/init.js +55 -0
  3. package/bin/commands/mcp.js +33 -0
  4. package/bin/commands/serve.js +77 -0
  5. package/bin/fluidcad.js +15 -107
  6. package/lib/dist/common/scene-object.d.ts +4 -1
  7. package/lib/dist/common/scene-object.js +9 -2
  8. package/lib/dist/common/solid.d.ts +4 -1
  9. package/lib/dist/common/solid.js +13 -0
  10. package/lib/dist/core/2d/tarc.d.ts +20 -2
  11. package/lib/dist/core/2d/tarc.js +24 -0
  12. package/lib/dist/core/index.d.ts +2 -1
  13. package/lib/dist/core/index.js +1 -0
  14. package/lib/dist/core/interfaces.d.ts +107 -2
  15. package/lib/dist/core/load.d.ts +2 -2
  16. package/lib/dist/core/repeat.js +62 -46
  17. package/lib/dist/core/rib.d.ts +18 -0
  18. package/lib/dist/core/rib.js +37 -0
  19. package/lib/dist/features/2d/arc.d.ts +8 -2
  20. package/lib/dist/features/2d/arc.js +94 -17
  21. package/lib/dist/features/2d/back.js +3 -2
  22. package/lib/dist/features/2d/sketch.d.ts +4 -0
  23. package/lib/dist/features/2d/sketch.js +21 -0
  24. package/lib/dist/features/2d/tarc-constrained.d.ts +2 -0
  25. package/lib/dist/features/2d/tarc-constrained.js +8 -0
  26. package/lib/dist/features/2d/tarc-radius-to-object.d.ts +16 -0
  27. package/lib/dist/features/2d/tarc-radius-to-object.js +58 -0
  28. package/lib/dist/features/2d/tarc-to-object.d.ts +18 -0
  29. package/lib/dist/features/2d/tarc-to-object.js +66 -0
  30. package/lib/dist/features/2d/tarc-to-point-tangent.d.ts +2 -0
  31. package/lib/dist/features/2d/tarc-to-point-tangent.js +3 -0
  32. package/lib/dist/features/2d/tarc-to-point.d.ts +2 -0
  33. package/lib/dist/features/2d/tarc-to-point.js +3 -0
  34. package/lib/dist/features/2d/tarc-with-tangent.d.ts +2 -0
  35. package/lib/dist/features/2d/tarc-with-tangent.js +3 -0
  36. package/lib/dist/features/2d/tarc.d.ts +2 -0
  37. package/lib/dist/features/2d/tarc.js +3 -0
  38. package/lib/dist/features/extrude-base.d.ts +9 -0
  39. package/lib/dist/features/extrude-base.js +22 -0
  40. package/lib/dist/features/extrude-to-face.js +1 -5
  41. package/lib/dist/features/extrude-two-distances.js +1 -2
  42. package/lib/dist/features/extrude.js +1 -2
  43. package/lib/dist/features/load.d.ts +6 -0
  44. package/lib/dist/features/load.js +53 -1
  45. package/lib/dist/features/mirror-feature.d.ts +3 -2
  46. package/lib/dist/features/mirror-feature.js +1 -1
  47. package/lib/dist/features/repeat-circular.d.ts +3 -3
  48. package/lib/dist/features/repeat-circular.js +8 -1
  49. package/lib/dist/features/repeat-linear.d.ts +4 -2
  50. package/lib/dist/features/repeat-linear.js +10 -1
  51. package/lib/dist/features/repeat-matrix.d.ts +3 -1
  52. package/lib/dist/features/repeat-matrix.js +7 -2
  53. package/lib/dist/features/rib.d.ts +31 -0
  54. package/lib/dist/features/rib.js +321 -0
  55. package/lib/dist/features/select.d.ts +1 -0
  56. package/lib/dist/features/select.js +81 -10
  57. package/lib/dist/features/shell.d.ts +4 -1
  58. package/lib/dist/features/shell.js +14 -3
  59. package/lib/dist/filters/edge/belongs-to-face.d.ts +12 -9
  60. package/lib/dist/filters/edge/belongs-to-face.js +64 -15
  61. package/lib/dist/filters/filter-builder-base.d.ts +25 -0
  62. package/lib/dist/filters/filter-builder-base.js +47 -0
  63. package/lib/dist/filters/filter.js +39 -14
  64. package/lib/dist/filters/from-object.d.ts +4 -0
  65. package/lib/dist/filters/from-object.js +10 -0
  66. package/lib/dist/helpers/clone-transform.d.ts +2 -1
  67. package/lib/dist/helpers/scene-helpers.d.ts +1 -1
  68. package/lib/dist/helpers/scene-helpers.js +146 -12
  69. package/lib/dist/index.d.ts +7 -1
  70. package/lib/dist/index.js +3 -3
  71. package/lib/dist/io/file-import.d.ts +5 -1
  72. package/lib/dist/io/file-import.js +29 -18
  73. package/lib/dist/math/lazy-matrix.d.ts +31 -0
  74. package/lib/dist/math/lazy-matrix.js +66 -0
  75. package/lib/dist/oc/color-transfer.d.ts +19 -8
  76. package/lib/dist/oc/color-transfer.js +70 -12
  77. package/lib/dist/oc/constraints/constraint-solver-adaptor.d.ts +5 -0
  78. package/lib/dist/oc/constraints/constraint-solver-adaptor.js +16 -0
  79. package/lib/dist/oc/constraints/constraint-solver.d.ts +4 -0
  80. package/lib/dist/oc/constraints/curve/curve-constraint-solver.d.ts +4 -0
  81. package/lib/dist/oc/constraints/curve/curve-constraint-solver.js +3 -0
  82. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.d.ts +6 -1
  83. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.js +4 -0
  84. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.d.ts +8 -0
  85. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.js +111 -0
  86. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.d.ts +8 -0
  87. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.js +161 -0
  88. package/lib/dist/oc/extrude-ops.d.ts +2 -1
  89. package/lib/dist/oc/extrude-ops.js +51 -2
  90. package/lib/dist/oc/mesh.d.ts +9 -4
  91. package/lib/dist/oc/mesh.js +14 -13
  92. package/lib/dist/oc/rib-ops.d.ts +35 -0
  93. package/lib/dist/oc/rib-ops.js +619 -0
  94. package/lib/dist/oc/shell-ops.d.ts +2 -1
  95. package/lib/dist/oc/shell-ops.js +5 -2
  96. package/lib/dist/oc/topology-index.d.ts +6 -0
  97. package/lib/dist/oc/topology-index.js +36 -0
  98. package/lib/dist/rendering/mesh-builder.d.ts +3 -0
  99. package/lib/dist/rendering/mesh-builder.js +8 -4
  100. package/lib/dist/rendering/render-edge.d.ts +2 -1
  101. package/lib/dist/rendering/render-edge.js +2 -2
  102. package/lib/dist/rendering/render-face.d.ts +2 -1
  103. package/lib/dist/rendering/render-face.js +2 -2
  104. package/lib/dist/rendering/render-solid.d.ts +2 -1
  105. package/lib/dist/rendering/render-solid.js +3 -5
  106. package/lib/dist/rendering/render-wire.d.ts +2 -1
  107. package/lib/dist/rendering/render-wire.js +2 -2
  108. package/lib/dist/rendering/render.d.ts +4 -0
  109. package/lib/dist/rendering/render.js +50 -2
  110. package/lib/dist/rendering/scene-compare.js +3 -0
  111. package/lib/dist/rendering/scene.d.ts +1 -0
  112. package/lib/dist/rendering/scene.js +4 -0
  113. package/lib/dist/scene-manager.d.ts +4 -2
  114. package/lib/dist/scene-manager.js +12 -4
  115. package/lib/dist/tests/features/2d/arc.test.js +64 -0
  116. package/lib/dist/tests/features/2d/back.test.js +17 -1
  117. package/lib/dist/tests/features/2d/tarc.test.js +157 -0
  118. package/lib/dist/tests/features/color-lineage.test.js +18 -0
  119. package/lib/dist/tests/features/filter-positional.test.d.ts +1 -0
  120. package/lib/dist/tests/features/filter-positional.test.js +129 -0
  121. package/lib/dist/tests/features/repeat-user-repro.test.d.ts +1 -0
  122. package/lib/dist/tests/features/repeat-user-repro.test.js +60 -0
  123. package/lib/dist/tests/features/rib.test.d.ts +1 -0
  124. package/lib/dist/tests/features/rib.test.js +598 -0
  125. package/lib/dist/tests/features/shell.test.js +36 -0
  126. package/lib/dist/tests/global-setup.js +2 -1
  127. package/lib/dist/tests/helpers/extract-blocks.d.ts +9 -0
  128. package/lib/dist/tests/helpers/extract-blocks.js +56 -0
  129. package/lib/dist/tests/llm-docs-examples.test.d.ts +1 -0
  130. package/lib/dist/tests/llm-docs-examples.test.js +62 -0
  131. package/lib/dist/tests/scene-compare.test.d.ts +1 -0
  132. package/lib/dist/tests/scene-compare.test.js +77 -0
  133. package/lib/dist/tests/setup.js +2 -1
  134. package/lib/dist/tsconfig.tsbuildinfo +1 -1
  135. package/llm-docs/.coverage-allowlist.txt +9 -0
  136. package/llm-docs/api/arc.md +48 -0
  137. package/llm-docs/api/axis.md +42 -0
  138. package/llm-docs/api/bezier.md +42 -0
  139. package/llm-docs/api/booleans.md +44 -0
  140. package/llm-docs/api/chamfer.md +40 -0
  141. package/llm-docs/api/circle.md +36 -0
  142. package/llm-docs/api/color.md +34 -0
  143. package/llm-docs/api/connect.md +41 -0
  144. package/llm-docs/api/constraint-qualifiers.md +48 -0
  145. package/llm-docs/api/copy.md +63 -0
  146. package/llm-docs/api/cursor-lines.md +50 -0
  147. package/llm-docs/api/cursor-move.md +61 -0
  148. package/llm-docs/api/cut.md +55 -0
  149. package/llm-docs/api/draft.md +36 -0
  150. package/llm-docs/api/edge-filter.md +57 -0
  151. package/llm-docs/api/ellipse.md +34 -0
  152. package/llm-docs/api/extrude.md +74 -0
  153. package/llm-docs/api/face-filter.md +61 -0
  154. package/llm-docs/api/fillet.md +51 -0
  155. package/llm-docs/api/index.json +139 -0
  156. package/llm-docs/api/line.md +42 -0
  157. package/llm-docs/api/load.md +37 -0
  158. package/llm-docs/api/local.md +38 -0
  159. package/llm-docs/api/loft.md +37 -0
  160. package/llm-docs/api/mirror.md +44 -0
  161. package/llm-docs/api/offset.md +36 -0
  162. package/llm-docs/api/part.md +40 -0
  163. package/llm-docs/api/plane.md +44 -0
  164. package/llm-docs/api/polygon.md +37 -0
  165. package/llm-docs/api/primitive-solids.md +39 -0
  166. package/llm-docs/api/project-intersect.md +48 -0
  167. package/llm-docs/api/rect.md +48 -0
  168. package/llm-docs/api/remove.md +32 -0
  169. package/llm-docs/api/repeat.md +79 -0
  170. package/llm-docs/api/revolve.md +38 -0
  171. package/llm-docs/api/rib.md +40 -0
  172. package/llm-docs/api/rotate.md +37 -0
  173. package/llm-docs/api/select.md +41 -0
  174. package/llm-docs/api/shell.md +41 -0
  175. package/llm-docs/api/sketch.md +76 -0
  176. package/llm-docs/api/slot.md +36 -0
  177. package/llm-docs/api/split-trim.md +42 -0
  178. package/llm-docs/api/sweep.md +43 -0
  179. package/llm-docs/api/tarc.md +45 -0
  180. package/llm-docs/api/tcircle.md +38 -0
  181. package/llm-docs/api/tline.md +42 -0
  182. package/llm-docs/api/translate.md +40 -0
  183. package/llm-docs/api/types/aline.md +35 -0
  184. package/llm-docs/api/types/arc-angles.md +29 -0
  185. package/llm-docs/api/types/arc-points.md +48 -0
  186. package/llm-docs/api/types/axis-like.md +38 -0
  187. package/llm-docs/api/types/axis.md +21 -0
  188. package/llm-docs/api/types/boolean-operation.md +50 -0
  189. package/llm-docs/api/types/circular-repeat-options.md +31 -0
  190. package/llm-docs/api/types/common.md +32 -0
  191. package/llm-docs/api/types/cut.md +125 -0
  192. package/llm-docs/api/types/draft.md +21 -0
  193. package/llm-docs/api/types/extrudable-geometry.md +23 -0
  194. package/llm-docs/api/types/extrude.md +194 -0
  195. package/llm-docs/api/types/geometry.md +51 -0
  196. package/llm-docs/api/types/hline.md +35 -0
  197. package/llm-docs/api/types/linear-repeat-options.md +31 -0
  198. package/llm-docs/api/types/loft.md +154 -0
  199. package/llm-docs/api/types/mirror.md +35 -0
  200. package/llm-docs/api/types/offset.md +31 -0
  201. package/llm-docs/api/types/plane-like.md +35 -0
  202. package/llm-docs/api/types/plane-transform-options.md +29 -0
  203. package/llm-docs/api/types/plane.md +21 -0
  204. package/llm-docs/api/types/point-like.md +22 -0
  205. package/llm-docs/api/types/point2dlike.md +26 -0
  206. package/llm-docs/api/types/polygon.md +46 -0
  207. package/llm-docs/api/types/rect.md +128 -0
  208. package/llm-docs/api/types/revolve.md +102 -0
  209. package/llm-docs/api/types/rib.md +133 -0
  210. package/llm-docs/api/types/scene-object.md +33 -0
  211. package/llm-docs/api/types/select.md +21 -0
  212. package/llm-docs/api/types/shell.md +54 -0
  213. package/llm-docs/api/types/slot.md +43 -0
  214. package/llm-docs/api/types/sweep.md +189 -0
  215. package/llm-docs/api/types/tangent-arc-two-objects.md +46 -0
  216. package/llm-docs/api/types/transformable.md +93 -0
  217. package/llm-docs/api/types/trim.md +27 -0
  218. package/llm-docs/api/types/two-objects-tangent-line.md +46 -0
  219. package/llm-docs/api/types/vertex.md +17 -0
  220. package/llm-docs/api/types/vline.md +35 -0
  221. package/llm-docs/concepts/coordinate-system.md +45 -0
  222. package/llm-docs/concepts/history-and-rollback.md +40 -0
  223. package/llm-docs/concepts/last-selection.md +49 -0
  224. package/llm-docs/concepts/scene-graph.md +37 -0
  225. package/llm-docs/index.json +1750 -0
  226. package/mcp/dist/client.d.ts +64 -0
  227. package/mcp/dist/client.js +248 -0
  228. package/mcp/dist/discovery.d.ts +11 -0
  229. package/mcp/dist/discovery.js +78 -0
  230. package/mcp/dist/docs-index.d.ts +81 -0
  231. package/mcp/dist/docs-index.js +261 -0
  232. package/mcp/dist/resources.d.ts +4 -0
  233. package/mcp/dist/resources.js +115 -0
  234. package/mcp/dist/server.d.ts +12 -0
  235. package/mcp/dist/server.js +489 -0
  236. package/mcp/dist/tools/coordination.d.ts +9 -0
  237. package/mcp/dist/tools/coordination.js +46 -0
  238. package/mcp/dist/tools/docs.d.ts +66 -0
  239. package/mcp/dist/tools/docs.js +122 -0
  240. package/mcp/dist/tools/engine.d.ts +56 -0
  241. package/mcp/dist/tools/engine.js +145 -0
  242. package/mcp/dist/tools/inspection.d.ts +75 -0
  243. package/mcp/dist/tools/inspection.js +121 -0
  244. package/mcp/dist/tools/screenshot.d.ts +63 -0
  245. package/mcp/dist/tools/screenshot.js +263 -0
  246. package/mcp/dist/tools/source.d.ts +84 -0
  247. package/mcp/dist/tools/source.js +434 -0
  248. package/mcp/dist/tools/workspaces.d.ts +13 -0
  249. package/mcp/dist/tools/workspaces.js +33 -0
  250. package/mcp/dist/types.d.ts +18 -0
  251. package/mcp/dist/types.js +11 -0
  252. package/package.json +19 -5
  253. package/server/dist/code-editor.d.ts +36 -0
  254. package/server/dist/code-editor.js +8 -0
  255. package/server/dist/fluidcad-server.d.ts +50 -0
  256. package/server/dist/fluidcad-server.js +153 -1
  257. package/server/dist/global-registry.d.ts +30 -0
  258. package/server/dist/global-registry.js +126 -0
  259. package/server/dist/index.js +171 -26
  260. package/server/dist/instance-file.d.ts +31 -0
  261. package/server/dist/instance-file.js +73 -0
  262. package/server/dist/lint-fluid-js.d.ts +15 -0
  263. package/server/dist/lint-fluid-js.js +271 -0
  264. package/server/dist/routes/editor.d.ts +24 -0
  265. package/server/dist/routes/editor.js +44 -0
  266. package/server/dist/routes/export.d.ts +1 -1
  267. package/server/dist/routes/export.js +45 -8
  268. package/server/dist/routes/health.d.ts +7 -0
  269. package/server/dist/routes/health.js +14 -0
  270. package/server/dist/routes/lint.d.ts +10 -0
  271. package/server/dist/routes/lint.js +28 -0
  272. package/server/dist/routes/render.d.ts +33 -0
  273. package/server/dist/routes/render.js +34 -0
  274. package/server/dist/routes/scene.d.ts +5 -0
  275. package/server/dist/routes/scene.js +48 -0
  276. package/server/dist/routes/screenshot.js +68 -1
  277. package/server/dist/ws-protocol.d.ts +56 -2
  278. package/ui/dist/assets/{index-DMw0OYCF.js → index-BdqrMDRu.js} +30 -30
  279. package/ui/dist/index.html +1 -1
@@ -0,0 +1,189 @@
1
+ ---
2
+ id: api/types/sweep
3
+ title: Sweep
4
+ summary: "The Sweep type. Extends BooleanOperation; adds 15 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [Sweep, ISweep]
7
+ seeAlso: [api/sweep, api/types/boolean-operation]
8
+ ---
9
+ # Sweep
10
+
11
+ ```ts
12
+ interface Sweep extends BooleanOperation {
13
+ startFaces(...args: (number | FaceFilter)[]): SceneObject;
14
+ endFaces(...args: (number | FaceFilter)[]): SceneObject;
15
+ sideFaces(...args: (number | FaceFilter)[]): SceneObject;
16
+ startEdges(...args: (number | EdgeFilter)[]): SceneObject;
17
+ endEdges(...args: (number | EdgeFilter)[]): SceneObject;
18
+ sideEdges(...args: (number | EdgeFilter)[]): SceneObject;
19
+ internalFaces(...args: (number | FaceFilter)[]): SceneObject;
20
+ internalEdges(...args: (number | EdgeFilter)[]): SceneObject;
21
+ draft(value: number | [number, number]): this;
22
+ endOffset(value: number): this;
23
+ drill(value?: boolean): this;
24
+ pick(...points: Point2DLike[]): this;
25
+ thin(offset: number): this;
26
+ thin(offset1: number, offset2: number): this;
27
+ capFaces(...args: (number | FaceFilter)[]): SceneObject;
28
+ capEdges(...args: (number | EdgeFilter)[]): SceneObject;
29
+ }
30
+ ```
31
+
32
+ Extends [[api/types/boolean-operation]].
33
+
34
+ ## Methods
35
+
36
+ ### `startFaces()`
37
+
38
+ Selects faces at the start (profile plane) of the sweep.
39
+
40
+ **Returns**: [[api/types/scene-object]].
41
+
42
+ | Parameter | Type | Description |
43
+ | --- | --- | --- |
44
+ | `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
45
+
46
+ ### `endFaces()`
47
+
48
+ Selects faces at the end of the sweep path.
49
+
50
+ **Returns**: [[api/types/scene-object]].
51
+
52
+ | Parameter | Type | Description |
53
+ | --- | --- | --- |
54
+ | `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
55
+
56
+ ### `sideFaces()`
57
+
58
+ Selects the lateral faces generated by sweeping the profile along the path.
59
+
60
+ **Returns**: [[api/types/scene-object]].
61
+
62
+ | Parameter | Type | Description |
63
+ | --- | --- | --- |
64
+ | `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
65
+
66
+ ### `startEdges()`
67
+
68
+ Selects edges on the start faces of the sweep.
69
+
70
+ **Returns**: [[api/types/scene-object]].
71
+
72
+ | Parameter | Type | Description |
73
+ | --- | --- | --- |
74
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
75
+
76
+ ### `endEdges()`
77
+
78
+ Selects edges on the end faces of the sweep.
79
+
80
+ **Returns**: [[api/types/scene-object]].
81
+
82
+ | Parameter | Type | Description |
83
+ | --- | --- | --- |
84
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
85
+
86
+ ### `sideEdges()`
87
+
88
+ Selects edges on the side faces, excluding edges shared with start/end faces.
89
+
90
+ **Returns**: [[api/types/scene-object]].
91
+
92
+ | Parameter | Type | Description |
93
+ | --- | --- | --- |
94
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
95
+
96
+ ### `internalFaces()`
97
+
98
+ Selects faces created inside the solid during the sweep (e.g., from holes).
99
+
100
+ **Returns**: [[api/types/scene-object]].
101
+
102
+ | Parameter | Type | Description |
103
+ | --- | --- | --- |
104
+ | `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
105
+
106
+ ### `internalEdges()`
107
+
108
+ Selects edges bounding the internal geometry created during the sweep.
109
+
110
+ **Returns**: [[api/types/scene-object]].
111
+
112
+ | Parameter | Type | Description |
113
+ | --- | --- | --- |
114
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
115
+
116
+ ### `draft()`
117
+
118
+ Applies a draft (taper) angle to the sweep walls.
119
+
120
+ | Parameter | Type | Description |
121
+ | --- | --- | --- |
122
+ | `value` | `number` \| `[number, number]` | A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft. |
123
+
124
+ ### `endOffset()`
125
+
126
+ Offsets the end face by a specified distance along the sweep direction.
127
+
128
+ | Parameter | Type | Description |
129
+ | --- | --- | --- |
130
+ | `value` | `number` | The offset distance. |
131
+
132
+ ### `drill()`
133
+
134
+ Enables or disables drill mode.
135
+
136
+ | Parameter | Type | Description |
137
+ | --- | --- | --- |
138
+ | `value` | `boolean` | `true` to enable (default), `false` to disable. *(optional)* |
139
+
140
+ ### `pick()`
141
+
142
+ Restricts the sweep to only the sketch regions containing the given points.
143
+
144
+ | Parameter | Type | Description |
145
+ | --- | --- | --- |
146
+ | `...points` | [[api/types/point2dlike]][] | 2D points in the sketch plane identifying regions to sweep. *(optional)* |
147
+
148
+ ### `thin()`
149
+
150
+ ```ts
151
+ thin(offset: number): this
152
+ thin(offset1: number, offset2: number): this
153
+ ```
154
+
155
+ Enables thin sweep mode — offsets the profile edges to create a thin-walled
156
+ swept shell instead of sweeping filled faces. Positive values offset outward,
157
+ negative values offset inward.
158
+
159
+ | Parameter | Type | Description |
160
+ | --- | --- | --- |
161
+ | `offset1` | `number` | The first wall offset distance. Positive = outward, negative = inward. |
162
+ | `offset2` | `number` | The second wall offset distance, in the opposite direction of offset1. |
163
+
164
+ ### `capFaces()`
165
+
166
+ Selects the cap faces at the open ends of a thin-walled sweep from an open profile.
167
+ These are the small faces connecting the inner and outer walls at the profile endpoints.
168
+
169
+ **Returns**: [[api/types/scene-object]].
170
+
171
+ | Parameter | Type | Description |
172
+ | --- | --- | --- |
173
+ | `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
174
+
175
+ ### `capEdges()`
176
+
177
+ Selects edges on the cap faces of a thin-walled sweep from an open profile.
178
+
179
+ **Returns**: [[api/types/scene-object]].
180
+
181
+ | Parameter | Type | Description |
182
+ | --- | --- | --- |
183
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
184
+
185
+ ## Inherited
186
+
187
+ From [[api/types/boolean-operation]]: `add()`, `'new'()`, `remove()`, `scope()`
188
+
189
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,46 @@
1
+ ---
2
+ id: api/types/tangent-arc-two-objects
3
+ title: TangentArcTwoObjects
4
+ summary: "The TangentArcTwoObjects type. Extends Geometry; adds 2 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [TangentArcTwoObjects, ITangentArcTwoObjects]
7
+ seeAlso: [api/tarc, api/types/geometry]
8
+ ---
9
+ # TangentArcTwoObjects
10
+
11
+ ```ts
12
+ interface TangentArcTwoObjects extends Geometry {
13
+ start(index?: number): Vertex;
14
+ end(index?: number): Vertex;
15
+ }
16
+ ```
17
+
18
+ Extends [[api/types/geometry]].
19
+
20
+ ## Methods
21
+
22
+ ### `start()`
23
+
24
+ Returns the start vertex of the tangent arc.
25
+
26
+ **Returns**: [[api/types/vertex]].
27
+
28
+ | Parameter | Type | Description |
29
+ | --- | --- | --- |
30
+ | `index` | `number` | Solution index when multiple tangent arcs exist (defaults to 0). *(optional)* |
31
+
32
+ ### `end()`
33
+
34
+ Returns the end vertex of the tangent arc.
35
+
36
+ **Returns**: [[api/types/vertex]].
37
+
38
+ | Parameter | Type | Description |
39
+ | --- | --- | --- |
40
+ | `index` | `number` | Solution index when multiple tangent arcs exist (defaults to 0). *(optional)* |
41
+
42
+ ## Inherited
43
+
44
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
45
+
46
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: api/types/transformable
3
+ title: Transformable
4
+ summary: "Scene objects that can be chained with world-space transformations."
5
+ tags: [api, type, interface]
6
+ symbols: [Transformable, ITransformable]
7
+ seeAlso: [api/types/scene-object, api/translate, api/rotate]
8
+ ---
9
+ # Transformable
10
+
11
+ ```ts
12
+ interface Transformable extends SceneObject {
13
+ transform(matrix: Matrix4): this;
14
+ translate(x: number): this;
15
+ translate(x: number, y: number): this;
16
+ translate(x: number, y: number, z: number): this;
17
+ translate(offset: PointLike): this;
18
+ rotate(angle: number): this;
19
+ rotate(axis: AxisLike, angle: number): this;
20
+ mirror(plane: PlaneLike): this;
21
+ mirror(axis: AxisLike): this;
22
+ }
23
+ ```
24
+
25
+ Scene objects that can be chained with world-space transformations.
26
+ The chained form `obj.translate(...)` / `obj.rotate(...)` / `obj.mirror(...)`
27
+ applies the transform to the object's built shapes; it does not create
28
+ a separate history entry like the free-function `translate()` does.
29
+
30
+ Container objects (sketches, parts, repeat/mirror features) deliberately
31
+ do not expose this interface — apply transforms to their contents instead.
32
+
33
+ Extends [[api/types/scene-object]].
34
+
35
+ ## Methods
36
+
37
+ ### `transform()`
38
+
39
+ Composes a 4x4 transformation matrix onto this object. Applied to the
40
+ object's own shapes after build. Chained calls compose left-to-right:
41
+ `.translate(T).rotate(R)` applies translation first, then rotation.
42
+
43
+ | Parameter | Type | Description |
44
+ | --- | --- | --- |
45
+ | `matrix` | `Matrix4` | |
46
+
47
+ ### `translate()`
48
+
49
+ ```ts
50
+ translate(x: number): this
51
+ translate(x: number, y: number): this
52
+ translate(x: number, y: number, z: number): this
53
+ translate(offset: PointLike): this
54
+ ```
55
+
56
+ Translate along X.
57
+
58
+ | Parameter | Type | Description |
59
+ | --- | --- | --- |
60
+ | `x` | `number` | |
61
+ | `y` | `number` | |
62
+ | `z` | `number` | |
63
+
64
+ ### `rotate()`
65
+
66
+ ```ts
67
+ rotate(angle: number): this
68
+ rotate(axis: AxisLike, angle: number): this
69
+ ```
70
+
71
+ Rotate by an angle around world Z through the origin.
72
+
73
+ | Parameter | Type | Description |
74
+ | --- | --- | --- |
75
+ | `axis` | [[api/types/axis-like]] | The axis to rotate around. Use `local(...)` to reference a sketch-local axis. |
76
+ | `angle` | `number` | Rotation in degrees. |
77
+
78
+ ### `mirror()`
79
+
80
+ ```ts
81
+ mirror(plane: PlaneLike): this
82
+ mirror(axis: AxisLike): this
83
+ ```
84
+
85
+ Mirror across a plane.
86
+
87
+ | Parameter | Type | Description |
88
+ | --- | --- | --- |
89
+ | `plane` | [[api/types/plane-like]] | |
90
+
91
+ ## Inherited
92
+
93
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,27 @@
1
+ ---
2
+ id: api/types/trim
3
+ title: Trim
4
+ summary: "The Trim type. Defines 1 method."
5
+ tags: [api, type, interface]
6
+ symbols: [Trim, ITrim]
7
+ seeAlso: [api/split-trim]
8
+ ---
9
+ # Trim
10
+
11
+ ```ts
12
+ interface Trim {
13
+ pick(...points: Point2DLike[]): Trim;
14
+ }
15
+ ```
16
+
17
+ ## Methods
18
+
19
+ ### `pick()`
20
+
21
+ Enters interactive trimming mode, optionally trimming edges at the given points.
22
+
23
+ **Returns**: [[api/types/trim]].
24
+
25
+ | Parameter | Type | Description |
26
+ | --- | --- | --- |
27
+ | `...points` | [[api/types/point2dlike]][] | Points where geometry should be trimmed; the nearest edge segment to each point is removed. *(optional)* |
@@ -0,0 +1,46 @@
1
+ ---
2
+ id: api/types/two-objects-tangent-line
3
+ title: TwoObjectsTangentLine
4
+ summary: "The TwoObjectsTangentLine type. Extends Geometry; adds 2 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [TwoObjectsTangentLine, ITwoObjectsTangentLine]
7
+ seeAlso: [api/tline, api/types/geometry]
8
+ ---
9
+ # TwoObjectsTangentLine
10
+
11
+ ```ts
12
+ interface TwoObjectsTangentLine extends Geometry {
13
+ start(index?: number): Vertex;
14
+ end(index?: number): Vertex;
15
+ }
16
+ ```
17
+
18
+ Extends [[api/types/geometry]].
19
+
20
+ ## Methods
21
+
22
+ ### `start()`
23
+
24
+ Returns the start vertex of the tangent line.
25
+
26
+ **Returns**: [[api/types/vertex]].
27
+
28
+ | Parameter | Type | Description |
29
+ | --- | --- | --- |
30
+ | `index` | `number` | Solution index when multiple tangent lines exist (defaults to 0). *(optional)* |
31
+
32
+ ### `end()`
33
+
34
+ Returns the end vertex of the tangent line.
35
+
36
+ **Returns**: [[api/types/vertex]].
37
+
38
+ | Parameter | Type | Description |
39
+ | --- | --- | --- |
40
+ | `index` | `number` | Solution index when multiple tangent lines exist (defaults to 0). *(optional)* |
41
+
42
+ ## Inherited
43
+
44
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
45
+
46
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,17 @@
1
+ ---
2
+ id: api/types/vertex
3
+ title: Vertex
4
+ summary: "A lazy-evaluated vertex representing a point on existing geometry."
5
+ tags: [api, type, union]
6
+ symbols: [Vertex, LazyVertex]
7
+ seeAlso: [api/types/point2dlike]
8
+ ---
9
+ # Vertex
10
+
11
+ ```ts
12
+ type Vertex = Vertex;
13
+ ```
14
+
15
+ A lazy-evaluated vertex representing a point on geometry. Vertices are returned by methods like `start()`, `end()`, and `tangent()` on `Geometry` types.
16
+
17
+ Vertices can be passed as a [[api/types/point2dlike]] to any function that accepts a 2D point, allowing you to reference points on existing geometry.
@@ -0,0 +1,35 @@
1
+ ---
2
+ id: api/types/vline
3
+ title: VLine
4
+ summary: "The VLine type. Extends Geometry; adds 1 method."
5
+ tags: [api, type, interface]
6
+ symbols: [VLine, IVLine]
7
+ seeAlso: [api/line, api/types/geometry]
8
+ ---
9
+ # VLine
10
+
11
+ ```ts
12
+ interface VLine extends Geometry {
13
+ centered(value?: boolean): this;
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/geometry]].
18
+
19
+ ## Methods
20
+
21
+ ### `centered()`
22
+
23
+ Controls whether the line is centered on the current position.
24
+ When `true`, the line is offset backward by half its length so that the
25
+ current position falls at its midpoint.
26
+
27
+ | Parameter | Type | Description |
28
+ | --- | --- | --- |
29
+ | `value` | `boolean` | `true` to center, `false` (default) to start from the current position. *(optional)* |
30
+
31
+ ## Inherited
32
+
33
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
34
+
35
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: concepts/coordinate-system
3
+ title: Coordinate systems and sketch axes
4
+ summary: World axes are x, y, z. Standard planes are xy, xz, yz. "x"/"y"/"z" always mean world axes — even inside a sketch. Use local("x" | "y" | "z") for the sketch plane's local axes.
5
+ tags: [concept, geometry]
6
+ seeAlso: [api/sketch]
7
+ ---
8
+
9
+ # Coordinate systems
10
+
11
+ ## World
12
+
13
+ - Right-handed: `+X` right, `+Y` away, `+Z` up.
14
+ - Axes: `"x"`, `"y"`, `"z"`.
15
+ - Standard planes: `"xy"`, `"xz"`, `"yz"`. Aliases like `"front"` are
16
+ also recognized — `"front"` is the XZ plane.
17
+
18
+ ## Sketch-local axes
19
+
20
+ `"x"`, `"y"`, `"z"` **always refer to world axes**, including inside a
21
+ `sketch(...)` callback. To refer to the active sketch plane's local
22
+ axes, use `local("x" | "y" | "z")`:
23
+
24
+ ```js
25
+ sketch(tiltedPlane, () => {
26
+ // "x" here is still the WORLD x axis
27
+ mirror("x");
28
+
29
+ // use local(...) for the sketch plane's local X
30
+ mirror(local("x"));
31
+ });
32
+
33
+ // local(...) also works outside the sketch callback,
34
+ // resolved against the currently active sketch plane:
35
+ mirror(local("x"));
36
+ ```
37
+
38
+ ## Reference geometry
39
+
40
+ - `plane(name | face, options)` — build a new plane offset/rotated from
41
+ an existing one, or derived from a face.
42
+ - `axis(name | edge, options)` — same idea for axes.
43
+
44
+ These are the only things that need to know about coordinate systems
45
+ explicitly; everything else flows from the active sketch's plane.
@@ -0,0 +1,40 @@
1
+ ---
2
+ id: concepts/history-and-rollback
3
+ title: History and rollback
4
+ summary: The feature tree is also a timeline. Rollback shows the scene at any earlier point; breakpoints stop evaluation there for inspection.
5
+ tags: [concept, debug]
6
+ seeAlso: [concepts/scene-graph]
7
+ ---
8
+
9
+ # History and rollback
10
+
11
+ The ordered feature tree is also a timeline. You can:
12
+
13
+ - **Rollback** to any operation index: the renderer stops there and emits
14
+ the partial scene. The UI shows the same view as if the script ended at
15
+ that point.
16
+ - **Set a breakpoint** at a source line: evaluation halts there, the
17
+ renderer marks `breakpointHit: true`, and downstream operations don't
18
+ run. Useful for inspecting an intermediate state without changing the
19
+ script.
20
+
21
+ The MCP `rollback_to(index)` and `add_breakpoint(file, line)` /
22
+ `clear_breakpoints()` tools drive both of these without editing source.
23
+
24
+ ## What rollback does NOT touch
25
+
26
+ - The source file. Rollback is a render-time operation; the file on disk
27
+ is unchanged.
28
+ - The previous cache. `SceneCompare` still reuses shapes from before the
29
+ rollback when re-rendering forward.
30
+
31
+ ## When to use rollback over editing the source
32
+
33
+ - Inspecting whether a specific feature is the cause of a problem.
34
+ - Capturing a screenshot of an intermediate step (e.g., the sketch before
35
+ the extrude consumes it).
36
+ - Confirming the order of operations in the timeline matches what the
37
+ agent expects.
38
+
39
+ After a rollback, re-issuing `recompute` or letting the file watcher fire
40
+ the next `live-update` resets to the full scene.
@@ -0,0 +1,49 @@
1
+ ---
2
+ id: concepts/last-selection
3
+ title: Implicit "last-X" context (last sketch, last selection)
4
+ summary: Many operations have a default target. extrude consumes the last sketch; fillet consumes the last selection. Pass arguments explicitly to override.
5
+ tags: [concept, architecture]
6
+ seeAlso: [concepts/scene-graph, api/sketch, api/extrude, api/fillet]
7
+ ---
8
+
9
+ # The "last-X" context
10
+
11
+ FluidCAD threads several implicit contexts through a script so common
12
+ patterns stay terse:
13
+
14
+ | Op | Default target |
15
+ |----|----------------|
16
+ | `extrude` / `cut` / `revolve` / `sweep` | last sketch |
17
+ | `loft` | all current sketches as profiles (or pass them explicitly) |
18
+ | `fillet` / `chamfer` / `shell` / `color` / `draft` | last selection (`select(...)` or a direct accessor immediately before) |
19
+ | `repeat` (no last arg) | last created operation |
20
+ | `copy` (no last arg) | last object |
21
+ | `subtract` / `fuse` / `common` (with args) | the given objects |
22
+
23
+ ## Patterns
24
+
25
+ ```fluid.js
26
+ // Last-sketch consumption
27
+ sketch("xy", () => rect(100, 60).centered());
28
+ extrude(30); // ← consumes the rect
29
+
30
+ // Last-selection consumption via direct accessor
31
+ const e = extrude(30);
32
+ fillet(5, e.endEdges()); // explicit form (preferred)
33
+
34
+ // Last-selection consumption via select()
35
+ select(edge().verticalTo("xy"));
36
+ fillet(3); // picks up the selection
37
+ ```
38
+
39
+ ## When the implicit form bites
40
+
41
+ - A sketch is consumed exactly once. To use it twice, mark it `.reusable()`.
42
+ - A selection is good for the very next op. If you do anything between
43
+ `select(...)` and the consumer, capture the selection in a variable.
44
+ - For multi-step pipelines, explicit arguments are clearer than relying
45
+ on the implicit chain.
46
+
47
+ When the agent is unsure which sketch will be consumed, use
48
+ `get_scene_summary` to see the current tree and which operation pulled
49
+ which inputs.
@@ -0,0 +1,37 @@
1
+ ---
2
+ id: concepts/scene-graph
3
+ title: The scene graph and feature tree
4
+ summary: Each call to a feature (sketch, extrude, fillet, …) appends a SceneObject to an ordered feature tree. The tree drives history, rollback, and shape reuse across re-renders.
5
+ tags: [concept, architecture]
6
+ seeAlso: [concepts/last-selection, concepts/history-and-rollback, api/sketch, api/extrude]
7
+ ---
8
+
9
+ # The scene graph
10
+
11
+ A FluidCAD script is read top-to-bottom; each modeling call appends one
12
+ `SceneObject` to an ordered **feature tree**. The tree is the canonical
13
+ source for everything that happens later:
14
+
15
+ - Renders walk it in order, producing meshes and an `id` per object.
16
+ - Rollback shows the partial state at any point in the tree.
17
+ - Re-renders compare the new tree against the previous one and **reuse**
18
+ unchanged OCC shapes (this is what makes parameter tweaks fast).
19
+
20
+ Containers (like `part(...)`) introduce a sub-tree: their children only
21
+ auto-fuse with each other, not with the outside world.
22
+
23
+ ## Implicit consumption
24
+
25
+ Most features consume the **last** matching item (last sketch, last
26
+ selection, last operation). See [[concepts/last-selection]] for the full
27
+ rules. The feature tree records both the consumer and what it consumed —
28
+ so swapping a sketch's parameters in source code can be reused without
29
+ re-running everything downstream.
30
+
31
+ ## What the agent gets
32
+
33
+ `get_scene_summary` returns the feature tree projected to a JSON-safe
34
+ view: one entry per operation, with `kind` (`sketch`, `extrude`, …),
35
+ `params` (operation-specific), `sourceLocation` (file + line), and
36
+ `shapeIds`. `list_shapes` returns the flat shape list with the owning
37
+ operation's id. Pair them when answering "what does shape X come from?"