fluidcad 0.0.36 → 0.0.38
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/LICENSE.txt +21 -504
- package/README.md +1 -1
- package/lib/dist/common/edge.d.ts +1 -1
- package/lib/dist/common/face.d.ts +1 -1
- package/lib/dist/common/scene-object.d.ts +6 -0
- package/lib/dist/common/scene-object.js +8 -0
- package/lib/dist/common/shape-factory.d.ts +1 -1
- package/lib/dist/common/shape-history-tracker.d.ts +1 -1
- package/lib/dist/common/shape.d.ts +1 -1
- package/lib/dist/common/solid.d.ts +1 -1
- package/lib/dist/common/transformable-primitive.d.ts +12 -1
- package/lib/dist/common/transformable-primitive.js +27 -0
- package/lib/dist/common/vertex.d.ts +1 -1
- package/lib/dist/common/wire.d.ts +1 -1
- package/lib/dist/core/2d/index.d.ts +1 -0
- package/lib/dist/core/2d/index.js +1 -0
- package/lib/dist/core/2d/text.d.ts +30 -0
- package/lib/dist/core/2d/text.js +37 -0
- package/lib/dist/core/helix.d.ts +20 -0
- package/lib/dist/core/helix.js +36 -0
- package/lib/dist/core/index.d.ts +3 -1
- package/lib/dist/core/index.js +2 -0
- package/lib/dist/core/interfaces.d.ts +180 -0
- package/lib/dist/core/plane.d.ts +26 -6
- package/lib/dist/core/plane.js +21 -44
- package/lib/dist/core/wrap.d.ts +17 -0
- package/lib/dist/core/wrap.js +39 -0
- package/lib/dist/features/2d/offset.js +2 -2
- package/lib/dist/features/2d/text.d.ts +67 -0
- package/lib/dist/features/2d/text.js +320 -0
- package/lib/dist/features/cylinder.d.ts +3 -1
- package/lib/dist/features/cylinder.js +5 -2
- package/lib/dist/features/extrude-base.d.ts +1 -0
- package/lib/dist/features/extrude-to-face.d.ts +1 -0
- package/lib/dist/features/extrude-to-face.js +6 -0
- package/lib/dist/features/fillet.d.ts +1 -1
- package/lib/dist/features/helix.d.ts +41 -0
- package/lib/dist/features/helix.js +337 -0
- package/lib/dist/features/plane-from-object.d.ts +16 -4
- package/lib/dist/features/plane-from-object.js +101 -8
- package/lib/dist/features/select.js +32 -8
- package/lib/dist/features/simple-extruder.d.ts +1 -1
- package/lib/dist/features/simple-extruder.js +7 -2
- package/lib/dist/features/sphere.d.ts +3 -1
- package/lib/dist/features/sphere.js +5 -2
- package/lib/dist/features/sweep.js +7 -2
- package/lib/dist/features/wrap.d.ts +39 -0
- package/lib/dist/features/wrap.js +116 -0
- package/lib/dist/filters/edge/belongs-to-face.d.ts +3 -1
- package/lib/dist/filters/edge/belongs-to-face.js +14 -10
- package/lib/dist/filters/filter.d.ts +1 -1
- package/lib/dist/filters/from-object.d.ts +1 -1
- package/lib/dist/filters/tangent-expander.d.ts +1 -1
- package/lib/dist/filters/tangent-expander.js +57 -40
- package/lib/dist/helpers/scene-helpers.d.ts +2 -0
- package/lib/dist/helpers/scene-helpers.js +1 -1
- package/lib/dist/index.d.ts +2 -0
- package/lib/dist/index.js +3 -1
- package/lib/dist/io/file-import.d.ts +7 -0
- package/lib/dist/io/file-import.js +28 -1
- package/lib/dist/io/font-registry.d.ts +45 -0
- package/lib/dist/io/font-registry.js +272 -0
- package/lib/dist/math/bspline-interpolation.d.ts +29 -0
- package/lib/dist/math/bspline-interpolation.js +194 -0
- package/lib/dist/oc/boolean-ops.d.ts +3 -1
- package/lib/dist/oc/boolean-ops.js +15 -1
- package/lib/dist/oc/color-transfer.d.ts +1 -1
- package/lib/dist/oc/constraints/constraint-helpers.d.ts +4 -4
- package/lib/dist/oc/constraints/curve/tangent-circle-solver.js +10 -9
- package/lib/dist/oc/constraints/curve/tangent-line-solver.js +5 -6
- package/lib/dist/oc/convert.d.ts +1 -1
- package/lib/dist/oc/draft-ops.d.ts +1 -1
- package/lib/dist/oc/edge-ops.d.ts +2 -2
- package/lib/dist/oc/edge-ops.js +13 -14
- package/lib/dist/oc/edge-props.d.ts +1 -1
- package/lib/dist/oc/edge-query.d.ts +1 -1
- package/lib/dist/oc/edge-query.js +3 -8
- package/lib/dist/oc/errors.d.ts +8 -0
- package/lib/dist/oc/errors.js +27 -0
- package/lib/dist/oc/explorer.d.ts +2 -2
- package/lib/dist/oc/extrude-ops.d.ts +28 -2
- package/lib/dist/oc/extrude-ops.js +56 -7
- package/lib/dist/oc/face-ops.d.ts +2 -1
- package/lib/dist/oc/face-ops.js +11 -0
- package/lib/dist/oc/face-props.d.ts +1 -1
- package/lib/dist/oc/face-query.d.ts +12 -1
- package/lib/dist/oc/face-query.js +39 -0
- package/lib/dist/oc/fillet-ops.d.ts +1 -1
- package/lib/dist/oc/fillet-ops.js +4 -4
- package/lib/dist/oc/geometry.d.ts +1 -1
- package/lib/dist/oc/geometry.js +12 -14
- package/lib/dist/oc/helix-ops.d.ts +37 -0
- package/lib/dist/oc/helix-ops.js +88 -0
- package/lib/dist/oc/hit-test.d.ts +1 -1
- package/lib/dist/oc/index.d.ts +4 -0
- package/lib/dist/oc/index.js +2 -0
- package/lib/dist/oc/init.d.ts +1 -1
- package/lib/dist/oc/init.js +1 -1
- package/lib/dist/oc/intersection.js +1 -1
- package/lib/dist/oc/io.d.ts +6 -6
- package/lib/dist/oc/io.js +31 -24
- package/lib/dist/oc/measure/classify.d.ts +34 -0
- package/lib/dist/oc/measure/classify.js +246 -0
- package/lib/dist/oc/measure/measure-ops.d.ts +9 -0
- package/lib/dist/oc/measure/measure-ops.js +210 -0
- package/lib/dist/oc/measure/measure-types.d.ts +39 -0
- package/lib/dist/oc/measure/measure-types.js +1 -0
- package/lib/dist/oc/measure/sampling.d.ts +9 -0
- package/lib/dist/oc/measure/sampling.js +77 -0
- package/lib/dist/oc/measure/vec.d.ts +13 -0
- package/lib/dist/oc/measure/vec.js +23 -0
- package/lib/dist/oc/mesh.d.ts +1 -1
- package/lib/dist/oc/mesh.js +40 -28
- package/lib/dist/oc/path-sampler.d.ts +29 -0
- package/lib/dist/oc/path-sampler.js +63 -0
- package/lib/dist/oc/props.d.ts +1 -1
- package/lib/dist/oc/props.js +4 -1
- package/lib/dist/oc/shape-hash.d.ts +26 -0
- package/lib/dist/oc/shape-hash.js +32 -0
- package/lib/dist/oc/shape-ops.d.ts +5 -3
- package/lib/dist/oc/shape-ops.js +6 -5
- package/lib/dist/oc/sweep-ops.d.ts +13 -1
- package/lib/dist/oc/sweep-ops.js +174 -18
- package/lib/dist/oc/text-outline.d.ts +62 -0
- package/lib/dist/oc/text-outline.js +212 -0
- package/lib/dist/oc/thin-face-maker.d.ts +0 -19
- package/lib/dist/oc/thin-face-maker.js +3 -68
- package/lib/dist/oc/topology-index.d.ts +1 -1
- package/lib/dist/oc/vertex-ops.d.ts +1 -1
- package/lib/dist/oc/wire-ops.d.ts +18 -3
- package/lib/dist/oc/wire-ops.js +56 -5
- package/lib/dist/oc/wrap-development.d.ts +105 -0
- package/lib/dist/oc/wrap-development.js +179 -0
- package/lib/dist/oc/wrap-ops.d.ts +100 -0
- package/lib/dist/oc/wrap-ops.js +406 -0
- package/lib/dist/rendering/render-solid.js +10 -2
- package/lib/dist/scene-manager.d.ts +2 -0
- package/lib/dist/scene-manager.js +29 -0
- package/lib/dist/tests/features/2d/offset.test.js +74 -1
- package/lib/dist/tests/features/cylinder-curve-filter.test.js +3 -3
- package/lib/dist/tests/features/extrude-to-face.test.js +38 -1
- package/lib/dist/tests/features/helix.test.d.ts +1 -0
- package/lib/dist/tests/features/helix.test.js +295 -0
- package/lib/dist/tests/features/plane.test.js +95 -0
- package/lib/dist/tests/features/repeat-primitive.test.d.ts +1 -0
- package/lib/dist/tests/features/repeat-primitive.test.js +60 -0
- package/lib/dist/tests/features/rib.test.js +6 -1
- package/lib/dist/tests/features/sweep.test.js +170 -1
- package/lib/dist/tests/features/text.test.d.ts +1 -0
- package/lib/dist/tests/features/text.test.js +347 -0
- package/lib/dist/tests/features/wrap-development.test.d.ts +1 -0
- package/lib/dist/tests/features/wrap-development.test.js +130 -0
- package/lib/dist/tests/features/wrap-extruded-target.test.d.ts +1 -0
- package/lib/dist/tests/features/wrap-extruded-target.test.js +106 -0
- package/lib/dist/tests/features/wrap-repeat.test.d.ts +1 -0
- package/lib/dist/tests/features/wrap-repeat.test.js +93 -0
- package/lib/dist/tests/features/wrap.test.d.ts +1 -0
- package/lib/dist/tests/features/wrap.test.js +331 -0
- package/lib/dist/tests/math/bspline-interpolation.test.d.ts +1 -0
- package/lib/dist/tests/math/bspline-interpolation.test.js +119 -0
- package/lib/dist/tests/measure.test.d.ts +1 -0
- package/lib/dist/tests/measure.test.js +288 -0
- package/lib/dist/tsconfig.tsbuildinfo +1 -1
- package/llm-docs/api/helix.md +64 -0
- package/llm-docs/api/index.json +11 -2
- package/llm-docs/api/text.md +52 -0
- package/llm-docs/api/types/helix.md +105 -0
- package/llm-docs/api/types/text.md +138 -0
- package/llm-docs/api/types/wrap.md +131 -0
- package/llm-docs/api/wrap.md +62 -0
- package/llm-docs/index.json +121 -1
- package/mcp/dist/server.js +20 -1
- package/mcp/dist/tools/inspection.d.ts +17 -0
- package/mcp/dist/tools/inspection.js +14 -0
- package/package.json +7 -3
- package/server/dist/fluidcad-server.d.ts +11 -1
- package/server/dist/fluidcad-server.js +21 -1
- package/server/dist/index.js +4 -2
- package/server/dist/preferences.d.ts +4 -0
- package/server/dist/preferences.js +2 -0
- package/server/dist/routes/measure.d.ts +3 -0
- package/server/dist/routes/measure.js +32 -0
- package/server/dist/routes/params.js +1 -1
- package/server/dist/routes/preferences.js +6 -0
- package/server/dist/routes/sketch-edits.js +2 -1
- package/ui/dist/assets/{index-MRqwG9Vh.js → index-D8zV21wB.js} +149 -102
- package/ui/dist/assets/{index-CDJmUpFI.css → index-dAFdg2Un.css} +1 -1
- package/ui/dist/index.html +2 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/helix
|
|
3
|
+
title: helix(axis | source)
|
|
4
|
+
summary: Creates a helical wire around an axis or derived from existing geometry (cylindrical/conical face, line or circular edge) — the path for springs, threads, and coils. Sweep a profile along it to make material.
|
|
5
|
+
tags: [api, 3d, wire]
|
|
6
|
+
symbols: [helix]
|
|
7
|
+
seeAlso: [api/sweep, api/axis, api/select, api/types/helix]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# helix
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
helix(axis: AxisLike) // e.g. "z", an axis() object, or axis-like
|
|
16
|
+
helix(source: SceneObject) // face or edge selection
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Returns `Helix` (extends `SceneObject`) — a helical **wire**, not a solid.
|
|
20
|
+
Pass it as the path to `sweep(path, profile)` to build springs and threads.
|
|
21
|
+
|
|
22
|
+
Chain to configure geometry; any two of pitch/turns/height determine the
|
|
23
|
+
third:
|
|
24
|
+
|
|
25
|
+
- `.pitch(p)` — axial rise per full revolution.
|
|
26
|
+
- `.turns(n)` — number of revolutions (fractional allowed; default 1).
|
|
27
|
+
- `.height(h)` — total axial extent (default 50, or `pitch × turns`).
|
|
28
|
+
- `.radius(r)` — start radius (default 20 for axis/line input; for a
|
|
29
|
+
cylindrical face defaults to the face radius).
|
|
30
|
+
- `.endRadius(r)` — end radius; when ≠ `radius()` the helix tapers
|
|
31
|
+
conically. Ignored for face/circular-edge sources.
|
|
32
|
+
- `.startOffset(mm)` / `.endOffset(mm)` — shift the start/end along the
|
|
33
|
+
axis (negative start offset or positive end offset extends past the
|
|
34
|
+
source's bounds — useful for threads that run off the stock).
|
|
35
|
+
|
|
36
|
+
With a `SceneObject` source the frame is derived from the geometry:
|
|
37
|
+
a **cylindrical face** supplies axis, radius, and height; a **conical
|
|
38
|
+
face** makes the helix follow the cone's taper (radii derived, overrides
|
|
39
|
+
ignored); a **line edge** becomes the axis with height = line length; a
|
|
40
|
+
**circular edge** supplies axis (circle normal) and radius. Multi-shape
|
|
41
|
+
sources must be narrowed with `select(...)` to one face or edge.
|
|
42
|
+
|
|
43
|
+
Constraints: turns > 0, pitch ≠ 0, radii > 0 over the whole height.
|
|
44
|
+
|
|
45
|
+
## Example
|
|
46
|
+
|
|
47
|
+
```fluid.js
|
|
48
|
+
import { sketch, circle, hMove, helix, sweep } from "fluidcad/core";
|
|
49
|
+
|
|
50
|
+
const path = helix("z").radius(15).pitch(10).turns(5);
|
|
51
|
+
|
|
52
|
+
const profile = sketch("left", () => {
|
|
53
|
+
hMove(15);
|
|
54
|
+
circle(2);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
sweep(path, profile);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For a thread, build the helix at a cylinder's surface radius (or directly
|
|
61
|
+
from the face via `helix(select(face().cylinder()))`) and sweep a profile —
|
|
62
|
+
the sweep fuses with the cylinder by default; chain `.remove()` on the
|
|
63
|
+
sweep to carve a groove instead. See [[api/sweep]] for sweep options and
|
|
64
|
+
[[api/types/helix]] for the full method list.
|
package/llm-docs/api/index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-06-
|
|
3
|
+
"generatedAt": "2026-06-21T11:15:51.248Z",
|
|
4
4
|
"symbols": {
|
|
5
5
|
"arc": "api/arc",
|
|
6
6
|
"axis": "api/axis",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"extrude": "api/extrude",
|
|
34
34
|
"face": "api/face-filter",
|
|
35
35
|
"fillet": "api/fillet",
|
|
36
|
+
"helix": "api/helix",
|
|
36
37
|
"line": "api/line",
|
|
37
38
|
"load": "api/load",
|
|
38
39
|
"local": "api/local",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"sweep": "api/sweep",
|
|
62
63
|
"tArc": "api/tarc",
|
|
63
64
|
"tCircle": "api/tcircle",
|
|
65
|
+
"text": "api/text",
|
|
64
66
|
"tLine": "api/tline",
|
|
65
67
|
"translate": "api/translate",
|
|
66
68
|
"ALine": "api/types/aline",
|
|
@@ -88,6 +90,8 @@
|
|
|
88
90
|
"IExtrude": "api/types/extrude",
|
|
89
91
|
"Geometry": "api/types/geometry",
|
|
90
92
|
"IGeometry": "api/types/geometry",
|
|
93
|
+
"Helix": "api/types/helix",
|
|
94
|
+
"IHelix": "api/types/helix",
|
|
91
95
|
"HLine": "api/types/hline",
|
|
92
96
|
"IHLine": "api/types/hline",
|
|
93
97
|
"LinearRepeatOptions": "api/types/linear-repeat-options",
|
|
@@ -125,6 +129,8 @@
|
|
|
125
129
|
"ISweep": "api/types/sweep",
|
|
126
130
|
"TangentArcTwoObjects": "api/types/tangent-arc-two-objects",
|
|
127
131
|
"ITangentArcTwoObjects": "api/types/tangent-arc-two-objects",
|
|
132
|
+
"Text": "api/types/text",
|
|
133
|
+
"IText": "api/types/text",
|
|
128
134
|
"Transformable": "api/types/transformable",
|
|
129
135
|
"ITransformable": "api/types/transformable",
|
|
130
136
|
"Trim": "api/types/trim",
|
|
@@ -134,6 +140,9 @@
|
|
|
134
140
|
"Vertex": "api/types/vertex",
|
|
135
141
|
"LazyVertex": "api/types/vertex",
|
|
136
142
|
"VLine": "api/types/vline",
|
|
137
|
-
"IVLine": "api/types/vline"
|
|
143
|
+
"IVLine": "api/types/vline",
|
|
144
|
+
"Wrap": "api/types/wrap",
|
|
145
|
+
"IWrap": "api/types/wrap",
|
|
146
|
+
"wrap": "api/wrap"
|
|
138
147
|
}
|
|
139
148
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/text
|
|
3
|
+
title: text(string) / text(plane, string) / text(string, path)
|
|
4
|
+
summary: Renders a text string as sketch geometry — glyph outlines that extrude, wrap, or follow a path like any other profile.
|
|
5
|
+
tags: [api, 2d, sketch]
|
|
6
|
+
symbols: [text]
|
|
7
|
+
seeAlso: [api/sketch, api/wrap, api/extrude, api/types/text]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# text
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
text(text: string) // inside a sketch, at the cursor
|
|
16
|
+
text(plane: PlaneLike | SceneObject, text: string) // standalone, on a plane or face
|
|
17
|
+
text(text: string, path: SceneObject) // glyphs laid out along a sketch path
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Returns `Text` (an extrudable geometry). Glyph outlines become regular
|
|
21
|
+
sketch profiles: `extrude()` them for 3D text, `wrap()` them onto a
|
|
22
|
+
cylinder, or use them as cut profiles. The string starts at the sketch
|
|
23
|
+
cursor (or the plane origin) with the baseline along the local x axis.
|
|
24
|
+
|
|
25
|
+
Chain methods:
|
|
26
|
+
|
|
27
|
+
- `.size(height)` — cap height in mm (default 10).
|
|
28
|
+
- `.font(name)` / `.weight(400 | "bold")` / `.bold()` / `.italic()` —
|
|
29
|
+
typeface selection; system fonts are resolved by family name.
|
|
30
|
+
- `.align("left" | "center" | "right" | "start" | "end" | "space-between" | "space-around")` —
|
|
31
|
+
alignment relative to the cursor, or along a path; `"space-between"` and
|
|
32
|
+
`"space-around"` distribute glyphs over the whole path like the CSS
|
|
33
|
+
flexbox values (path text only).
|
|
34
|
+
- `.lineSpacing(factor)` / `.letterSpacing(extra)` — multi-line and
|
|
35
|
+
tracking control.
|
|
36
|
+
- Path layout only: `.offset(distance)` — shift glyphs off the path,
|
|
37
|
+
`.flip()` — mirror to the other side, `.startAt(distance)` — arc-length
|
|
38
|
+
start position.
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
|
|
42
|
+
```fluid.js
|
|
43
|
+
import { extrude, sketch, text } from "fluidcad/core";
|
|
44
|
+
|
|
45
|
+
sketch("xz", () => {
|
|
46
|
+
text("FluidCAD").size(14).bold();
|
|
47
|
+
});
|
|
48
|
+
extrude(4);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
See [[api/wrap]] for wrapping text onto cylinders and cones, and
|
|
52
|
+
[[api/types/text]] for the full chain-method reference.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/types/helix
|
|
3
|
+
title: Helix
|
|
4
|
+
summary: "A 3D helix wire — a single edge that traces a helix curve on a cylindrical or conical surface."
|
|
5
|
+
tags: [api, type, interface]
|
|
6
|
+
symbols: [Helix, IHelix]
|
|
7
|
+
seeAlso: [api/types/scene-object]
|
|
8
|
+
---
|
|
9
|
+
# Helix
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
interface Helix extends SceneObject {
|
|
13
|
+
pitch(pitch: number): this;
|
|
14
|
+
turns(turns: number): this;
|
|
15
|
+
startOffset(offset: number): this;
|
|
16
|
+
endOffset(offset: number): this;
|
|
17
|
+
height(height: number): this;
|
|
18
|
+
radius(radius: number): this;
|
|
19
|
+
endRadius(radius: number): this;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
A 3D helix wire — a single edge that traces a helix curve on a cylindrical or
|
|
24
|
+
conical surface. Used as a path for `sweep()` to produce springs, threads, and
|
|
25
|
+
coils.
|
|
26
|
+
|
|
27
|
+
Created from one of:
|
|
28
|
+
- An axis (`AxisLike`): user supplies geometry via chained config.
|
|
29
|
+
- A cylindrical or conical face: axis + radii + height derived from the face.
|
|
30
|
+
- A line edge: axis = the line, height = line length.
|
|
31
|
+
- A circular edge: axis = circle normal, radius = circle radius.
|
|
32
|
+
|
|
33
|
+
Extends [[api/types/scene-object]].
|
|
34
|
+
|
|
35
|
+
## Methods
|
|
36
|
+
|
|
37
|
+
### `pitch()`
|
|
38
|
+
|
|
39
|
+
Axial rise per turn (distance along the helix axis covered per full revolution).
|
|
40
|
+
If unset, derived from `height / turns`.
|
|
41
|
+
|
|
42
|
+
| Parameter | Type | Description |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| `pitch` | `number` | |
|
|
45
|
+
|
|
46
|
+
### `turns()`
|
|
47
|
+
|
|
48
|
+
Number of full turns. Fractional values are allowed. Default 1.
|
|
49
|
+
|
|
50
|
+
| Parameter | Type | Description |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `turns` | `number` | |
|
|
53
|
+
|
|
54
|
+
### `startOffset()`
|
|
55
|
+
|
|
56
|
+
Shifts the start of the helix along its axis, in axial mm. Positive values
|
|
57
|
+
trim the start (move it toward the end); negative values extend it. Default 0.
|
|
58
|
+
|
|
59
|
+
| Parameter | Type | Description |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `offset` | `number` | |
|
|
62
|
+
|
|
63
|
+
### `endOffset()`
|
|
64
|
+
|
|
65
|
+
Extends (positive) or trims (negative) the helix at its end, in axial mm.
|
|
66
|
+
Default 0.
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `offset` | `number` | |
|
|
71
|
+
|
|
72
|
+
### `height()`
|
|
73
|
+
|
|
74
|
+
Total axial height. Overrides face/edge-derived height when set. For line-edge
|
|
75
|
+
input, defaults to the line length. For circular-edge / pure-axis input,
|
|
76
|
+
defaults to 50 if neither this nor `pitch * turns` determine it.
|
|
77
|
+
|
|
78
|
+
| Parameter | Type | Description |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `height` | `number` | |
|
|
81
|
+
|
|
82
|
+
### `radius()`
|
|
83
|
+
|
|
84
|
+
Start radius. Defaults to 20 for axis/line-edge input. For a cylindrical
|
|
85
|
+
face input, defaults to the face's radius and may be overridden (useful for
|
|
86
|
+
sweep/fuse workflows where the helix tube must overlap the cylinder
|
|
87
|
+
volumetrically — offset by ~1mm to avoid pure tangency). Ignored on
|
|
88
|
+
conical face input (radius is derived from face geometry).
|
|
89
|
+
|
|
90
|
+
| Parameter | Type | Description |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `radius` | `number` | |
|
|
93
|
+
|
|
94
|
+
### `endRadius()`
|
|
95
|
+
|
|
96
|
+
End radius — when different from `radius()`, produces a conical helix.
|
|
97
|
+
Defaults to `radius()`. Ignored on face/circle inputs.
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `radius` | `number` | |
|
|
102
|
+
|
|
103
|
+
## Inherited
|
|
104
|
+
|
|
105
|
+
From [[api/types/scene-object]]: `name()`, `reusable()`
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/types/text
|
|
3
|
+
title: Text
|
|
4
|
+
summary: "The Text type. Extends ExtrudableGeometry; adds 11 methods."
|
|
5
|
+
tags: [api, type, interface]
|
|
6
|
+
symbols: [Text, IText]
|
|
7
|
+
seeAlso: [api/types/extrudable-geometry]
|
|
8
|
+
---
|
|
9
|
+
# Text
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
interface Text extends ExtrudableGeometry {
|
|
13
|
+
size(value: number): this;
|
|
14
|
+
font(name: string): this;
|
|
15
|
+
weight(value: string | number): this;
|
|
16
|
+
bold(): this;
|
|
17
|
+
italic(value?: boolean): this;
|
|
18
|
+
align(value: "left" | "right" | "center" | "start" | "end" | "space-between" | "space-around"): this;
|
|
19
|
+
lineSpacing(value: number): this;
|
|
20
|
+
letterSpacing(value: number): this;
|
|
21
|
+
offset(value: number): this;
|
|
22
|
+
flip(value?: boolean): this;
|
|
23
|
+
startAt(distance: number): this;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Extends [[api/types/extrudable-geometry]].
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### `size()`
|
|
32
|
+
|
|
33
|
+
Sets the text height (em size) in model units. Default 10.
|
|
34
|
+
|
|
35
|
+
| Parameter | Type | Description |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `value` | `number` | The em size. |
|
|
38
|
+
|
|
39
|
+
### `font()`
|
|
40
|
+
|
|
41
|
+
Sets the font. A name without a font extension (e.g. `"Arial"`) is resolved
|
|
42
|
+
to a system font; a value ending in `.ttf`/`.otf`/`.ttc`/`.woff` (e.g.
|
|
43
|
+
`"fonts/Brand.ttf"`) is loaded as a workspace-relative file. When omitted, a
|
|
44
|
+
default system font is used.
|
|
45
|
+
|
|
46
|
+
| Parameter | Type | Description |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `name` | `string` | A system family name or a workspace-relative font file path. |
|
|
49
|
+
|
|
50
|
+
### `weight()`
|
|
51
|
+
|
|
52
|
+
Sets the font weight: a number (100–900) or a name such as `"regular"`,
|
|
53
|
+
`"medium"`, or `"bold"`. Resolves to the matching face (or the wght axis of a
|
|
54
|
+
variable font).
|
|
55
|
+
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `value` | `string` \| `number` | The weight as a number or name. |
|
|
59
|
+
|
|
60
|
+
### `bold()`
|
|
61
|
+
|
|
62
|
+
Shortcut for `weight(700)`.
|
|
63
|
+
|
|
64
|
+
### `italic()`
|
|
65
|
+
|
|
66
|
+
Renders the italic/oblique face of the font.
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `value` | `boolean` | Whether to use italic (defaults to true). *(optional)* |
|
|
71
|
+
|
|
72
|
+
### `align()`
|
|
73
|
+
|
|
74
|
+
Horizontal alignment of the text. For straight text it is relative to the
|
|
75
|
+
origin point; for text along a path it positions the run against the
|
|
76
|
+
path: `"start"` begins at the path's start, `"center"` centers on the
|
|
77
|
+
midpoint, `"end"` finishes at the path's end, `"space-between"` justifies
|
|
78
|
+
the glyphs evenly across the whole path, and `"space-around"` spreads
|
|
79
|
+
them with half a gap before the first glyph and after the last, like the
|
|
80
|
+
CSS flexbox value (both path text only). `"left"` and `"right"` are
|
|
81
|
+
synonyms of `"start"` and `"end"`.
|
|
82
|
+
|
|
83
|
+
| Parameter | Type | Description |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `value` | `"left"` \| `"right"` \| `"center"` \| `"start"` \| `"end"` \| `"space-between"` \| `"space-around"` | `"left"`/`"start"` (default), `"center"`, `"right"`/`"end"`, `"space-between"`, or `"space-around"`. |
|
|
86
|
+
|
|
87
|
+
### `lineSpacing()`
|
|
88
|
+
|
|
89
|
+
Line-height multiplier for multi-line text (newlines in the string).
|
|
90
|
+
|
|
91
|
+
| Parameter | Type | Description |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| `value` | `number` | Multiplier on the font's natural line height (default 1). |
|
|
94
|
+
|
|
95
|
+
### `letterSpacing()`
|
|
96
|
+
|
|
97
|
+
Extra spacing added between glyphs, in model units (default 0).
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `value` | `number` | The additional advance per glyph. |
|
|
102
|
+
|
|
103
|
+
### `offset()`
|
|
104
|
+
|
|
105
|
+
Shifts the baseline perpendicular to the path, in model units: positive
|
|
106
|
+
values move the text toward its "up" side, negative below the path.
|
|
107
|
+
Only applies to text following a path (`text(string, path)`).
|
|
108
|
+
|
|
109
|
+
| Parameter | Type | Description |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| `value` | `number` | The perpendicular baseline shift. |
|
|
112
|
+
|
|
113
|
+
### `flip()`
|
|
114
|
+
|
|
115
|
+
Mirrors the text to the other side of the path, reversing the reading
|
|
116
|
+
direction. On a closed path (circle, loop) text sits on the outside by
|
|
117
|
+
default — `.flip()` moves it inside. On an open path it mirrors the text
|
|
118
|
+
below the curve. Only applies to text following a path.
|
|
119
|
+
|
|
120
|
+
| Parameter | Type | Description |
|
|
121
|
+
| --- | --- | --- |
|
|
122
|
+
| `value` | `boolean` | Whether to flip (defaults to true). *(optional)* |
|
|
123
|
+
|
|
124
|
+
### `startAt()`
|
|
125
|
+
|
|
126
|
+
Shifts where the text starts along the path, as an arc-length distance
|
|
127
|
+
from the path's start (combines with `align()`). On a closed path the
|
|
128
|
+
text wraps around. Only applies to text following a path.
|
|
129
|
+
|
|
130
|
+
| Parameter | Type | Description |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| `distance` | `number` | The arc-length shift in model units. |
|
|
133
|
+
|
|
134
|
+
## Inherited
|
|
135
|
+
|
|
136
|
+
From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
|
|
137
|
+
|
|
138
|
+
From [[api/types/scene-object]]: `name()`, `reusable()`
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/types/wrap
|
|
3
|
+
title: Wrap
|
|
4
|
+
summary: "The Wrap type. Extends BooleanOperation; adds 10 methods."
|
|
5
|
+
tags: [api, type, interface]
|
|
6
|
+
symbols: [Wrap, IWrap]
|
|
7
|
+
seeAlso: [api/types/boolean-operation]
|
|
8
|
+
---
|
|
9
|
+
# Wrap
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
interface Wrap extends BooleanOperation {
|
|
13
|
+
startFaces(...args: (number | FaceFilter)[]): SceneObject;
|
|
14
|
+
endFaces(...args: (number | FaceFilter)[]): SceneObject;
|
|
15
|
+
startEdges(...args: (number | EdgeFilter)[]): SceneObject;
|
|
16
|
+
endEdges(...args: (number | EdgeFilter)[]): SceneObject;
|
|
17
|
+
sideFaces(...args: (number | FaceFilter)[]): SceneObject;
|
|
18
|
+
sideEdges(...args: (number | EdgeFilter)[]): SceneObject;
|
|
19
|
+
internalFaces(...args: (number | FaceFilter)[]): SceneObject;
|
|
20
|
+
internalEdges(...args: (number | EdgeFilter)[]): SceneObject;
|
|
21
|
+
drill(value?: boolean): this;
|
|
22
|
+
pick(...points: Point2DLike[]): this;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Extends [[api/types/boolean-operation]].
|
|
27
|
+
|
|
28
|
+
## Methods
|
|
29
|
+
|
|
30
|
+
### `startFaces()`
|
|
31
|
+
|
|
32
|
+
Selects the faces lying on the target surface (the base of the wrap).
|
|
33
|
+
|
|
34
|
+
**Returns**: [[api/types/scene-object]].
|
|
35
|
+
|
|
36
|
+
| Parameter | Type | Description |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
|
|
39
|
+
|
|
40
|
+
### `endFaces()`
|
|
41
|
+
|
|
42
|
+
Selects the raised (or recessed) faces offset from the target surface by the wrap thickness.
|
|
43
|
+
|
|
44
|
+
**Returns**: [[api/types/scene-object]].
|
|
45
|
+
|
|
46
|
+
| Parameter | Type | Description |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
|
|
49
|
+
|
|
50
|
+
### `startEdges()`
|
|
51
|
+
|
|
52
|
+
Selects edges on the base faces of the wrap.
|
|
53
|
+
|
|
54
|
+
**Returns**: [[api/types/scene-object]].
|
|
55
|
+
|
|
56
|
+
| Parameter | Type | Description |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
|
|
59
|
+
|
|
60
|
+
### `endEdges()`
|
|
61
|
+
|
|
62
|
+
Selects edges on the offset faces of the wrap.
|
|
63
|
+
|
|
64
|
+
**Returns**: [[api/types/scene-object]].
|
|
65
|
+
|
|
66
|
+
| Parameter | Type | Description |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
|
|
69
|
+
|
|
70
|
+
### `sideFaces()`
|
|
71
|
+
|
|
72
|
+
Selects the wall faces created from the outer boundary of each wrapped region.
|
|
73
|
+
|
|
74
|
+
**Returns**: [[api/types/scene-object]].
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Description |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
|
|
79
|
+
|
|
80
|
+
### `sideEdges()`
|
|
81
|
+
|
|
82
|
+
Selects edges on the wall faces, excluding edges shared with base/offset faces.
|
|
83
|
+
|
|
84
|
+
**Returns**: [[api/types/scene-object]].
|
|
85
|
+
|
|
86
|
+
| Parameter | Type | Description |
|
|
87
|
+
| --- | --- | --- |
|
|
88
|
+
| `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
|
|
89
|
+
|
|
90
|
+
### `internalFaces()`
|
|
91
|
+
|
|
92
|
+
Selects the wall faces created from holes inside a wrapped region.
|
|
93
|
+
|
|
94
|
+
**Returns**: [[api/types/scene-object]].
|
|
95
|
+
|
|
96
|
+
| Parameter | Type | Description |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `...args` | (`number` \| `FaceFilter`)[] | Numeric indices or FaceFilterBuilder instances to filter the selection. *(optional)* |
|
|
99
|
+
|
|
100
|
+
### `internalEdges()`
|
|
101
|
+
|
|
102
|
+
Selects edges bounding the hole walls of the wrap.
|
|
103
|
+
|
|
104
|
+
**Returns**: [[api/types/scene-object]].
|
|
105
|
+
|
|
106
|
+
| Parameter | Type | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
|
|
109
|
+
|
|
110
|
+
### `drill()`
|
|
111
|
+
|
|
112
|
+
Enables or disables drill mode, which partitions the sketch into face regions
|
|
113
|
+
before wrapping.
|
|
114
|
+
|
|
115
|
+
| Parameter | Type | Description |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| `value` | `boolean` | `true` to enable (default), `false` to disable. *(optional)* |
|
|
118
|
+
|
|
119
|
+
### `pick()`
|
|
120
|
+
|
|
121
|
+
Restricts wrapping to only the sketch regions containing the given points.
|
|
122
|
+
|
|
123
|
+
| Parameter | Type | Description |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| `...points` | [[api/types/point2dlike]][] | 2D points in the sketch plane identifying regions to wrap. *(optional)* |
|
|
126
|
+
|
|
127
|
+
## Inherited
|
|
128
|
+
|
|
129
|
+
From [[api/types/boolean-operation]]: `add()`, `'new'()`, `remove()`, `scope()`
|
|
130
|
+
|
|
131
|
+
From [[api/types/scene-object]]: `name()`, `reusable()`
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: api/wrap
|
|
3
|
+
title: wrap(thickness, sketch, face)
|
|
4
|
+
summary: Develops a sketch onto a cylindrical or conical face and raises it by a thickness — embossed or engraved labels, logos, and features that follow a curved wall.
|
|
5
|
+
tags: [api, 3d, solid]
|
|
6
|
+
symbols: [wrap]
|
|
7
|
+
seeAlso: [api/sketch, api/types/text, api/select, api/extrude]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# wrap
|
|
11
|
+
|
|
12
|
+
Imported from `fluidcad/core`.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
wrap(thickness, sketch: SceneObject, face: SceneObject)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Returns `Wrap` (extends `BooleanOperation`). Bends a flat sketch onto a
|
|
19
|
+
curved face like a label onto a bottle: the sketch is developed onto the
|
|
20
|
+
surface with lengths preserved (a true wrap, not a projection), then
|
|
21
|
+
thickened by `thickness` along the surface normal. `thickness` must be
|
|
22
|
+
positive; the operation mode picks the direction:
|
|
23
|
+
|
|
24
|
+
- default / `.add()` — emboss: the pad is raised off the surface and fused.
|
|
25
|
+
- `.remove()` — engrave: the sketch is sunk `thickness` deep into the surface.
|
|
26
|
+
- `.new()` — keep the wrapped pad as a standalone solid.
|
|
27
|
+
- `.scope(...)` — limit which solids are fused/cut.
|
|
28
|
+
|
|
29
|
+
The target `face` must be **cylindrical or conical** (e.g.
|
|
30
|
+
`select(face().cylinder())`). Placement: the sketch plane's origin lands on
|
|
31
|
+
the nearest point of the surface, the surface axis direction maps to the
|
|
32
|
+
matching in-plane sketch direction, and sketch coordinates are measured from
|
|
33
|
+
there along the unrolled surface. The plane's offset from the surface is
|
|
34
|
+
ignored; the plane must not be perpendicular to the target's axis, and the
|
|
35
|
+
sketch cannot span more than one full turn.
|
|
36
|
+
|
|
37
|
+
Sketch regions keep their holes (nested profiles are subtracted), and
|
|
38
|
+
`.pick(point)` / `.drill(false)` work as in `extrude`. Face/edge accessors:
|
|
39
|
+
`startFaces` (on the target surface), `endFaces` (raised/engraved faces),
|
|
40
|
+
`sideFaces` (outer-boundary walls), `internalFaces` (hole walls), plus the
|
|
41
|
+
matching `*Edges` variants.
|
|
42
|
+
|
|
43
|
+
## Example
|
|
44
|
+
|
|
45
|
+
```fluid.js
|
|
46
|
+
import { cylinder, move, plane, select, sketch, text, wrap } from "fluidcad/core";
|
|
47
|
+
import { face } from "fluidcad/filters";
|
|
48
|
+
|
|
49
|
+
cylinder(25, 60);
|
|
50
|
+
const target = select(face().cylinder());
|
|
51
|
+
|
|
52
|
+
const decal = sketch(plane("front", 25), () => {
|
|
53
|
+
move([0, 24]);
|
|
54
|
+
text("FLUID").size(12);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
wrap(1, decal, target);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Use `wrap(1, decal, target).remove()` on the same scene to engrave the text
|
|
61
|
+
instead. See [[api/types/text]] for text options and [[api/select]] for
|
|
62
|
+
picking the target face.
|