fluidcad 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/LICENSE.txt +21 -504
  2. package/README.md +1 -1
  3. package/bin/commands/login.js +33 -5
  4. package/bin/commands/mcp.js +3 -2
  5. package/bin/commands/publish.js +103 -8
  6. package/bin/lib/api-client.js +8 -0
  7. package/bin/lib/model-config.js +27 -4
  8. package/bin/lib/prompt.js +97 -0
  9. package/lib/dist/common/edge.d.ts +1 -1
  10. package/lib/dist/common/face.d.ts +1 -1
  11. package/lib/dist/common/scene-object.d.ts +6 -0
  12. package/lib/dist/common/scene-object.js +8 -0
  13. package/lib/dist/common/shape-factory.d.ts +1 -1
  14. package/lib/dist/common/shape-history-tracker.d.ts +1 -1
  15. package/lib/dist/common/shape.d.ts +1 -1
  16. package/lib/dist/common/solid.d.ts +1 -1
  17. package/lib/dist/common/transformable-primitive.d.ts +12 -1
  18. package/lib/dist/common/transformable-primitive.js +27 -0
  19. package/lib/dist/common/vertex.d.ts +1 -1
  20. package/lib/dist/common/wire.d.ts +1 -1
  21. package/lib/dist/core/2d/index.d.ts +1 -0
  22. package/lib/dist/core/2d/index.js +1 -0
  23. package/lib/dist/core/2d/text.d.ts +30 -0
  24. package/lib/dist/core/2d/text.js +37 -0
  25. package/lib/dist/core/helix.d.ts +20 -0
  26. package/lib/dist/core/helix.js +36 -0
  27. package/lib/dist/core/index.d.ts +3 -1
  28. package/lib/dist/core/index.js +2 -0
  29. package/lib/dist/core/interfaces.d.ts +180 -0
  30. package/lib/dist/core/wrap.d.ts +17 -0
  31. package/lib/dist/core/wrap.js +39 -0
  32. package/lib/dist/features/2d/text.d.ts +67 -0
  33. package/lib/dist/features/2d/text.js +320 -0
  34. package/lib/dist/features/cylinder.d.ts +3 -1
  35. package/lib/dist/features/cylinder.js +5 -2
  36. package/lib/dist/features/extrude-base.d.ts +1 -0
  37. package/lib/dist/features/extrude-to-face.d.ts +1 -0
  38. package/lib/dist/features/extrude-to-face.js +6 -0
  39. package/lib/dist/features/fillet.d.ts +1 -1
  40. package/lib/dist/features/helix.d.ts +41 -0
  41. package/lib/dist/features/helix.js +337 -0
  42. package/lib/dist/features/select.js +32 -8
  43. package/lib/dist/features/simple-extruder.d.ts +1 -1
  44. package/lib/dist/features/simple-extruder.js +7 -2
  45. package/lib/dist/features/sphere.d.ts +3 -1
  46. package/lib/dist/features/sphere.js +5 -2
  47. package/lib/dist/features/sweep.js +7 -2
  48. package/lib/dist/features/wrap.d.ts +39 -0
  49. package/lib/dist/features/wrap.js +116 -0
  50. package/lib/dist/filters/edge/belongs-to-face.d.ts +3 -1
  51. package/lib/dist/filters/edge/belongs-to-face.js +14 -10
  52. package/lib/dist/filters/filter.d.ts +1 -1
  53. package/lib/dist/filters/from-object.d.ts +1 -1
  54. package/lib/dist/filters/tangent-expander.d.ts +1 -1
  55. package/lib/dist/filters/tangent-expander.js +57 -40
  56. package/lib/dist/helpers/scene-helpers.d.ts +2 -0
  57. package/lib/dist/helpers/scene-helpers.js +1 -1
  58. package/lib/dist/index.d.ts +2 -0
  59. package/lib/dist/index.js +3 -1
  60. package/lib/dist/io/file-import.d.ts +7 -0
  61. package/lib/dist/io/file-import.js +28 -1
  62. package/lib/dist/io/font-registry.d.ts +45 -0
  63. package/lib/dist/io/font-registry.js +272 -0
  64. package/lib/dist/math/bspline-interpolation.d.ts +29 -0
  65. package/lib/dist/math/bspline-interpolation.js +194 -0
  66. package/lib/dist/oc/boolean-ops.d.ts +3 -1
  67. package/lib/dist/oc/boolean-ops.js +15 -1
  68. package/lib/dist/oc/color-transfer.d.ts +1 -1
  69. package/lib/dist/oc/constraints/constraint-helpers.d.ts +4 -4
  70. package/lib/dist/oc/constraints/curve/tangent-circle-solver.js +10 -9
  71. package/lib/dist/oc/constraints/curve/tangent-line-solver.js +5 -6
  72. package/lib/dist/oc/convert.d.ts +1 -1
  73. package/lib/dist/oc/draft-ops.d.ts +1 -1
  74. package/lib/dist/oc/edge-ops.d.ts +2 -2
  75. package/lib/dist/oc/edge-ops.js +13 -14
  76. package/lib/dist/oc/edge-props.d.ts +1 -1
  77. package/lib/dist/oc/edge-query.d.ts +1 -1
  78. package/lib/dist/oc/edge-query.js +3 -8
  79. package/lib/dist/oc/errors.d.ts +8 -0
  80. package/lib/dist/oc/errors.js +27 -0
  81. package/lib/dist/oc/explorer.d.ts +2 -2
  82. package/lib/dist/oc/extrude-ops.d.ts +28 -2
  83. package/lib/dist/oc/extrude-ops.js +56 -7
  84. package/lib/dist/oc/face-ops.d.ts +2 -1
  85. package/lib/dist/oc/face-ops.js +11 -0
  86. package/lib/dist/oc/face-props.d.ts +1 -1
  87. package/lib/dist/oc/face-query.d.ts +12 -1
  88. package/lib/dist/oc/face-query.js +39 -0
  89. package/lib/dist/oc/fillet-ops.d.ts +1 -1
  90. package/lib/dist/oc/fillet-ops.js +4 -4
  91. package/lib/dist/oc/geometry.d.ts +1 -1
  92. package/lib/dist/oc/geometry.js +12 -14
  93. package/lib/dist/oc/helix-ops.d.ts +37 -0
  94. package/lib/dist/oc/helix-ops.js +88 -0
  95. package/lib/dist/oc/hit-test.d.ts +1 -1
  96. package/lib/dist/oc/index.d.ts +4 -0
  97. package/lib/dist/oc/index.js +2 -0
  98. package/lib/dist/oc/init.d.ts +1 -1
  99. package/lib/dist/oc/init.js +1 -1
  100. package/lib/dist/oc/intersection.js +1 -1
  101. package/lib/dist/oc/io.d.ts +6 -6
  102. package/lib/dist/oc/io.js +31 -24
  103. package/lib/dist/oc/measure/classify.d.ts +34 -0
  104. package/lib/dist/oc/measure/classify.js +246 -0
  105. package/lib/dist/oc/measure/measure-ops.d.ts +9 -0
  106. package/lib/dist/oc/measure/measure-ops.js +210 -0
  107. package/lib/dist/oc/measure/measure-types.d.ts +39 -0
  108. package/lib/dist/oc/measure/measure-types.js +1 -0
  109. package/lib/dist/oc/measure/sampling.d.ts +9 -0
  110. package/lib/dist/oc/measure/sampling.js +77 -0
  111. package/lib/dist/oc/measure/vec.d.ts +13 -0
  112. package/lib/dist/oc/measure/vec.js +23 -0
  113. package/lib/dist/oc/mesh.d.ts +1 -1
  114. package/lib/dist/oc/mesh.js +40 -28
  115. package/lib/dist/oc/path-sampler.d.ts +29 -0
  116. package/lib/dist/oc/path-sampler.js +63 -0
  117. package/lib/dist/oc/props.d.ts +1 -1
  118. package/lib/dist/oc/props.js +4 -1
  119. package/lib/dist/oc/shape-hash.d.ts +26 -0
  120. package/lib/dist/oc/shape-hash.js +32 -0
  121. package/lib/dist/oc/shape-ops.d.ts +5 -3
  122. package/lib/dist/oc/shape-ops.js +6 -5
  123. package/lib/dist/oc/sweep-ops.d.ts +22 -1
  124. package/lib/dist/oc/sweep-ops.js +206 -18
  125. package/lib/dist/oc/text-outline.d.ts +62 -0
  126. package/lib/dist/oc/text-outline.js +212 -0
  127. package/lib/dist/oc/topology-index.d.ts +1 -1
  128. package/lib/dist/oc/vertex-ops.d.ts +1 -1
  129. package/lib/dist/oc/wire-ops.d.ts +1 -1
  130. package/lib/dist/oc/wire-ops.js +1 -1
  131. package/lib/dist/oc/wrap-development.d.ts +105 -0
  132. package/lib/dist/oc/wrap-development.js +179 -0
  133. package/lib/dist/oc/wrap-ops.d.ts +100 -0
  134. package/lib/dist/oc/wrap-ops.js +406 -0
  135. package/lib/dist/rendering/render-solid.js +10 -2
  136. package/lib/dist/scene-manager.d.ts +2 -0
  137. package/lib/dist/scene-manager.js +29 -0
  138. package/lib/dist/tests/features/cylinder-curve-filter.test.js +3 -3
  139. package/lib/dist/tests/features/extrude-to-face.test.js +38 -1
  140. package/lib/dist/tests/features/helix.test.d.ts +1 -0
  141. package/lib/dist/tests/features/helix.test.js +295 -0
  142. package/lib/dist/tests/features/repeat-primitive.test.d.ts +1 -0
  143. package/lib/dist/tests/features/repeat-primitive.test.js +60 -0
  144. package/lib/dist/tests/features/rib.test.js +6 -1
  145. package/lib/dist/tests/features/sweep.test.js +125 -1
  146. package/lib/dist/tests/features/text.test.d.ts +1 -0
  147. package/lib/dist/tests/features/text.test.js +347 -0
  148. package/lib/dist/tests/features/wrap-development.test.d.ts +1 -0
  149. package/lib/dist/tests/features/wrap-development.test.js +130 -0
  150. package/lib/dist/tests/features/wrap-extruded-target.test.d.ts +1 -0
  151. package/lib/dist/tests/features/wrap-extruded-target.test.js +106 -0
  152. package/lib/dist/tests/features/wrap-repeat.test.d.ts +1 -0
  153. package/lib/dist/tests/features/wrap-repeat.test.js +93 -0
  154. package/lib/dist/tests/features/wrap.test.d.ts +1 -0
  155. package/lib/dist/tests/features/wrap.test.js +331 -0
  156. package/lib/dist/tests/math/bspline-interpolation.test.d.ts +1 -0
  157. package/lib/dist/tests/math/bspline-interpolation.test.js +119 -0
  158. package/lib/dist/tests/measure.test.d.ts +1 -0
  159. package/lib/dist/tests/measure.test.js +288 -0
  160. package/lib/dist/tsconfig.tsbuildinfo +1 -1
  161. package/llm-docs/api/helix.md +64 -0
  162. package/llm-docs/api/index.json +11 -2
  163. package/llm-docs/api/text.md +52 -0
  164. package/llm-docs/api/types/helix.md +105 -0
  165. package/llm-docs/api/types/text.md +138 -0
  166. package/llm-docs/api/types/wrap.md +131 -0
  167. package/llm-docs/api/wrap.md +62 -0
  168. package/llm-docs/index.json +121 -1
  169. package/mcp/dist/server.js +20 -1
  170. package/mcp/dist/tools/inspection.d.ts +17 -0
  171. package/mcp/dist/tools/inspection.js +14 -0
  172. package/package.json +7 -3
  173. package/server/dist/fluidcad-server.d.ts +29 -0
  174. package/server/dist/fluidcad-server.js +40 -0
  175. package/server/dist/index.js +4 -2
  176. package/server/dist/model-package/pack.js +7 -6
  177. package/server/dist/model-package/types.d.ts +4 -3
  178. package/server/dist/preferences.d.ts +4 -0
  179. package/server/dist/preferences.js +2 -0
  180. package/server/dist/routes/measure.d.ts +3 -0
  181. package/server/dist/routes/measure.js +32 -0
  182. package/server/dist/routes/preferences.js +6 -0
  183. package/server/dist/routes/sketch-edits.js +2 -1
  184. package/ui/dist/assets/{index-CDJmUpFI.css → index-dAFdg2Un.css} +1 -1
  185. package/ui/dist/assets/{index-MRqwG9Vh.js → index-no7mtr5s.js} +149 -102
  186. 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-05-29T18:50:46.977Z",
3
+ "generatedAt": "2026-06-12T18:19:00.445Z",
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.