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.
- package/README.md +3 -2
- package/bin/commands/init.js +55 -0
- package/bin/commands/mcp.js +33 -0
- package/bin/commands/serve.js +77 -0
- package/bin/fluidcad.js +15 -107
- package/lib/dist/common/scene-object.d.ts +4 -1
- package/lib/dist/common/scene-object.js +9 -2
- package/lib/dist/common/solid.d.ts +4 -1
- package/lib/dist/common/solid.js +13 -0
- package/lib/dist/core/2d/tarc.d.ts +20 -2
- package/lib/dist/core/2d/tarc.js +24 -0
- package/lib/dist/core/index.d.ts +2 -1
- package/lib/dist/core/index.js +1 -0
- package/lib/dist/core/interfaces.d.ts +107 -2
- package/lib/dist/core/load.d.ts +2 -2
- package/lib/dist/core/repeat.js +62 -46
- package/lib/dist/core/rib.d.ts +18 -0
- package/lib/dist/core/rib.js +37 -0
- package/lib/dist/features/2d/arc.d.ts +8 -2
- package/lib/dist/features/2d/arc.js +94 -17
- package/lib/dist/features/2d/back.js +3 -2
- package/lib/dist/features/2d/sketch.d.ts +4 -0
- package/lib/dist/features/2d/sketch.js +21 -0
- package/lib/dist/features/2d/tarc-constrained.d.ts +2 -0
- package/lib/dist/features/2d/tarc-constrained.js +8 -0
- package/lib/dist/features/2d/tarc-radius-to-object.d.ts +16 -0
- package/lib/dist/features/2d/tarc-radius-to-object.js +58 -0
- package/lib/dist/features/2d/tarc-to-object.d.ts +18 -0
- package/lib/dist/features/2d/tarc-to-object.js +66 -0
- package/lib/dist/features/2d/tarc-to-point-tangent.d.ts +2 -0
- package/lib/dist/features/2d/tarc-to-point-tangent.js +3 -0
- package/lib/dist/features/2d/tarc-to-point.d.ts +2 -0
- package/lib/dist/features/2d/tarc-to-point.js +3 -0
- package/lib/dist/features/2d/tarc-with-tangent.d.ts +2 -0
- package/lib/dist/features/2d/tarc-with-tangent.js +3 -0
- package/lib/dist/features/2d/tarc.d.ts +2 -0
- package/lib/dist/features/2d/tarc.js +3 -0
- package/lib/dist/features/extrude-base.d.ts +9 -0
- package/lib/dist/features/extrude-base.js +22 -0
- package/lib/dist/features/extrude-to-face.js +1 -5
- package/lib/dist/features/extrude-two-distances.js +1 -2
- package/lib/dist/features/extrude.js +1 -2
- package/lib/dist/features/load.d.ts +6 -0
- package/lib/dist/features/load.js +53 -1
- package/lib/dist/features/mirror-feature.d.ts +3 -2
- package/lib/dist/features/mirror-feature.js +1 -1
- package/lib/dist/features/repeat-circular.d.ts +3 -3
- package/lib/dist/features/repeat-circular.js +8 -1
- package/lib/dist/features/repeat-linear.d.ts +4 -2
- package/lib/dist/features/repeat-linear.js +10 -1
- package/lib/dist/features/repeat-matrix.d.ts +3 -1
- package/lib/dist/features/repeat-matrix.js +7 -2
- package/lib/dist/features/rib.d.ts +31 -0
- package/lib/dist/features/rib.js +321 -0
- package/lib/dist/features/select.d.ts +1 -0
- package/lib/dist/features/select.js +81 -10
- package/lib/dist/features/shell.d.ts +4 -1
- package/lib/dist/features/shell.js +14 -3
- package/lib/dist/filters/edge/belongs-to-face.d.ts +12 -9
- package/lib/dist/filters/edge/belongs-to-face.js +64 -15
- package/lib/dist/filters/filter-builder-base.d.ts +25 -0
- package/lib/dist/filters/filter-builder-base.js +47 -0
- package/lib/dist/filters/filter.js +39 -14
- package/lib/dist/filters/from-object.d.ts +4 -0
- package/lib/dist/filters/from-object.js +10 -0
- package/lib/dist/helpers/clone-transform.d.ts +2 -1
- package/lib/dist/helpers/scene-helpers.d.ts +1 -1
- package/lib/dist/helpers/scene-helpers.js +146 -12
- package/lib/dist/index.d.ts +7 -1
- package/lib/dist/index.js +3 -3
- package/lib/dist/io/file-import.d.ts +5 -1
- package/lib/dist/io/file-import.js +29 -18
- package/lib/dist/math/lazy-matrix.d.ts +31 -0
- package/lib/dist/math/lazy-matrix.js +66 -0
- package/lib/dist/oc/color-transfer.d.ts +19 -8
- package/lib/dist/oc/color-transfer.js +70 -12
- package/lib/dist/oc/constraints/constraint-solver-adaptor.d.ts +5 -0
- package/lib/dist/oc/constraints/constraint-solver-adaptor.js +16 -0
- package/lib/dist/oc/constraints/constraint-solver.d.ts +4 -0
- package/lib/dist/oc/constraints/curve/curve-constraint-solver.d.ts +4 -0
- package/lib/dist/oc/constraints/curve/curve-constraint-solver.js +3 -0
- package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.d.ts +6 -1
- package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.js +4 -0
- package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.d.ts +8 -0
- package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.js +111 -0
- package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.d.ts +8 -0
- package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.js +161 -0
- package/lib/dist/oc/extrude-ops.d.ts +2 -1
- package/lib/dist/oc/extrude-ops.js +51 -2
- package/lib/dist/oc/mesh.d.ts +9 -4
- package/lib/dist/oc/mesh.js +14 -13
- package/lib/dist/oc/rib-ops.d.ts +35 -0
- package/lib/dist/oc/rib-ops.js +619 -0
- package/lib/dist/oc/shell-ops.d.ts +2 -1
- package/lib/dist/oc/shell-ops.js +5 -2
- package/lib/dist/oc/topology-index.d.ts +6 -0
- package/lib/dist/oc/topology-index.js +36 -0
- package/lib/dist/rendering/mesh-builder.d.ts +3 -0
- package/lib/dist/rendering/mesh-builder.js +8 -4
- package/lib/dist/rendering/render-edge.d.ts +2 -1
- package/lib/dist/rendering/render-edge.js +2 -2
- package/lib/dist/rendering/render-face.d.ts +2 -1
- package/lib/dist/rendering/render-face.js +2 -2
- package/lib/dist/rendering/render-solid.d.ts +2 -1
- package/lib/dist/rendering/render-solid.js +3 -5
- package/lib/dist/rendering/render-wire.d.ts +2 -1
- package/lib/dist/rendering/render-wire.js +2 -2
- package/lib/dist/rendering/render.d.ts +4 -0
- package/lib/dist/rendering/render.js +50 -2
- package/lib/dist/rendering/scene-compare.js +3 -0
- package/lib/dist/rendering/scene.d.ts +1 -0
- package/lib/dist/rendering/scene.js +4 -0
- package/lib/dist/scene-manager.d.ts +4 -2
- package/lib/dist/scene-manager.js +12 -4
- package/lib/dist/tests/features/2d/arc.test.js +64 -0
- package/lib/dist/tests/features/2d/back.test.js +17 -1
- package/lib/dist/tests/features/2d/tarc.test.js +157 -0
- package/lib/dist/tests/features/color-lineage.test.js +18 -0
- package/lib/dist/tests/features/filter-positional.test.d.ts +1 -0
- package/lib/dist/tests/features/filter-positional.test.js +129 -0
- package/lib/dist/tests/features/repeat-user-repro.test.d.ts +1 -0
- package/lib/dist/tests/features/repeat-user-repro.test.js +60 -0
- package/lib/dist/tests/features/rib.test.d.ts +1 -0
- package/lib/dist/tests/features/rib.test.js +598 -0
- package/lib/dist/tests/features/shell.test.js +36 -0
- package/lib/dist/tests/global-setup.js +2 -1
- package/lib/dist/tests/helpers/extract-blocks.d.ts +9 -0
- package/lib/dist/tests/helpers/extract-blocks.js +56 -0
- package/lib/dist/tests/llm-docs-examples.test.d.ts +1 -0
- package/lib/dist/tests/llm-docs-examples.test.js +62 -0
- package/lib/dist/tests/scene-compare.test.d.ts +1 -0
- package/lib/dist/tests/scene-compare.test.js +77 -0
- package/lib/dist/tests/setup.js +2 -1
- package/lib/dist/tsconfig.tsbuildinfo +1 -1
- package/llm-docs/.coverage-allowlist.txt +9 -0
- package/llm-docs/api/arc.md +48 -0
- package/llm-docs/api/axis.md +42 -0
- package/llm-docs/api/bezier.md +42 -0
- package/llm-docs/api/booleans.md +44 -0
- package/llm-docs/api/chamfer.md +40 -0
- package/llm-docs/api/circle.md +36 -0
- package/llm-docs/api/color.md +34 -0
- package/llm-docs/api/connect.md +41 -0
- package/llm-docs/api/constraint-qualifiers.md +48 -0
- package/llm-docs/api/copy.md +63 -0
- package/llm-docs/api/cursor-lines.md +50 -0
- package/llm-docs/api/cursor-move.md +61 -0
- package/llm-docs/api/cut.md +55 -0
- package/llm-docs/api/draft.md +36 -0
- package/llm-docs/api/edge-filter.md +57 -0
- package/llm-docs/api/ellipse.md +34 -0
- package/llm-docs/api/extrude.md +74 -0
- package/llm-docs/api/face-filter.md +61 -0
- package/llm-docs/api/fillet.md +51 -0
- package/llm-docs/api/index.json +139 -0
- package/llm-docs/api/line.md +42 -0
- package/llm-docs/api/load.md +37 -0
- package/llm-docs/api/local.md +38 -0
- package/llm-docs/api/loft.md +37 -0
- package/llm-docs/api/mirror.md +44 -0
- package/llm-docs/api/offset.md +36 -0
- package/llm-docs/api/part.md +40 -0
- package/llm-docs/api/plane.md +44 -0
- package/llm-docs/api/polygon.md +37 -0
- package/llm-docs/api/primitive-solids.md +39 -0
- package/llm-docs/api/project-intersect.md +48 -0
- package/llm-docs/api/rect.md +48 -0
- package/llm-docs/api/remove.md +32 -0
- package/llm-docs/api/repeat.md +79 -0
- package/llm-docs/api/revolve.md +38 -0
- package/llm-docs/api/rib.md +40 -0
- package/llm-docs/api/rotate.md +37 -0
- package/llm-docs/api/select.md +41 -0
- package/llm-docs/api/shell.md +41 -0
- package/llm-docs/api/sketch.md +76 -0
- package/llm-docs/api/slot.md +36 -0
- package/llm-docs/api/split-trim.md +42 -0
- package/llm-docs/api/sweep.md +43 -0
- package/llm-docs/api/tarc.md +45 -0
- package/llm-docs/api/tcircle.md +38 -0
- package/llm-docs/api/tline.md +42 -0
- package/llm-docs/api/translate.md +40 -0
- package/llm-docs/api/types/aline.md +35 -0
- package/llm-docs/api/types/arc-angles.md +29 -0
- package/llm-docs/api/types/arc-points.md +48 -0
- package/llm-docs/api/types/axis-like.md +38 -0
- package/llm-docs/api/types/axis.md +21 -0
- package/llm-docs/api/types/boolean-operation.md +50 -0
- package/llm-docs/api/types/circular-repeat-options.md +31 -0
- package/llm-docs/api/types/common.md +32 -0
- package/llm-docs/api/types/cut.md +125 -0
- package/llm-docs/api/types/draft.md +21 -0
- package/llm-docs/api/types/extrudable-geometry.md +23 -0
- package/llm-docs/api/types/extrude.md +194 -0
- package/llm-docs/api/types/geometry.md +51 -0
- package/llm-docs/api/types/hline.md +35 -0
- package/llm-docs/api/types/linear-repeat-options.md +31 -0
- package/llm-docs/api/types/loft.md +154 -0
- package/llm-docs/api/types/mirror.md +35 -0
- package/llm-docs/api/types/offset.md +31 -0
- package/llm-docs/api/types/plane-like.md +35 -0
- package/llm-docs/api/types/plane-transform-options.md +29 -0
- package/llm-docs/api/types/plane.md +21 -0
- package/llm-docs/api/types/point-like.md +22 -0
- package/llm-docs/api/types/point2dlike.md +26 -0
- package/llm-docs/api/types/polygon.md +46 -0
- package/llm-docs/api/types/rect.md +128 -0
- package/llm-docs/api/types/revolve.md +102 -0
- package/llm-docs/api/types/rib.md +133 -0
- package/llm-docs/api/types/scene-object.md +33 -0
- package/llm-docs/api/types/select.md +21 -0
- package/llm-docs/api/types/shell.md +54 -0
- package/llm-docs/api/types/slot.md +43 -0
- package/llm-docs/api/types/sweep.md +189 -0
- package/llm-docs/api/types/tangent-arc-two-objects.md +46 -0
- package/llm-docs/api/types/transformable.md +93 -0
- package/llm-docs/api/types/trim.md +27 -0
- package/llm-docs/api/types/two-objects-tangent-line.md +46 -0
- package/llm-docs/api/types/vertex.md +17 -0
- package/llm-docs/api/types/vline.md +35 -0
- package/llm-docs/concepts/coordinate-system.md +45 -0
- package/llm-docs/concepts/history-and-rollback.md +40 -0
- package/llm-docs/concepts/last-selection.md +49 -0
- package/llm-docs/concepts/scene-graph.md +37 -0
- package/llm-docs/index.json +1750 -0
- package/mcp/dist/client.d.ts +64 -0
- package/mcp/dist/client.js +248 -0
- package/mcp/dist/discovery.d.ts +11 -0
- package/mcp/dist/discovery.js +78 -0
- package/mcp/dist/docs-index.d.ts +81 -0
- package/mcp/dist/docs-index.js +261 -0
- package/mcp/dist/resources.d.ts +4 -0
- package/mcp/dist/resources.js +115 -0
- package/mcp/dist/server.d.ts +12 -0
- package/mcp/dist/server.js +489 -0
- package/mcp/dist/tools/coordination.d.ts +9 -0
- package/mcp/dist/tools/coordination.js +46 -0
- package/mcp/dist/tools/docs.d.ts +66 -0
- package/mcp/dist/tools/docs.js +122 -0
- package/mcp/dist/tools/engine.d.ts +56 -0
- package/mcp/dist/tools/engine.js +145 -0
- package/mcp/dist/tools/inspection.d.ts +75 -0
- package/mcp/dist/tools/inspection.js +121 -0
- package/mcp/dist/tools/screenshot.d.ts +63 -0
- package/mcp/dist/tools/screenshot.js +263 -0
- package/mcp/dist/tools/source.d.ts +84 -0
- package/mcp/dist/tools/source.js +434 -0
- package/mcp/dist/tools/workspaces.d.ts +13 -0
- package/mcp/dist/tools/workspaces.js +33 -0
- package/mcp/dist/types.d.ts +18 -0
- package/mcp/dist/types.js +11 -0
- package/package.json +19 -5
- package/server/dist/code-editor.d.ts +36 -0
- package/server/dist/code-editor.js +8 -0
- package/server/dist/fluidcad-server.d.ts +50 -0
- package/server/dist/fluidcad-server.js +153 -1
- package/server/dist/global-registry.d.ts +30 -0
- package/server/dist/global-registry.js +126 -0
- package/server/dist/index.js +171 -26
- package/server/dist/instance-file.d.ts +31 -0
- package/server/dist/instance-file.js +73 -0
- package/server/dist/lint-fluid-js.d.ts +15 -0
- package/server/dist/lint-fluid-js.js +271 -0
- package/server/dist/routes/editor.d.ts +24 -0
- package/server/dist/routes/editor.js +44 -0
- package/server/dist/routes/export.d.ts +1 -1
- package/server/dist/routes/export.js +45 -8
- package/server/dist/routes/health.d.ts +7 -0
- package/server/dist/routes/health.js +14 -0
- package/server/dist/routes/lint.d.ts +10 -0
- package/server/dist/routes/lint.js +28 -0
- package/server/dist/routes/render.d.ts +33 -0
- package/server/dist/routes/render.js +34 -0
- package/server/dist/routes/scene.d.ts +5 -0
- package/server/dist/routes/scene.js +48 -0
- package/server/dist/routes/screenshot.js +68 -1
- package/server/dist/ws-protocol.d.ts +56 -2
- package/ui/dist/assets/{index-DMw0OYCF.js → index-BdqrMDRu.js} +30 -30
- 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?"
|