fluidcad 0.0.33 → 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 +2 -1
- package/lib/dist/common/scene-object.js +3 -2
- package/lib/dist/core/2d/tarc.d.ts +20 -2
- package/lib/dist/core/2d/tarc.js +24 -0
- package/lib/dist/core/interfaces.d.ts +31 -2
- package/lib/dist/core/repeat.js +62 -46
- 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/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/shell.d.ts +4 -1
- package/lib/dist/features/shell.js +14 -3
- package/lib/dist/helpers/clone-transform.d.ts +2 -1
- package/lib/dist/index.d.ts +7 -1
- package/lib/dist/index.js +3 -3
- package/lib/dist/math/lazy-matrix.d.ts +31 -0
- package/lib/dist/math/lazy-matrix.js +66 -0
- 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/mesh.d.ts +9 -4
- package/lib/dist/oc/mesh.js +14 -13
- package/lib/dist/oc/shell-ops.d.ts +2 -1
- package/lib/dist/oc/shell-ops.js +5 -2
- 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 +2 -2
- 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 +3 -0
- package/lib/dist/rendering/render.js +7 -2
- 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/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/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/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-CFi9p7wR.js → index-BdqrMDRu.js} +21 -21
- package/ui/dist/index.html +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/edge-filter
|
|
3
|
+
title: edge() — edge filter builder
|
|
4
|
+
summary: Chainable predicate builder for selecting edges by shape, orientation, position, or parent face/object. Like `face()`, chained calls AND together and `.notX()` negates.
|
|
5
|
+
tags: [api, selection, filter]
|
|
6
|
+
symbols: [edge]
|
|
7
|
+
seeAlso: [api/face-filter, api/select]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# edge filter
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/filters`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
edge(): EdgeFilterBuilder
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns a chainable edge filter. Chained predicates AND together.
|
|
19
|
+
|
|
20
|
+
## By shape
|
|
21
|
+
|
|
22
|
+
- `.line(length?)` / `.notLine(...)`
|
|
23
|
+
- `.circle(diameter?)` / `.notCircle(...)`
|
|
24
|
+
- `.arc(radius?)` / `.notArc(...)`
|
|
25
|
+
|
|
26
|
+
## By orientation
|
|
27
|
+
|
|
28
|
+
- `.parallelTo(plane)` / `.notParallelTo(...)`
|
|
29
|
+
- `.verticalTo(plane)` / `.notVerticalTo(...)` — perpendicular to the plane
|
|
30
|
+
|
|
31
|
+
## By position
|
|
32
|
+
|
|
33
|
+
- `.onPlane(plane, offset?)` — accepts `{ offset, bothDirections, partial }`
|
|
34
|
+
- `.above(plane, offset?)`
|
|
35
|
+
- `.below(plane, offset?)`
|
|
36
|
+
- `.intersectsWith(sceneObject)` — edges that cross another scene
|
|
37
|
+
object's edges
|
|
38
|
+
|
|
39
|
+
## By parent
|
|
40
|
+
|
|
41
|
+
- `.belongsToFace(...filtersOrObjects)`
|
|
42
|
+
- `.from(...sceneObjects)`
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```fluid.js
|
|
47
|
+
import { extrude, fillet, rect, select, sketch } from "fluidcad/core";
|
|
48
|
+
import { edge } from "fluidcad/filters";
|
|
49
|
+
|
|
50
|
+
sketch("xy", () => rect(60, 60).centered());
|
|
51
|
+
const e = extrude(20);
|
|
52
|
+
select(edge().verticalTo("xy")); // the 4 vertical corner edges
|
|
53
|
+
fillet(2);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
See [[api/face-filter]] for the face counterpart and [[api/select]] for
|
|
57
|
+
how filters land in the implicit selection.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/ellipse
|
|
3
|
+
title: ellipse(rx, ry)
|
|
4
|
+
summary: Draws an ellipse using semi-radii (half-widths) along the sketch plane's X and Y axes.
|
|
5
|
+
tags: [api, 2d, primitive]
|
|
6
|
+
symbols: [ellipse]
|
|
7
|
+
seeAlso: [api/circle, api/sketch]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# ellipse
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
ellipse(rx, ry)
|
|
16
|
+
ellipse(center, rx, ry)
|
|
17
|
+
ellipse(targetPlane, rx, ry)
|
|
18
|
+
ellipse(targetPlane, center, rx, ry)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`rx` and `ry` are **semi-radii** — half-widths along the plane's X and Y
|
|
22
|
+
axes. (Compare `circle`, which takes a diameter.) Returns
|
|
23
|
+
`ExtrudableGeometry`.
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```fluid.js
|
|
28
|
+
import { ellipse, extrude, sketch } from "fluidcad/core";
|
|
29
|
+
|
|
30
|
+
sketch("xy", () => ellipse(60, 30));
|
|
31
|
+
extrude(8);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
See [[api/circle]] for the symmetric case.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/extrude
|
|
3
|
+
title: extrude(distance, target?)
|
|
4
|
+
summary: Pulls the last sketch (or an explicit one) along the sketch plane normal. Auto-fuses with any solid it touches.
|
|
5
|
+
tags: [api, solid, primitive, 3d]
|
|
6
|
+
symbols: [extrude]
|
|
7
|
+
seeAlso: [api/sketch, api/fillet, concepts/last-selection]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# extrude
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
extrude(target?: SceneObject) // default distance (25)
|
|
16
|
+
extrude(distance: number, target?)
|
|
17
|
+
extrude(distance1, distance2, target?) // two distances → asymmetric extrude
|
|
18
|
+
extrude(face, target?) // extrude up to a face
|
|
19
|
+
extrude("first-face", ...filters, target?) // up to nearest intersecting face
|
|
20
|
+
extrude("last-face", ...filters, target?) // up to farthest intersecting face
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Returns `Extrude` (extends `BooleanOperation`). Pulls the last sketch along
|
|
24
|
+
its plane normal. With no `target`, auto-fuses with anything it touches.
|
|
25
|
+
|
|
26
|
+
## Chain methods
|
|
27
|
+
|
|
28
|
+
- `.symmetric()` — extrude equally in both directions; `extrude(30).symmetric()` gives total span 60.
|
|
29
|
+
- `.draft(angle | [start, end])` — taper. Positive expands outward, negative tapers inward.
|
|
30
|
+
- `.endOffset(d)` — shift the end face by `d` along the extrusion direction.
|
|
31
|
+
- `.thin(offset)` / `.thin(o1, o2)` — thin-walled solid from the profile edges.
|
|
32
|
+
- `.drill(bool)` — `true` (default) treats inner closed regions as holes.
|
|
33
|
+
- `.pick(...points)` — restrict to specific regions of a multi-region sketch.
|
|
34
|
+
- `.add()` / `.new()` / `.remove()` / `.scope(...)` — boolean scope controls.
|
|
35
|
+
|
|
36
|
+
## Direct accessors
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
const e = extrude(30);
|
|
40
|
+
e.startFaces(); e.endFaces(); e.sideFaces();
|
|
41
|
+
e.startEdges(); e.endEdges(); e.sideEdges();
|
|
42
|
+
e.internalFaces(); e.internalEdges();
|
|
43
|
+
e.capFaces(); e.capEdges(); // for thin extrudes from open profiles
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Each accessor takes numeric indices and/or `FaceFilterBuilder` /
|
|
47
|
+
`EdgeFilterBuilder` to scope the selection:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
e.sideFaces(0); // first side face
|
|
51
|
+
e.sideFaces(face().cylinder()); // only cylindrical side faces
|
|
52
|
+
e.endEdges(0, 2); // by index
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
```fluid.js
|
|
58
|
+
import { circle, extrude, rect, select, sketch } from "fluidcad/core";
|
|
59
|
+
import { face } from "fluidcad/filters";
|
|
60
|
+
|
|
61
|
+
sketch("xy", () => rect(100, 60).centered());
|
|
62
|
+
extrude(30); // simple box
|
|
63
|
+
|
|
64
|
+
sketch("xy", () => circle(50));
|
|
65
|
+
extrude(30).symmetric().draft(5); // bidirectional tapered cylinder
|
|
66
|
+
|
|
67
|
+
extrude(30).thin(-2); // thin-walled (2mm inward)
|
|
68
|
+
|
|
69
|
+
const target = select(face().onPlane("xy", 100));
|
|
70
|
+
extrude(target); // extrude up to that face
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
See [[api/fillet]] for follow-up edge filleting, [[api/sketch]] for sketch
|
|
74
|
+
inputs, and [[concepts/last-selection]] for the implicit consumption model.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/face-filter
|
|
3
|
+
title: face() — face filter builder
|
|
4
|
+
summary: Chainable predicate builder for selecting faces by shape, orientation, position, topology, or source. Each chained call narrows the set (AND). Every predicate has a `.notX()` counterpart.
|
|
5
|
+
tags: [api, selection, filter]
|
|
6
|
+
symbols: [face]
|
|
7
|
+
seeAlso: [api/edge-filter, api/select, concepts/last-selection]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# face filter
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/filters`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
face(): FaceFilterBuilder
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns a chainable filter builder. Chain calls narrow the candidate set
|
|
19
|
+
(AND). Negate any criterion with the `not...` form.
|
|
20
|
+
|
|
21
|
+
## By shape
|
|
22
|
+
|
|
23
|
+
- `.planar()` / `.notPlanar()`
|
|
24
|
+
- `.cylinder(diameter?)` / `.notCylinder(...)`
|
|
25
|
+
- `.cylinderCurve(diameter?)` — faces bounded by cylindrical curves
|
|
26
|
+
- `.cone()` / `.notCone()`
|
|
27
|
+
- `.torus(majorRadius?, minorRadius?)`
|
|
28
|
+
- `.circle(diameter?)` — flat disc faces
|
|
29
|
+
|
|
30
|
+
## By orientation & position
|
|
31
|
+
|
|
32
|
+
- `.onPlane(plane, offset?)` / `.notOnPlane(...)`
|
|
33
|
+
- `.parallelTo(plane)` / `.notParallelTo(...)`
|
|
34
|
+
- `.above(plane, offset?)` — entirely above
|
|
35
|
+
- `.below(plane, offset?)`
|
|
36
|
+
- `.intersectsWith(plane)` — faces that cross the plane
|
|
37
|
+
|
|
38
|
+
## By topology
|
|
39
|
+
|
|
40
|
+
- `.edgeCount(n)`
|
|
41
|
+
- `.hasEdge(...filtersOrObjects)`
|
|
42
|
+
|
|
43
|
+
## By source
|
|
44
|
+
|
|
45
|
+
- `.from(...sceneObjects)` — restrict to faces from those objects
|
|
46
|
+
(recurses into containers).
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
```fluid.js
|
|
51
|
+
import { extrude, fillet, rect, select, sketch } from "fluidcad/core";
|
|
52
|
+
import { face } from "fluidcad/filters";
|
|
53
|
+
|
|
54
|
+
sketch("xy", () => rect(100, 80).centered());
|
|
55
|
+
const e = extrude(30);
|
|
56
|
+
select(face().planar().onPlane("xy", 30)); // top face only
|
|
57
|
+
fillet(4);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
See [[api/edge-filter]] for the edge counterpart and [[api/select]] for
|
|
61
|
+
how filters are consumed.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/fillet
|
|
3
|
+
title: fillet(radius, ...edges?)
|
|
4
|
+
summary: Rounds 3D edges (or 2D corners). Defaults to the last selection if no edges are passed.
|
|
5
|
+
tags: [api, solid, edges, 3d]
|
|
6
|
+
symbols: [fillet]
|
|
7
|
+
seeAlso: [api/extrude, concepts/last-selection]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# fillet
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
fillet(radius?: number) // uses last selection, default radius 1
|
|
16
|
+
fillet(radius, ...sceneObjects)
|
|
17
|
+
|
|
18
|
+
// 2D variants:
|
|
19
|
+
fillet(objects: Geometry[])
|
|
20
|
+
fillet(objects: Geometry[], radius)
|
|
21
|
+
fillet(radius, ...objects: Geometry[])
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Returns a `SceneObject`. Operates on the **last selection** when no edges
|
|
25
|
+
are passed — pair with `select()` or a direct accessor like `e.endEdges()`.
|
|
26
|
+
|
|
27
|
+
## Common patterns
|
|
28
|
+
|
|
29
|
+
```fluid.js
|
|
30
|
+
import { extrude, fillet, rect, sketch } from "fluidcad/core";
|
|
31
|
+
|
|
32
|
+
sketch("xy", () => rect(40, 40).centered());
|
|
33
|
+
const e = extrude(30);
|
|
34
|
+
fillet(5, e.endEdges()); // round top edges only
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
fillet(3, e.endEdges(), e.startEdges()); // round top and bottom
|
|
39
|
+
|
|
40
|
+
select(edge().verticalTo("xy"));
|
|
41
|
+
fillet(2); // last-selection form
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## When to reach for chamfer instead
|
|
45
|
+
|
|
46
|
+
For a manufacturing edge break, `chamfer` is usually faster computationally
|
|
47
|
+
and easier to spec from a drawing. Reach for `fillet` when the part is
|
|
48
|
+
visually styled or the round is structurally meaningful (stress relief).
|
|
49
|
+
|
|
50
|
+
See [[api/extrude]] for the geometry produced upstream, and
|
|
51
|
+
[[concepts/last-selection]] for the selection-driven calling convention.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"generatedAt": "2026-05-23T14:34:43.886Z",
|
|
4
|
+
"symbols": {
|
|
5
|
+
"arc": "api/arc",
|
|
6
|
+
"axis": "api/axis",
|
|
7
|
+
"bezier": "api/bezier",
|
|
8
|
+
"fuse": "api/booleans",
|
|
9
|
+
"subtract": "api/booleans",
|
|
10
|
+
"common": "api/booleans",
|
|
11
|
+
"chamfer": "api/chamfer",
|
|
12
|
+
"circle": "api/circle",
|
|
13
|
+
"color": "api/color",
|
|
14
|
+
"connect": "api/connect",
|
|
15
|
+
"outside": "api/constraint-qualifiers",
|
|
16
|
+
"enclosed": "api/constraint-qualifiers",
|
|
17
|
+
"enclosing": "api/constraint-qualifiers",
|
|
18
|
+
"unqualified": "api/constraint-qualifiers",
|
|
19
|
+
"copy": "api/copy",
|
|
20
|
+
"hLine": "api/cursor-lines",
|
|
21
|
+
"vLine": "api/cursor-lines",
|
|
22
|
+
"aLine": "api/cursor-lines",
|
|
23
|
+
"move": "api/cursor-move",
|
|
24
|
+
"hMove": "api/cursor-move",
|
|
25
|
+
"vMove": "api/cursor-move",
|
|
26
|
+
"rMove": "api/cursor-move",
|
|
27
|
+
"pMove": "api/cursor-move",
|
|
28
|
+
"center": "api/cursor-move",
|
|
29
|
+
"cut": "api/cut",
|
|
30
|
+
"draft": "api/draft",
|
|
31
|
+
"edge": "api/edge-filter",
|
|
32
|
+
"ellipse": "api/ellipse",
|
|
33
|
+
"extrude": "api/extrude",
|
|
34
|
+
"face": "api/face-filter",
|
|
35
|
+
"fillet": "api/fillet",
|
|
36
|
+
"line": "api/line",
|
|
37
|
+
"load": "api/load",
|
|
38
|
+
"local": "api/local",
|
|
39
|
+
"loft": "api/loft",
|
|
40
|
+
"mirror": "api/mirror",
|
|
41
|
+
"offset": "api/offset",
|
|
42
|
+
"part": "api/part",
|
|
43
|
+
"plane": "api/plane",
|
|
44
|
+
"polygon": "api/polygon",
|
|
45
|
+
"sphere": "api/primitive-solids",
|
|
46
|
+
"cylinder": "api/primitive-solids",
|
|
47
|
+
"project": "api/project-intersect",
|
|
48
|
+
"intersect": "api/project-intersect",
|
|
49
|
+
"rect": "api/rect",
|
|
50
|
+
"remove": "api/remove",
|
|
51
|
+
"repeat": "api/repeat",
|
|
52
|
+
"revolve": "api/revolve",
|
|
53
|
+
"rib": "api/rib",
|
|
54
|
+
"rotate": "api/rotate",
|
|
55
|
+
"select": "api/select",
|
|
56
|
+
"shell": "api/shell",
|
|
57
|
+
"sketch": "api/sketch",
|
|
58
|
+
"slot": "api/slot",
|
|
59
|
+
"split": "api/split-trim",
|
|
60
|
+
"trim": "api/split-trim",
|
|
61
|
+
"sweep": "api/sweep",
|
|
62
|
+
"tArc": "api/tarc",
|
|
63
|
+
"tCircle": "api/tcircle",
|
|
64
|
+
"tLine": "api/tline",
|
|
65
|
+
"translate": "api/translate",
|
|
66
|
+
"ALine": "api/types/aline",
|
|
67
|
+
"IALine": "api/types/aline",
|
|
68
|
+
"ArcAngles": "api/types/arc-angles",
|
|
69
|
+
"IArcAngles": "api/types/arc-angles",
|
|
70
|
+
"ArcPoints": "api/types/arc-points",
|
|
71
|
+
"IArcPoints": "api/types/arc-points",
|
|
72
|
+
"AxisLike": "api/types/axis-like",
|
|
73
|
+
"AxisObjectBase": "api/types/axis-like",
|
|
74
|
+
"Axis": "api/types/axis",
|
|
75
|
+
"IAxis": "api/types/axis",
|
|
76
|
+
"BooleanOperation": "api/types/boolean-operation",
|
|
77
|
+
"IBooleanOperation": "api/types/boolean-operation",
|
|
78
|
+
"CircularRepeatOptions": "api/types/circular-repeat-options",
|
|
79
|
+
"Common": "api/types/common",
|
|
80
|
+
"ICommon": "api/types/common",
|
|
81
|
+
"Cut": "api/types/cut",
|
|
82
|
+
"ICut": "api/types/cut",
|
|
83
|
+
"Draft": "api/types/draft",
|
|
84
|
+
"IDraft": "api/types/draft",
|
|
85
|
+
"ExtrudableGeometry": "api/types/extrudable-geometry",
|
|
86
|
+
"IExtrudableGeometry": "api/types/extrudable-geometry",
|
|
87
|
+
"Extrude": "api/types/extrude",
|
|
88
|
+
"IExtrude": "api/types/extrude",
|
|
89
|
+
"Geometry": "api/types/geometry",
|
|
90
|
+
"IGeometry": "api/types/geometry",
|
|
91
|
+
"HLine": "api/types/hline",
|
|
92
|
+
"IHLine": "api/types/hline",
|
|
93
|
+
"LinearRepeatOptions": "api/types/linear-repeat-options",
|
|
94
|
+
"Loft": "api/types/loft",
|
|
95
|
+
"ILoft": "api/types/loft",
|
|
96
|
+
"Mirror": "api/types/mirror",
|
|
97
|
+
"IMirror": "api/types/mirror",
|
|
98
|
+
"Offset": "api/types/offset",
|
|
99
|
+
"IOffset": "api/types/offset",
|
|
100
|
+
"PlaneLike": "api/types/plane-like",
|
|
101
|
+
"PlaneObjectBase": "api/types/plane-like",
|
|
102
|
+
"PlaneTransformOptions": "api/types/plane-transform-options",
|
|
103
|
+
"PlaneRenderableOptions": "api/types/plane-transform-options",
|
|
104
|
+
"Plane": "api/types/plane",
|
|
105
|
+
"IPlane": "api/types/plane",
|
|
106
|
+
"PointLike": "api/types/point-like",
|
|
107
|
+
"Point2DLike": "api/types/point2dlike",
|
|
108
|
+
"Polygon": "api/types/polygon",
|
|
109
|
+
"IPolygon": "api/types/polygon",
|
|
110
|
+
"Rect": "api/types/rect",
|
|
111
|
+
"IRect": "api/types/rect",
|
|
112
|
+
"Revolve": "api/types/revolve",
|
|
113
|
+
"IRevolve": "api/types/revolve",
|
|
114
|
+
"Rib": "api/types/rib",
|
|
115
|
+
"IRib": "api/types/rib",
|
|
116
|
+
"SceneObject": "api/types/scene-object",
|
|
117
|
+
"ISceneObject": "api/types/scene-object",
|
|
118
|
+
"Select": "api/types/select",
|
|
119
|
+
"ISelect": "api/types/select",
|
|
120
|
+
"Shell": "api/types/shell",
|
|
121
|
+
"IShell": "api/types/shell",
|
|
122
|
+
"Slot": "api/types/slot",
|
|
123
|
+
"ISlot": "api/types/slot",
|
|
124
|
+
"Sweep": "api/types/sweep",
|
|
125
|
+
"ISweep": "api/types/sweep",
|
|
126
|
+
"TangentArcTwoObjects": "api/types/tangent-arc-two-objects",
|
|
127
|
+
"ITangentArcTwoObjects": "api/types/tangent-arc-two-objects",
|
|
128
|
+
"Transformable": "api/types/transformable",
|
|
129
|
+
"ITransformable": "api/types/transformable",
|
|
130
|
+
"Trim": "api/types/trim",
|
|
131
|
+
"ITrim": "api/types/trim",
|
|
132
|
+
"TwoObjectsTangentLine": "api/types/two-objects-tangent-line",
|
|
133
|
+
"ITwoObjectsTangentLine": "api/types/two-objects-tangent-line",
|
|
134
|
+
"Vertex": "api/types/vertex",
|
|
135
|
+
"LazyVertex": "api/types/vertex",
|
|
136
|
+
"VLine": "api/types/vline",
|
|
137
|
+
"IVLine": "api/types/vline"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/line
|
|
3
|
+
title: line(end) / line(start, end)
|
|
4
|
+
summary: Straight 2D line on the active sketch plane. The single-argument form draws from the cursor to `end`.
|
|
5
|
+
tags: [api, 2d, primitive]
|
|
6
|
+
symbols: [line]
|
|
7
|
+
seeAlso: [api/sketch, api/connect, api/arc]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# line
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
line(end: Point2D)
|
|
16
|
+
line(start: Point2D, end: Point2D)
|
|
17
|
+
line(targetPlane, end)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Returns `Geometry`. The one-argument form draws from the cursor to `end`;
|
|
21
|
+
the cursor advances to `end` afterward.
|
|
22
|
+
|
|
23
|
+
For axis-aligned segments use `hLine` / `vLine`; for angle-relative
|
|
24
|
+
segments use `aLine`. Those keep your intent ("horizontal segment of
|
|
25
|
+
length 30") visible and let the solver resolve targets like
|
|
26
|
+
`hLine(targetCircle)`.
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```fluid.js
|
|
31
|
+
import { extrude, line, sketch } from "fluidcad/core";
|
|
32
|
+
|
|
33
|
+
sketch("xy", () => {
|
|
34
|
+
line([0, 0], [40, 0]);
|
|
35
|
+
line([40, 30]); // continues from the previous cursor
|
|
36
|
+
line([0, 30]);
|
|
37
|
+
line([0, 0]);
|
|
38
|
+
});
|
|
39
|
+
extrude(5);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
See [[api/connect]] for closing a path back to its start.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/load
|
|
3
|
+
title: load(fileName)
|
|
4
|
+
summary: Imports a 3D model file (STEP, STL, etc.) from the project folder. Returns a Transformable SceneObject.
|
|
5
|
+
tags: [api, utility, io]
|
|
6
|
+
symbols: [load]
|
|
7
|
+
seeAlso: [api/translate, api/rotate]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# load
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
load(fileName: string)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Imports an external 3D file by relative filename. Returns a SceneObject
|
|
19
|
+
you can transform like any other (`.translate(...)`, `.rotate(...)`,
|
|
20
|
+
`.mirror(...)`).
|
|
21
|
+
|
|
22
|
+
Supported formats include STEP and STL. The returned `ILoadFile` may
|
|
23
|
+
expose `.noColors()`, `.include(...)`, and `.exclude(...)` to control
|
|
24
|
+
sub-shape selection and STEP colour import — consult the codebase for
|
|
25
|
+
exact behaviour.
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
load("bracket.step")
|
|
31
|
+
.translate(0, 0, 50)
|
|
32
|
+
.rotate("z", 90);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
(Skipped from runtime testing — requires a workspace file.)
|
|
36
|
+
|
|
37
|
+
See [[api/translate]] / [[api/rotate]] for follow-up positioning.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/local
|
|
3
|
+
title: local("x" | "y" | "z")
|
|
4
|
+
summary: Returns an axis interpreted against the active sketch's plane, not the world. Use whenever you mean "this sketch's X axis" rather than world X.
|
|
5
|
+
tags: [api, reference, geometry, 2d]
|
|
6
|
+
symbols: [local]
|
|
7
|
+
seeAlso: [api/axis, api/plane, concepts/coordinate-system]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# local
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
local("x" | "y" | "z")
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`"x"` / `"y"` / `"z"` always refer to **world axes**, even inside a
|
|
19
|
+
sketch on a tilted plane. `local("x")` resolves to the active sketch's
|
|
20
|
+
local X instead. Reach for it whenever you'd otherwise write
|
|
21
|
+
`mirror("x")` and find it mirrors across the world axis rather than the
|
|
22
|
+
sketch axis.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```fluid.js
|
|
27
|
+
import { extrude, local, mirror, plane, rect, sketch } from "fluidcad/core";
|
|
28
|
+
|
|
29
|
+
const tilted = plane("xy", { rotateX: 30 });
|
|
30
|
+
sketch(tilted, () => {
|
|
31
|
+
rect(40, 20).centered();
|
|
32
|
+
mirror(local("x")); // mirror the rect across the sketch's local X
|
|
33
|
+
});
|
|
34
|
+
extrude(4);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
See [[concepts/coordinate-system]] for the full world-vs-local rule, and
|
|
38
|
+
[[api/axis]] for non-local axes.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/loft
|
|
3
|
+
title: loft(...profiles)
|
|
4
|
+
summary: Builds a smooth solid that blends between two or more profile sketches at different positions.
|
|
5
|
+
tags: [api, 3d, solid]
|
|
6
|
+
symbols: [loft]
|
|
7
|
+
seeAlso: [api/sketch, api/sweep, api/extrude]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# loft
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
loft(...profiles: SceneObject[])
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns `Loft` (extends `BooleanOperation`). Each profile is typically a
|
|
19
|
+
sketch on a different plane (or a face selection). The solid interpolates
|
|
20
|
+
between them in order.
|
|
21
|
+
|
|
22
|
+
Chain: `.thin()`, plus the boolean scope methods. Direct accessors:
|
|
23
|
+
`startFaces`, `endFaces`, `sideFaces`, `startEdges`, `endEdges`,
|
|
24
|
+
`sideEdges`, `internalFaces`, `internalEdges`, `capFaces`, `capEdges`.
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
```fluid.js
|
|
29
|
+
import { circle, loft, plane, rect, sketch } from "fluidcad/core";
|
|
30
|
+
|
|
31
|
+
const bottom = sketch("xy", () => circle(40));
|
|
32
|
+
const top = sketch(plane("xy", { offset: 100 }), () => rect(60, 60).centered());
|
|
33
|
+
loft(bottom, top);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
See [[api/sweep]] for path-driven solids and [[api/extrude]] for the
|
|
37
|
+
straight-pull case.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/mirror
|
|
3
|
+
title: mirror(plane | axis | line, ...targets?)
|
|
4
|
+
summary: Reflects sketch geometry across a line/axis or 3D solids across a plane. World-axis strings stay world-axis even inside a sketch — use `local("x")` for the sketch's local X.
|
|
5
|
+
tags: [api, 2d, 3d, transform]
|
|
6
|
+
symbols: [mirror]
|
|
7
|
+
seeAlso: [api/translate, api/rotate, concepts/coordinate-system]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# mirror
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// 2D (inside a sketch)
|
|
16
|
+
mirror(line: SceneObject)
|
|
17
|
+
mirror(axis: AxisLike)
|
|
18
|
+
mirror(line, ...geometries)
|
|
19
|
+
mirror(axis, ...geometries)
|
|
20
|
+
|
|
21
|
+
// 3D
|
|
22
|
+
mirror(plane: PlaneLike, ...objects)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Inside a sketch, reflects geometry across a line or axis. Outside a
|
|
26
|
+
sketch, reflects solids across a plane. The 3D form returns `Mirror`
|
|
27
|
+
(extends `BooleanOperation`) and supports `.exclude(...objects)` to
|
|
28
|
+
skip specific objects.
|
|
29
|
+
|
|
30
|
+
**`"x"` is the world X axis, even inside a sketch.** To mirror across
|
|
31
|
+
the sketch plane's local X, use `mirror(local("x"))`. See
|
|
32
|
+
[[concepts/coordinate-system]] for the full convention.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
```fluid.js
|
|
37
|
+
import { extrude, mirror, rect, sketch } from "fluidcad/core";
|
|
38
|
+
|
|
39
|
+
sketch("xy", () => rect(40, 30).centered());
|
|
40
|
+
const block = extrude(20).new();
|
|
41
|
+
mirror("yz", block); // mirror across the YZ plane
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
See [[api/translate]] / [[api/rotate]] for non-reflective transforms.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/offset
|
|
3
|
+
title: offset(distance?, removeOriginal?)
|
|
4
|
+
summary: Offsets the current sketch wire outward (positive) or inward (negative). Use `.close()` to cap an open offset.
|
|
5
|
+
tags: [api, 2d, modifier]
|
|
6
|
+
symbols: [offset]
|
|
7
|
+
seeAlso: [api/sketch, api/extrude]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# offset
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
offset(distance?, removeOriginal?)
|
|
16
|
+
offset(targetPlane, distance, removeOriginal, ...sourceGeometries)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Returns `Offset`. Default distance is `1`. Chain `.close()` to cap an
|
|
20
|
+
open offset into a closed wire ready for extrusion. Positive distances
|
|
21
|
+
push outward (relative to wire winding); negative pushes inward.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```fluid.js
|
|
26
|
+
import { extrude, offset, rect, sketch } from "fluidcad/core";
|
|
27
|
+
|
|
28
|
+
sketch("xy", () => {
|
|
29
|
+
rect(60, 40).centered();
|
|
30
|
+
offset(5); // 5mm outward offset
|
|
31
|
+
});
|
|
32
|
+
extrude(4);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
See [[api/sketch]] for the parent context and [[api/extrude]] for the
|
|
36
|
+
typical follow-up.
|