fluidcad 0.0.32 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/README.md +3 -2
  2. package/bin/commands/init.js +55 -0
  3. package/bin/commands/mcp.js +33 -0
  4. package/bin/commands/serve.js +77 -0
  5. package/bin/fluidcad.js +15 -107
  6. package/lib/dist/common/scene-object.d.ts +4 -1
  7. package/lib/dist/common/scene-object.js +9 -2
  8. package/lib/dist/common/solid.d.ts +4 -1
  9. package/lib/dist/common/solid.js +13 -0
  10. package/lib/dist/core/2d/tarc.d.ts +20 -2
  11. package/lib/dist/core/2d/tarc.js +24 -0
  12. package/lib/dist/core/index.d.ts +2 -1
  13. package/lib/dist/core/index.js +1 -0
  14. package/lib/dist/core/interfaces.d.ts +107 -2
  15. package/lib/dist/core/load.d.ts +2 -2
  16. package/lib/dist/core/repeat.js +62 -46
  17. package/lib/dist/core/rib.d.ts +18 -0
  18. package/lib/dist/core/rib.js +37 -0
  19. package/lib/dist/features/2d/arc.d.ts +8 -2
  20. package/lib/dist/features/2d/arc.js +94 -17
  21. package/lib/dist/features/2d/back.js +3 -2
  22. package/lib/dist/features/2d/sketch.d.ts +4 -0
  23. package/lib/dist/features/2d/sketch.js +21 -0
  24. package/lib/dist/features/2d/tarc-constrained.d.ts +2 -0
  25. package/lib/dist/features/2d/tarc-constrained.js +8 -0
  26. package/lib/dist/features/2d/tarc-radius-to-object.d.ts +16 -0
  27. package/lib/dist/features/2d/tarc-radius-to-object.js +58 -0
  28. package/lib/dist/features/2d/tarc-to-object.d.ts +18 -0
  29. package/lib/dist/features/2d/tarc-to-object.js +66 -0
  30. package/lib/dist/features/2d/tarc-to-point-tangent.d.ts +2 -0
  31. package/lib/dist/features/2d/tarc-to-point-tangent.js +3 -0
  32. package/lib/dist/features/2d/tarc-to-point.d.ts +2 -0
  33. package/lib/dist/features/2d/tarc-to-point.js +3 -0
  34. package/lib/dist/features/2d/tarc-with-tangent.d.ts +2 -0
  35. package/lib/dist/features/2d/tarc-with-tangent.js +3 -0
  36. package/lib/dist/features/2d/tarc.d.ts +2 -0
  37. package/lib/dist/features/2d/tarc.js +3 -0
  38. package/lib/dist/features/extrude-base.d.ts +9 -0
  39. package/lib/dist/features/extrude-base.js +22 -0
  40. package/lib/dist/features/extrude-to-face.js +1 -5
  41. package/lib/dist/features/extrude-two-distances.js +1 -2
  42. package/lib/dist/features/extrude.js +1 -2
  43. package/lib/dist/features/load.d.ts +6 -0
  44. package/lib/dist/features/load.js +53 -1
  45. package/lib/dist/features/mirror-feature.d.ts +3 -2
  46. package/lib/dist/features/mirror-feature.js +1 -1
  47. package/lib/dist/features/repeat-circular.d.ts +3 -3
  48. package/lib/dist/features/repeat-circular.js +8 -1
  49. package/lib/dist/features/repeat-linear.d.ts +4 -2
  50. package/lib/dist/features/repeat-linear.js +10 -1
  51. package/lib/dist/features/repeat-matrix.d.ts +3 -1
  52. package/lib/dist/features/repeat-matrix.js +7 -2
  53. package/lib/dist/features/rib.d.ts +31 -0
  54. package/lib/dist/features/rib.js +321 -0
  55. package/lib/dist/features/select.d.ts +1 -0
  56. package/lib/dist/features/select.js +81 -10
  57. package/lib/dist/features/shell.d.ts +4 -1
  58. package/lib/dist/features/shell.js +14 -3
  59. package/lib/dist/filters/edge/belongs-to-face.d.ts +12 -9
  60. package/lib/dist/filters/edge/belongs-to-face.js +64 -15
  61. package/lib/dist/filters/filter-builder-base.d.ts +25 -0
  62. package/lib/dist/filters/filter-builder-base.js +47 -0
  63. package/lib/dist/filters/filter.js +39 -14
  64. package/lib/dist/filters/from-object.d.ts +4 -0
  65. package/lib/dist/filters/from-object.js +10 -0
  66. package/lib/dist/helpers/clone-transform.d.ts +2 -1
  67. package/lib/dist/helpers/scene-helpers.d.ts +1 -1
  68. package/lib/dist/helpers/scene-helpers.js +146 -12
  69. package/lib/dist/index.d.ts +7 -1
  70. package/lib/dist/index.js +3 -3
  71. package/lib/dist/io/file-import.d.ts +5 -1
  72. package/lib/dist/io/file-import.js +29 -18
  73. package/lib/dist/math/lazy-matrix.d.ts +31 -0
  74. package/lib/dist/math/lazy-matrix.js +66 -0
  75. package/lib/dist/oc/color-transfer.d.ts +19 -8
  76. package/lib/dist/oc/color-transfer.js +70 -12
  77. package/lib/dist/oc/constraints/constraint-solver-adaptor.d.ts +5 -0
  78. package/lib/dist/oc/constraints/constraint-solver-adaptor.js +16 -0
  79. package/lib/dist/oc/constraints/constraint-solver.d.ts +4 -0
  80. package/lib/dist/oc/constraints/curve/curve-constraint-solver.d.ts +4 -0
  81. package/lib/dist/oc/constraints/curve/curve-constraint-solver.js +3 -0
  82. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.d.ts +6 -1
  83. package/lib/dist/oc/constraints/geometric/geometric-constraint-solver.js +4 -0
  84. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.d.ts +8 -0
  85. package/lib/dist/oc/constraints/geometric/tangent-arc-from-point-tangent.js +111 -0
  86. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.d.ts +8 -0
  87. package/lib/dist/oc/constraints/geometric/tangent-arc-radius-to-object.js +161 -0
  88. package/lib/dist/oc/extrude-ops.d.ts +2 -1
  89. package/lib/dist/oc/extrude-ops.js +51 -2
  90. package/lib/dist/oc/mesh.d.ts +9 -4
  91. package/lib/dist/oc/mesh.js +14 -13
  92. package/lib/dist/oc/rib-ops.d.ts +35 -0
  93. package/lib/dist/oc/rib-ops.js +619 -0
  94. package/lib/dist/oc/shell-ops.d.ts +2 -1
  95. package/lib/dist/oc/shell-ops.js +5 -2
  96. package/lib/dist/oc/topology-index.d.ts +6 -0
  97. package/lib/dist/oc/topology-index.js +36 -0
  98. package/lib/dist/rendering/mesh-builder.d.ts +3 -0
  99. package/lib/dist/rendering/mesh-builder.js +8 -4
  100. package/lib/dist/rendering/render-edge.d.ts +2 -1
  101. package/lib/dist/rendering/render-edge.js +2 -2
  102. package/lib/dist/rendering/render-face.d.ts +2 -1
  103. package/lib/dist/rendering/render-face.js +2 -2
  104. package/lib/dist/rendering/render-solid.d.ts +2 -1
  105. package/lib/dist/rendering/render-solid.js +3 -5
  106. package/lib/dist/rendering/render-wire.d.ts +2 -1
  107. package/lib/dist/rendering/render-wire.js +2 -2
  108. package/lib/dist/rendering/render.d.ts +4 -0
  109. package/lib/dist/rendering/render.js +50 -2
  110. package/lib/dist/rendering/scene-compare.js +3 -0
  111. package/lib/dist/rendering/scene.d.ts +1 -0
  112. package/lib/dist/rendering/scene.js +4 -0
  113. package/lib/dist/scene-manager.d.ts +4 -2
  114. package/lib/dist/scene-manager.js +12 -4
  115. package/lib/dist/tests/features/2d/arc.test.js +64 -0
  116. package/lib/dist/tests/features/2d/back.test.js +17 -1
  117. package/lib/dist/tests/features/2d/tarc.test.js +157 -0
  118. package/lib/dist/tests/features/color-lineage.test.js +18 -0
  119. package/lib/dist/tests/features/filter-positional.test.d.ts +1 -0
  120. package/lib/dist/tests/features/filter-positional.test.js +129 -0
  121. package/lib/dist/tests/features/repeat-user-repro.test.d.ts +1 -0
  122. package/lib/dist/tests/features/repeat-user-repro.test.js +60 -0
  123. package/lib/dist/tests/features/rib.test.d.ts +1 -0
  124. package/lib/dist/tests/features/rib.test.js +598 -0
  125. package/lib/dist/tests/features/shell.test.js +36 -0
  126. package/lib/dist/tests/global-setup.js +2 -1
  127. package/lib/dist/tests/helpers/extract-blocks.d.ts +9 -0
  128. package/lib/dist/tests/helpers/extract-blocks.js +56 -0
  129. package/lib/dist/tests/llm-docs-examples.test.d.ts +1 -0
  130. package/lib/dist/tests/llm-docs-examples.test.js +62 -0
  131. package/lib/dist/tests/scene-compare.test.d.ts +1 -0
  132. package/lib/dist/tests/scene-compare.test.js +77 -0
  133. package/lib/dist/tests/setup.js +2 -1
  134. package/lib/dist/tsconfig.tsbuildinfo +1 -1
  135. package/llm-docs/.coverage-allowlist.txt +9 -0
  136. package/llm-docs/api/arc.md +48 -0
  137. package/llm-docs/api/axis.md +42 -0
  138. package/llm-docs/api/bezier.md +42 -0
  139. package/llm-docs/api/booleans.md +44 -0
  140. package/llm-docs/api/chamfer.md +40 -0
  141. package/llm-docs/api/circle.md +36 -0
  142. package/llm-docs/api/color.md +34 -0
  143. package/llm-docs/api/connect.md +41 -0
  144. package/llm-docs/api/constraint-qualifiers.md +48 -0
  145. package/llm-docs/api/copy.md +63 -0
  146. package/llm-docs/api/cursor-lines.md +50 -0
  147. package/llm-docs/api/cursor-move.md +61 -0
  148. package/llm-docs/api/cut.md +55 -0
  149. package/llm-docs/api/draft.md +36 -0
  150. package/llm-docs/api/edge-filter.md +57 -0
  151. package/llm-docs/api/ellipse.md +34 -0
  152. package/llm-docs/api/extrude.md +74 -0
  153. package/llm-docs/api/face-filter.md +61 -0
  154. package/llm-docs/api/fillet.md +51 -0
  155. package/llm-docs/api/index.json +139 -0
  156. package/llm-docs/api/line.md +42 -0
  157. package/llm-docs/api/load.md +37 -0
  158. package/llm-docs/api/local.md +38 -0
  159. package/llm-docs/api/loft.md +37 -0
  160. package/llm-docs/api/mirror.md +44 -0
  161. package/llm-docs/api/offset.md +36 -0
  162. package/llm-docs/api/part.md +40 -0
  163. package/llm-docs/api/plane.md +44 -0
  164. package/llm-docs/api/polygon.md +37 -0
  165. package/llm-docs/api/primitive-solids.md +39 -0
  166. package/llm-docs/api/project-intersect.md +48 -0
  167. package/llm-docs/api/rect.md +48 -0
  168. package/llm-docs/api/remove.md +32 -0
  169. package/llm-docs/api/repeat.md +79 -0
  170. package/llm-docs/api/revolve.md +38 -0
  171. package/llm-docs/api/rib.md +40 -0
  172. package/llm-docs/api/rotate.md +37 -0
  173. package/llm-docs/api/select.md +41 -0
  174. package/llm-docs/api/shell.md +41 -0
  175. package/llm-docs/api/sketch.md +76 -0
  176. package/llm-docs/api/slot.md +36 -0
  177. package/llm-docs/api/split-trim.md +42 -0
  178. package/llm-docs/api/sweep.md +43 -0
  179. package/llm-docs/api/tarc.md +45 -0
  180. package/llm-docs/api/tcircle.md +38 -0
  181. package/llm-docs/api/tline.md +42 -0
  182. package/llm-docs/api/translate.md +40 -0
  183. package/llm-docs/api/types/aline.md +35 -0
  184. package/llm-docs/api/types/arc-angles.md +29 -0
  185. package/llm-docs/api/types/arc-points.md +48 -0
  186. package/llm-docs/api/types/axis-like.md +38 -0
  187. package/llm-docs/api/types/axis.md +21 -0
  188. package/llm-docs/api/types/boolean-operation.md +50 -0
  189. package/llm-docs/api/types/circular-repeat-options.md +31 -0
  190. package/llm-docs/api/types/common.md +32 -0
  191. package/llm-docs/api/types/cut.md +125 -0
  192. package/llm-docs/api/types/draft.md +21 -0
  193. package/llm-docs/api/types/extrudable-geometry.md +23 -0
  194. package/llm-docs/api/types/extrude.md +194 -0
  195. package/llm-docs/api/types/geometry.md +51 -0
  196. package/llm-docs/api/types/hline.md +35 -0
  197. package/llm-docs/api/types/linear-repeat-options.md +31 -0
  198. package/llm-docs/api/types/loft.md +154 -0
  199. package/llm-docs/api/types/mirror.md +35 -0
  200. package/llm-docs/api/types/offset.md +31 -0
  201. package/llm-docs/api/types/plane-like.md +35 -0
  202. package/llm-docs/api/types/plane-transform-options.md +29 -0
  203. package/llm-docs/api/types/plane.md +21 -0
  204. package/llm-docs/api/types/point-like.md +22 -0
  205. package/llm-docs/api/types/point2dlike.md +26 -0
  206. package/llm-docs/api/types/polygon.md +46 -0
  207. package/llm-docs/api/types/rect.md +128 -0
  208. package/llm-docs/api/types/revolve.md +102 -0
  209. package/llm-docs/api/types/rib.md +133 -0
  210. package/llm-docs/api/types/scene-object.md +33 -0
  211. package/llm-docs/api/types/select.md +21 -0
  212. package/llm-docs/api/types/shell.md +54 -0
  213. package/llm-docs/api/types/slot.md +43 -0
  214. package/llm-docs/api/types/sweep.md +189 -0
  215. package/llm-docs/api/types/tangent-arc-two-objects.md +46 -0
  216. package/llm-docs/api/types/transformable.md +93 -0
  217. package/llm-docs/api/types/trim.md +27 -0
  218. package/llm-docs/api/types/two-objects-tangent-line.md +46 -0
  219. package/llm-docs/api/types/vertex.md +17 -0
  220. package/llm-docs/api/types/vline.md +35 -0
  221. package/llm-docs/concepts/coordinate-system.md +45 -0
  222. package/llm-docs/concepts/history-and-rollback.md +40 -0
  223. package/llm-docs/concepts/last-selection.md +49 -0
  224. package/llm-docs/concepts/scene-graph.md +37 -0
  225. package/llm-docs/index.json +1750 -0
  226. package/mcp/dist/client.d.ts +64 -0
  227. package/mcp/dist/client.js +248 -0
  228. package/mcp/dist/discovery.d.ts +11 -0
  229. package/mcp/dist/discovery.js +78 -0
  230. package/mcp/dist/docs-index.d.ts +81 -0
  231. package/mcp/dist/docs-index.js +261 -0
  232. package/mcp/dist/resources.d.ts +4 -0
  233. package/mcp/dist/resources.js +115 -0
  234. package/mcp/dist/server.d.ts +12 -0
  235. package/mcp/dist/server.js +489 -0
  236. package/mcp/dist/tools/coordination.d.ts +9 -0
  237. package/mcp/dist/tools/coordination.js +46 -0
  238. package/mcp/dist/tools/docs.d.ts +66 -0
  239. package/mcp/dist/tools/docs.js +122 -0
  240. package/mcp/dist/tools/engine.d.ts +56 -0
  241. package/mcp/dist/tools/engine.js +145 -0
  242. package/mcp/dist/tools/inspection.d.ts +75 -0
  243. package/mcp/dist/tools/inspection.js +121 -0
  244. package/mcp/dist/tools/screenshot.d.ts +63 -0
  245. package/mcp/dist/tools/screenshot.js +263 -0
  246. package/mcp/dist/tools/source.d.ts +84 -0
  247. package/mcp/dist/tools/source.js +434 -0
  248. package/mcp/dist/tools/workspaces.d.ts +13 -0
  249. package/mcp/dist/tools/workspaces.js +33 -0
  250. package/mcp/dist/types.d.ts +18 -0
  251. package/mcp/dist/types.js +11 -0
  252. package/package.json +19 -5
  253. package/server/dist/code-editor.d.ts +36 -0
  254. package/server/dist/code-editor.js +8 -0
  255. package/server/dist/fluidcad-server.d.ts +50 -0
  256. package/server/dist/fluidcad-server.js +153 -1
  257. package/server/dist/global-registry.d.ts +30 -0
  258. package/server/dist/global-registry.js +126 -0
  259. package/server/dist/index.js +171 -26
  260. package/server/dist/instance-file.d.ts +31 -0
  261. package/server/dist/instance-file.js +73 -0
  262. package/server/dist/lint-fluid-js.d.ts +15 -0
  263. package/server/dist/lint-fluid-js.js +271 -0
  264. package/server/dist/routes/editor.d.ts +24 -0
  265. package/server/dist/routes/editor.js +44 -0
  266. package/server/dist/routes/export.d.ts +1 -1
  267. package/server/dist/routes/export.js +45 -8
  268. package/server/dist/routes/health.d.ts +7 -0
  269. package/server/dist/routes/health.js +14 -0
  270. package/server/dist/routes/lint.d.ts +10 -0
  271. package/server/dist/routes/lint.js +28 -0
  272. package/server/dist/routes/render.d.ts +33 -0
  273. package/server/dist/routes/render.js +34 -0
  274. package/server/dist/routes/scene.d.ts +5 -0
  275. package/server/dist/routes/scene.js +48 -0
  276. package/server/dist/routes/screenshot.js +68 -1
  277. package/server/dist/ws-protocol.d.ts +56 -2
  278. package/ui/dist/assets/{index-DMw0OYCF.js → index-BdqrMDRu.js} +30 -30
  279. package/ui/dist/index.html +1 -1
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: api/split-trim
3
+ title: split / trim
4
+ summary: Sketch-level cleanup. `split` breaks intersecting geometries at their crossings; `trim` discards the unwanted segments.
5
+ tags: [api, 2d, modifier]
6
+ symbols: [split, trim]
7
+ seeAlso: [api/sketch, api/edge-filter]
8
+ ---
9
+
10
+ # split / trim
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ split() // split all intersecting geometries
16
+ split(...objects)
17
+
18
+ trim() // trim all segments at crossings
19
+ trim(...filters: EdgeFilter[]) // trim segments matching the filters
20
+ ```
21
+
22
+ Both run inside a sketch context. `split` keeps every piece around so
23
+ you can reference them individually; `trim` keeps only the segments you
24
+ want, discarding the others. Pair `trim(...)` with an
25
+ [[api/edge-filter]] to target specific segments by length, orientation,
26
+ or parent.
27
+
28
+ ## Example
29
+
30
+ ```fluid.js
31
+ import { circle, extrude, hLine, sketch, trim } from "fluidcad/core";
32
+ import { edge } from "fluidcad/filters";
33
+
34
+ sketch("xy", () => {
35
+ circle(50);
36
+ hLine([50, 0], 100); // cuts the circle in half
37
+ trim(edge().line()); // drop the line, keep the circle halves
38
+ });
39
+ extrude(2);
40
+ ```
41
+
42
+ See [[api/edge-filter]] for the filter language `trim` uses.
@@ -0,0 +1,43 @@
1
+ ---
2
+ id: api/sweep
3
+ title: sweep(path)
4
+ summary: Sweeps the active sketch (profile) along a path sketch. The profile is consumed implicitly; the path is passed explicitly.
5
+ tags: [api, 3d, solid]
6
+ symbols: [sweep]
7
+ seeAlso: [api/sketch, api/extrude, api/loft, api/revolve]
8
+ ---
9
+
10
+ # sweep
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ sweep(path: SceneObject) // sweep last sketch along path
16
+ sweep(path: SceneObject, target?: SceneObject)
17
+ ```
18
+
19
+ Returns `Sweep` (extends `BooleanOperation`). Chain: `.draft()`,
20
+ `.endOffset()`, `.drill()`, `.pick()`, `.thin()`, plus boolean scope
21
+ methods. Direct accessors mirror `extrude`: `startFaces`, `endFaces`,
22
+ `sideFaces`, etc.
23
+
24
+ The path is typically a reusable sketch (open or closed wire) or an
25
+ edge selection. The profile is whatever sketch was last opened — usually
26
+ on a plane perpendicular to the path's start tangent.
27
+
28
+ ## Example
29
+
30
+ ```fluid.js
31
+ import { arc, circle, line, sketch, sweep } from "fluidcad/core";
32
+
33
+ const path = sketch("xy", () => {
34
+ line([0, 0], [100, 0]);
35
+ arc([200, 100]).radius(150);
36
+ }).reusable();
37
+
38
+ sketch("yz", () => circle(8));
39
+ sweep(path);
40
+ ```
41
+
42
+ See [[api/loft]] for blending between distinct profiles and
43
+ [[api/revolve]] for axis-driven sweeps.
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: api/tarc
3
+ title: tArc — tangent arc
4
+ summary: The most flexible constrained primitive. Tangent-continues from the previous geometry; can target a point, a curve, or thread between two curves.
5
+ tags: [api, 2d, constrained, curve]
6
+ symbols: [tArc]
7
+ seeAlso: [api/tline, api/tcircle, api/arc]
8
+ ---
9
+
10
+ # tArc
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ tArc(target: SceneObject | QualifiedGeometry) // ends tangent to target curve
16
+ tArc(radius, target) // arc of given radius to target
17
+ tArc(radius?, endAngle?) // defaults: radius 100, sweep 90°
18
+ tArc(radius, angle, tangent: Point2D) // explicit start tangent
19
+ tArc(endPoint: Point2D) // tangent arc to a point
20
+ tArc(endPoint, tangent) // with end tangent
21
+ tArc(startPoint, endPoint, tangent)
22
+ tArc(c1: SceneObject, c2: SceneObject, radius, mustTouch?)
23
+ tArc(c1: Point2D, c2: Point2D, radius, mustTouch?)
24
+ ```
25
+
26
+ Defaults: radius `100`, end angle `90°`. Negative radius flips sweep
27
+ direction. Chain `.flip()` to curve to the right of the start tangent
28
+ instead of the left.
29
+
30
+ ## Example
31
+
32
+ ```fluid.js
33
+ import { connect, extrude, hLine, sketch, tArc } from "fluidcad/core";
34
+
35
+ sketch("xy", () => {
36
+ hLine(40);
37
+ tArc(20, 180); // half-circle of radius 20, tangent to the hLine
38
+ hLine(-40);
39
+ connect();
40
+ });
41
+ extrude(3);
42
+ ```
43
+
44
+ See [[api/tline]] for tangent lines and [[api/arc]] for unconstrained
45
+ arcs.
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: api/tcircle
3
+ title: tCircle — tangent circle
4
+ summary: Full circle of given diameter tangent to two objects (or threading two points). Use qualifiers to disambiguate among the up-to-8 valid solutions.
5
+ tags: [api, 2d, constrained, curve]
6
+ symbols: [tCircle]
7
+ seeAlso: [api/tline, api/tarc, api/circle]
8
+ ---
9
+
10
+ # tCircle
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ tCircle(c1, c2, diameter, mustTouch?)
16
+ tCircle(c1: QualifiedGeometry, c2: QualifiedGeometry, diameter, mustTouch?)
17
+ tCircle(c1: Point2D, c2: Point2D, diameter, mustTouch?)
18
+ ```
19
+
20
+ Returns a full circle (`ExtrudableGeometry`) of the given diameter
21
+ tangent to both targets. Up to 8 solutions exist for two circles —
22
+ narrow with `outside` / `enclosing` / `enclosed` qualifiers and/or
23
+ `mustTouch: true`.
24
+
25
+ ## Example
26
+
27
+ ```fluid.js
28
+ import { outside } from "fluidcad/constraints";
29
+
30
+ sketch("xy", () => {
31
+ const c1 = circle([0, 0], 40).reusable();
32
+ const c2 = circle([100, 0], 40).reusable();
33
+ tCircle(outside(c1), outside(c2), 20);
34
+ });
35
+ extrude(2);
36
+ ```
37
+
38
+ See [[api/tline]] and [[api/tarc]] for tangent lines and arcs.
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: api/tline
3
+ title: tLine — tangent line
4
+ summary: Constrained tangent line — between two curves, from the cursor to one curve, or continuing the previous geometry's tangent.
5
+ tags: [api, 2d, constrained, curve]
6
+ symbols: [tLine]
7
+ seeAlso: [api/tarc, api/tcircle, api/cursor-lines]
8
+ ---
9
+
10
+ # tLine
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ tLine(distance) // continue tangent to previous geometry
16
+ tLine(c1: SceneObject, c2: SceneObject, mustTouch?) // between two objects
17
+ tLine(c1: QualifiedGeometry, c2: QualifiedGeometry, mustTouch?)
18
+ tLine(c1, mustTouch?) // tangent to one object from cursor
19
+ ```
20
+
21
+ Returns `Geometry` (one-arg form) or `TwoObjectsTangentLine` with
22
+ `.start()`, `.end()`, and `.tangent()` vertices.
23
+
24
+ Multiple tangent lines exist between two curves — disambiguate with
25
+ `outside()`, `enclosing()`, or `enclosed()` qualifiers (see Phase 11
26
+ slice 4 once they land).
27
+
28
+ ## Example
29
+
30
+ ```fluid.js
31
+ import { circle, extrude, sketch, tLine } from "fluidcad/core";
32
+
33
+ sketch("xy", () => {
34
+ const c1 = circle([0, 0], 30).reusable();
35
+ const c2 = circle([100, 0], 20).reusable();
36
+ tLine(c1, c2);
37
+ });
38
+ extrude(2);
39
+ ```
40
+
41
+ See [[api/tarc]] for tangent arcs and [[api/tcircle]] for tangent
42
+ circles.
@@ -0,0 +1,40 @@
1
+ ---
2
+ id: api/translate
3
+ title: translate(x, y?, z?, ...targets?)
4
+ summary: "Moves one or more objects by a vector. With no targets, operates on the last object. Pass `copy: true` to clone instead of moving."
5
+ tags: [api, 3d, transform]
6
+ symbols: [translate]
7
+ seeAlso: [api/rotate, api/mirror, api/copy]
8
+ ---
9
+
10
+ # translate
11
+
12
+ Imported from `fluidcad/core`.
13
+
14
+ ```ts
15
+ translate(x, ...targets)
16
+ translate(x, y, ...targets)
17
+ translate(x, y, z, ...targets)
18
+ translate(point: PointLike, ...targets)
19
+ translate(x, y, z, copy: boolean, ...targets) // copy flag at any arity
20
+ ```
21
+
22
+ Returns the translated `SceneObject`. With no explicit target it operates
23
+ on the last object — the same implicit-context model as the rest of the
24
+ API.
25
+
26
+ The `copy: true` overload duplicates the source rather than moving it,
27
+ producing a new independent object. Use it for one-off duplicates; for
28
+ patterns use [[api/copy]] or [[api/repeat]].
29
+
30
+ ## Example
31
+
32
+ ```fluid.js
33
+ import { sphere, translate } from "fluidcad/core";
34
+
35
+ const s = sphere(15);
36
+ translate(0, 0, 60, s); // lift the sphere by 60
37
+ ```
38
+
39
+ See [[api/rotate]] for rotations and [[api/copy]] for snapshot
40
+ duplication patterns.
@@ -0,0 +1,35 @@
1
+ ---
2
+ id: api/types/aline
3
+ title: ALine
4
+ summary: "The ALine type. Extends Geometry; adds 1 method."
5
+ tags: [api, type, interface]
6
+ symbols: [ALine, IALine]
7
+ seeAlso: [api/line, api/types/geometry]
8
+ ---
9
+ # ALine
10
+
11
+ ```ts
12
+ interface ALine extends Geometry {
13
+ centered(value?: boolean): this;
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/geometry]].
18
+
19
+ ## Methods
20
+
21
+ ### `centered()`
22
+
23
+ Controls whether the line is centered on the current position.
24
+ When `true`, the line is offset backward by half its length so that the
25
+ current position falls at its midpoint.
26
+
27
+ | Parameter | Type | Description |
28
+ | --- | --- | --- |
29
+ | `value` | `boolean` | `true` to center, `false` (default) to start from the current position. *(optional)* |
30
+
31
+ ## Inherited
32
+
33
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
34
+
35
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,29 @@
1
+ ---
2
+ id: api/types/arc-angles
3
+ title: ArcAngles
4
+ summary: "The ArcAngles type. Extends ExtrudableGeometry; adds 1 method."
5
+ tags: [api, type, interface]
6
+ symbols: [ArcAngles, IArcAngles]
7
+ seeAlso: [api/arc, api/types/extrudable-geometry]
8
+ ---
9
+ # ArcAngles
10
+
11
+ ```ts
12
+ interface ArcAngles extends ExtrudableGeometry {
13
+ centered(): this;
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/extrudable-geometry]].
18
+
19
+ ## Methods
20
+
21
+ ### `centered()`
22
+
23
+ Centers the arc symmetrically around the start angle.
24
+
25
+ ## Inherited
26
+
27
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
28
+
29
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: api/types/arc-points
3
+ title: ArcPoints
4
+ summary: "The ArcPoints type. Extends ExtrudableGeometry; adds 2 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [ArcPoints, IArcPoints]
7
+ seeAlso: [api/arc, api/types/extrudable-geometry]
8
+ ---
9
+ # ArcPoints
10
+
11
+ ```ts
12
+ interface ArcPoints extends ExtrudableGeometry {
13
+ radius(value: number): IArcRadius;
14
+ center(value: Point2DLike): IArcCenter;
15
+ }
16
+ ```
17
+
18
+ Extends [[api/types/extrudable-geometry]].
19
+
20
+ ## Methods
21
+
22
+ ### `radius()`
23
+
24
+ Sets the bulge radius for point-to-point arcs.
25
+ Positive = CCW, negative = CW.
26
+
27
+ **Returns**: `IArcRadius`.
28
+
29
+ | Parameter | Type | Description |
30
+ | --- | --- | --- |
31
+ | `value` | `number` | The bulge radius. |
32
+
33
+ ### `center()`
34
+
35
+ Specifies the circle center point for the arc.
36
+ Mutually exclusive with `.radius()`.
37
+
38
+ **Returns**: `IArcCenter`.
39
+
40
+ | Parameter | Type | Description |
41
+ | --- | --- | --- |
42
+ | `value` | [[api/types/point2dlike]] | The center point of the arc's circle. |
43
+
44
+ ## Inherited
45
+
46
+ From [[api/types/geometry]]: `guide()`, `start()`, `end()`, `tangent()`
47
+
48
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,38 @@
1
+ ---
2
+ id: api/types/axis-like
3
+ title: AxisLike
4
+ summary: "An axis reference accepted by revolve(), repeat(), and other axis-based operations."
5
+ tags: [api, type, union]
6
+ symbols: [AxisLike, AxisObjectBase]
7
+ seeAlso: [api/revolve, api/axis, api/types/axis]
8
+ ---
9
+ # AxisLike
10
+
11
+ ```ts
12
+ type AxisLike = StandardAxis | Axis | IAxis | AxisObjectBase;
13
+ ```
14
+
15
+ An axis reference used by `revolve()` and other axis-based operations. Any of the following formats are accepted:
16
+
17
+ | Format | Example | Description |
18
+ | --- | --- | --- |
19
+ | Standard axis string | `"x"`, `"y"`, `"z"` | The three principal axes. |
20
+ | [[api/types/axis]] | `axis("x", [0, 10])` | An axis object created with `axis()`. |
21
+
22
+ ## Example
23
+
24
+ ```fluid.js
25
+ import { sketch, rect, move, revolve, axis } from "fluidcad/core";
26
+
27
+ sketch("xz", () => {
28
+ move([20, 0]);
29
+ rect(10, 30);
30
+ });
31
+ revolve("z", 360); // string form
32
+
33
+ sketch("xz", () => {
34
+ move([30, 0]);
35
+ rect(5, 5);
36
+ });
37
+ revolve(axis("z"), 180); // Axis form
38
+ ```
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: api/types/axis
3
+ title: Axis
4
+ summary: "The Axis type. Extends SceneObject."
5
+ tags: [api, type, interface]
6
+ symbols: [Axis, IAxis]
7
+ seeAlso: [api/axis, api/types/axis-like, api/types/scene-object]
8
+ ---
9
+ # Axis
10
+
11
+ ```ts
12
+ interface Axis extends SceneObject {
13
+ // No own methods — see Inherited below.
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/scene-object]].
18
+
19
+ ## Inherited
20
+
21
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,50 @@
1
+ ---
2
+ id: api/types/boolean-operation
3
+ title: BooleanOperation
4
+ summary: "The BooleanOperation type. Extends SceneObject; adds 4 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [BooleanOperation, IBooleanOperation]
7
+ seeAlso: [api/types/scene-object, concepts/scene-graph]
8
+ ---
9
+ # BooleanOperation
10
+
11
+ ```ts
12
+ interface BooleanOperation extends SceneObject {
13
+ add(): this;
14
+ 'new'(): this;
15
+ remove(): this;
16
+ scope(...objects: SceneObject[]): this;
17
+ }
18
+ ```
19
+
20
+ Extends [[api/types/scene-object]].
21
+
22
+ ## Methods
23
+
24
+ ### `add()`
25
+
26
+ Additive boolean operation — fuses the result with all intersecting scene objects.
27
+ Use `.scope()` to target specific objects.
28
+
29
+ ### `'new'()`
30
+
31
+ No boolean operation — keeps the result as a standalone shape,
32
+ separate from all other scene objects.
33
+
34
+ ### `remove()`
35
+
36
+ Subtractive boolean operation — cuts the result from all intersecting scene objects.
37
+ Use `.scope()` to target specific objects.
38
+
39
+ ### `scope()`
40
+
41
+ Narrows the boolean operation scope to specific target objects.
42
+ Must be chained after `.add()` or `.remove()`.
43
+
44
+ | Parameter | Type | Description |
45
+ | --- | --- | --- |
46
+ | `...objects` | [[api/types/scene-object]][] | The target objects to operate on. *(optional)* |
47
+
48
+ ## Inherited
49
+
50
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,31 @@
1
+ ---
2
+ id: api/types/circular-repeat-options
3
+ title: CircularRepeatOptions
4
+ summary: "Options for `repeat(\"circular\", ...)`."
5
+ tags: [api, type, options]
6
+ symbols: [CircularRepeatOptions]
7
+ seeAlso: [api/repeat]
8
+ ---
9
+ # CircularRepeatOptions
10
+
11
+ ```ts
12
+ type CircularRepeatOptions = {
13
+ count: number;
14
+ angle?: number;
15
+ offset?: number;
16
+ centered?: boolean;
17
+ skip?: number[];
18
+ };
19
+ ```
20
+
21
+ Options accepted by the circular variant of `repeat()`. Controls how many copies are placed and how they sweep around the chosen axis.
22
+
23
+ ## Properties
24
+
25
+ | Property | Type | Description |
26
+ | --- | --- | --- |
27
+ | `count` | `number` | Number of instances (including the original) |
28
+ | `angle` | `number` | Total angle to spread across. Cannot be used with `offset`. *(optional)* |
29
+ | `offset` | `number` | Angle between each instance. Cannot be used with `angle`. *(optional)* |
30
+ | `centered` | `boolean` | When `true`, centers the pattern around the original object's position *(optional)* |
31
+ | `skip` | `number`[] | Indices to skip (e.g. `[2, 4]` to skip the 3rd and 5th instances) *(optional)* |
@@ -0,0 +1,32 @@
1
+ ---
2
+ id: api/types/common
3
+ title: Common
4
+ summary: "The Common type. Extends SceneObject; adds 1 method."
5
+ tags: [api, type, interface]
6
+ symbols: [Common, ICommon]
7
+ seeAlso: [api/booleans, api/types/scene-object]
8
+ ---
9
+ # Common
10
+
11
+ ```ts
12
+ interface Common extends SceneObject {
13
+ keepOriginal(value?: boolean): this;
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/scene-object]].
18
+
19
+ ## Methods
20
+
21
+ ### `keepOriginal()`
22
+
23
+ Controls whether the original objects involved in the boolean intersection
24
+ are retained or removed after the operation.
25
+
26
+ | Parameter | Type | Description |
27
+ | --- | --- | --- |
28
+ | `value` | `boolean` | `true` to keep originals, `false` (default) to remove them. *(optional)* |
29
+
30
+ ## Inherited
31
+
32
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,125 @@
1
+ ---
2
+ id: api/types/cut
3
+ title: Cut
4
+ summary: "The Cut type. Extends SceneObject; adds 10 methods."
5
+ tags: [api, type, interface]
6
+ symbols: [Cut, ICut]
7
+ seeAlso: [api/cut, api/types/scene-object]
8
+ ---
9
+ # Cut
10
+
11
+ ```ts
12
+ interface Cut extends SceneObject {
13
+ symmetric(): this;
14
+ scope(...objects: SceneObject[]): this;
15
+ draft(value: number | [number, number]): this;
16
+ endOffset(value: number): this;
17
+ startEdges(...args: (number | EdgeFilter)[]): SceneObject;
18
+ endEdges(...args: (number | EdgeFilter)[]): SceneObject;
19
+ internalEdges(...args: (number | EdgeFilter)[]): SceneObject;
20
+ internalFaces(...args: (number | FaceFilter)[]): SceneObject;
21
+ pick(...points: Point2DLike[]): this;
22
+ thin(offset: number): this;
23
+ thin(offset1: number, offset2: number): this;
24
+ }
25
+ ```
26
+
27
+ Extends [[api/types/scene-object]].
28
+
29
+ ## Methods
30
+
31
+ ### `symmetric()`
32
+
33
+ Enables symmetric mode — cuts equally in both directions from the sketch plane.
34
+
35
+ ### `scope()`
36
+
37
+ Narrows the cut scope to specific target objects.
38
+ Must be chained after `.remove()`.
39
+
40
+ | Parameter | Type | Description |
41
+ | --- | --- | --- |
42
+ | `...objects` | [[api/types/scene-object]][] | The target objects to cut from. *(optional)* |
43
+
44
+ ### `draft()`
45
+
46
+ Applies a draft (taper) angle to the cut walls.
47
+
48
+ | Parameter | Type | Description |
49
+ | --- | --- | --- |
50
+ | `value` | `number` \| `[number, number]` | A single angle for uniform draft, or a `[start, end]` tuple for asymmetric draft. |
51
+
52
+ ### `endOffset()`
53
+
54
+ Offsets the cut end face by a specified distance along the cut direction.
55
+
56
+ | Parameter | Type | Description |
57
+ | --- | --- | --- |
58
+ | `value` | `number` | The offset distance. |
59
+
60
+ ### `startEdges()`
61
+
62
+ Selects edges at the start of the cut path, classified by signed distance from the cut plane.
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
+ ### `endEdges()`
71
+
72
+ Selects edges at the end of the cut path, classified by signed distance from the cut plane.
73
+
74
+ **Returns**: [[api/types/scene-object]].
75
+
76
+ | Parameter | Type | Description |
77
+ | --- | --- | --- |
78
+ | `...args` | (`number` \| `EdgeFilter`)[] | Numeric indices or EdgeFilterBuilder instances to filter the selection. *(optional)* |
79
+
80
+ ### `internalEdges()`
81
+
82
+ Selects internal edges created by the cut that are not on the cut plane boundary.
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 internal faces exposed by the cut — newly created surfaces not from the original stock.
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
+ ### `pick()`
101
+
102
+ Restricts the cut to only the sketch regions containing the given points.
103
+
104
+ | Parameter | Type | Description |
105
+ | --- | --- | --- |
106
+ | `...points` | [[api/types/point2dlike]][] | 2D points in the sketch plane identifying regions to cut. *(optional)* |
107
+
108
+ ### `thin()`
109
+
110
+ ```ts
111
+ thin(offset: number): this
112
+ thin(offset1: number, offset2: number): this
113
+ ```
114
+
115
+ Enables thin cut mode — offsets the profile edges to cut a thin-walled shape
116
+ instead of cutting filled faces. Positive values offset outward, negative values offset inward.
117
+
118
+ | Parameter | Type | Description |
119
+ | --- | --- | --- |
120
+ | `offset1` | `number` | The first wall offset distance. Positive = outward, negative = inward. |
121
+ | `offset2` | `number` | The second wall offset distance, in the opposite direction of offset1. |
122
+
123
+ ## Inherited
124
+
125
+ From [[api/types/scene-object]]: `name()`, `reusable()`
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: api/types/draft
3
+ title: Draft
4
+ summary: "The Draft type. Extends SceneObject."
5
+ tags: [api, type, interface]
6
+ symbols: [Draft, IDraft]
7
+ seeAlso: [api/draft, api/types/scene-object]
8
+ ---
9
+ # Draft
10
+
11
+ ```ts
12
+ interface Draft extends SceneObject {
13
+ // No own methods — see Inherited below.
14
+ }
15
+ ```
16
+
17
+ Extends [[api/types/scene-object]].
18
+
19
+ ## Inherited
20
+
21
+ From [[api/types/scene-object]]: `name()`, `reusable()`