forgecad 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{AdminPage-DAu1C1ST.js → AdminPage-D4bocK4E.js} +1 -1
- package/dist/assets/{DocsPage-Gc_BCdqC.js → DocsPage-D3A_g8V3.js} +85 -45
- package/dist/assets/{EditorApp-DG1-oUSV.css → EditorApp-BWYUSpUN.css} +133 -51
- package/dist/assets/EditorApp-Cihhqcsq.js +11692 -0
- package/dist/assets/{EmbedViewer-CEO8XbV8.js → EmbedViewer-kWjKaC_t.js} +1 -1
- package/dist/assets/LandingPageProofDriven-Bg2IUc3l.css +856 -0
- package/dist/assets/LandingPageProofDriven-DXkKlyhI.js +601 -0
- package/dist/assets/{PricingPage-BSrxu6d7.js → PricingPage-BsU5vzEx.js} +1 -1
- package/dist/assets/{SettingsPage-FUCSIRq6.js → SettingsPage-PqvpAKIs.js} +1 -1
- package/dist/assets/{evalWorker-KoR0SNKq.js → evalWorker-C-hzNUMy.js} +2218 -286
- package/dist/assets/{index-wTEK39at.js → index-Pz321YAt.js} +7416 -1481
- package/dist/assets/{index-CyVd1D4D.css → index-ay13WNfa.css} +501 -2
- package/dist/assets/{manifold-B1sGWdYk.js → manifold-BcbjWLIo.js} +3 -3
- package/dist/assets/{manifold-D7o0N50J.js → manifold-DBckbFgx.js} +1 -1
- package/dist/assets/{manifold-G5sBaXzi.js → manifold-O2AAGXyj.js} +1 -1
- package/dist/assets/{reportWorker-DYcRHhv9.js → reportWorker-Dxr-5A7w.js} +2003 -259
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/CLI.md +488 -0
- package/dist/docs-raw/generated/assembly.md +19 -11
- package/dist/docs-raw/generated/concepts.md +1023 -360
- package/dist/docs-raw/generated/core.md +1165 -264
- package/dist/docs-raw/generated/curves.md +168 -1
- package/dist/docs-raw/generated/lib.md +10 -5
- package/dist/docs-raw/generated/output.md +1 -1
- package/dist/docs-raw/generated/sdf.md +208 -0
- package/dist/docs-raw/generated/sketch.md +1281 -329
- package/dist/docs-raw/generated/viewport.md +29 -2
- package/dist/index.html +2 -2
- package/dist/landing/proof-ams-adapter.png +0 -0
- package/dist/landing/proof-bolt-and-nut.png +0 -0
- package/dist/landing/proof-fillet-enclosure.png +0 -0
- package/dist/landing/proof-glasses.png +0 -0
- package/dist/landing/proof-gyroid.png +0 -0
- package/dist/sitemap.xml +6 -6
- package/dist-cli/forgecad.js +3148 -555
- package/dist-cli/forgecad.js.map +1 -1
- package/dist-cli/{solver-FV7TJZGI.js → solver-46FFSK2U.js} +1 -3
- package/dist-cli/{solver-FV7TJZGI.js.map → solver-46FFSK2U.js.map} +1 -1
- package/dist-skill/CONTEXT.md +3700 -1153
- package/dist-skill/SKILL-dev.md +15 -17
- package/dist-skill/SKILL.md +14 -9
- package/dist-skill/docs/API/core/concepts.md +28 -1
- package/dist-skill/docs/CLI.md +488 -0
- package/dist-skill/docs/generated/assembly.md +19 -11
- package/dist-skill/docs/generated/core.md +1165 -264
- package/dist-skill/docs/generated/curves.md +168 -1
- package/dist-skill/docs/generated/lib.md +10 -5
- package/dist-skill/docs/generated/output.md +1 -1
- package/dist-skill/docs/generated/sdf.md +208 -0
- package/dist-skill/docs/generated/sketch.md +1281 -329
- package/dist-skill/docs/generated/viewport.md +29 -2
- package/dist-skill/docs/guides/joint-design.md +78 -0
- package/dist-skill/docs-dev/API/core/concepts.md +28 -1
- package/dist-skill/docs-dev/CLI.md +488 -0
- package/dist-skill/docs-dev/coding.md +1 -1
- package/dist-skill/docs-dev/component-model.md +164 -0
- package/dist-skill/docs-dev/generated/assembly.md +19 -11
- package/dist-skill/docs-dev/generated/core.md +1165 -264
- package/dist-skill/docs-dev/generated/curves.md +168 -1
- package/dist-skill/docs-dev/generated/lib.md +10 -5
- package/dist-skill/docs-dev/generated/output.md +1 -1
- package/dist-skill/docs-dev/generated/sdf.md +208 -0
- package/dist-skill/docs-dev/generated/sketch.md +1281 -329
- package/dist-skill/docs-dev/generated/viewport.md +29 -2
- package/dist-skill/docs-dev/guides/joint-design.md +78 -0
- package/examples/api/attachTo-basics.forge.js +3 -3
- package/examples/api/bill-of-materials.forge.js +9 -9
- package/examples/api/bolt-pattern.forge.js +5 -5
- package/examples/api/boolean-operations.forge.js +2 -2
- package/examples/api/bounding-box-visualizer.forge.js +1 -1
- package/examples/api/clone-duplicate.forge.js +1 -1
- package/examples/api/connector-assembly.forge.js +4 -2
- package/examples/api/connector-basics.forge.js +5 -5
- package/examples/api/constrained-sketch-mechanical.forge.js +4 -4
- package/examples/api/elbow-test.forge.js +3 -3
- package/examples/api/extrude-options.forge.js +4 -4
- package/examples/api/fillet-showcase.forge.js +1 -1
- package/examples/api/gears-tier1.forge.js +5 -5
- package/examples/api/group-test.forge.js +2 -2
- package/examples/api/mesh-import-slats.forge.js +3 -3
- package/examples/api/patterns.forge.js +3 -3
- package/examples/api/pointAlong-orientation.forge.js +2 -2
- package/examples/api/profile-2020-b-slot6.forge.js +4 -4
- package/examples/api/sketch-rounding-strategies.forge.js +1 -1
- package/examples/api/smooth-curve-connections.forge.js +1 -1
- package/examples/api/transition-curves.forge.js +3 -3
- package/examples/constraints/01-fully-constrained-rect.forge.js +2 -2
- package/examples/constraints/02-underconstrained-triangle.forge.js +1 -1
- package/examples/constraints/03-redundant-constraints.forge.js +2 -2
- package/examples/constraints/05-parallel-with-linedistance.forge.js +2 -2
- package/examples/constraints/06-complex-spectrogram.forge.js +1 -1
- package/examples/constraints/07-perpendicular-chain.forge.js +4 -4
- package/examples/constraints/08-symmetric-bracket.forge.js +4 -4
- package/examples/constraints/09-stress-spiral.forge.js +1 -1
- package/examples/constraints/10-stress-honeycomb.forge.js +1 -1
- package/examples/constraints/11-surface-grid.forge.js +2 -2
- package/examples/constraints/12-surface-nested.forge.js +4 -4
- package/examples/constraints/13-surface-complex.forge.js +1 -1
- package/examples/exact-arc-housing.forge.js +12 -0
- package/examples/furniture/adjustable-table.forge.js +13 -13
- package/examples/furniture/bathroom.forge.js +15 -15
- package/examples/furniture/chair.forge.js +12 -12
- package/examples/furniture/picture-frame.forge.js +6 -6
- package/examples/furniture/shoe-rack-doors.forge.js +8 -8
- package/examples/furniture/shoe-rack.forge.js +7 -7
- package/examples/furniture/table-lamp.forge.js +8 -8
- package/examples/gcode/lissajous-vase.forge.js +4 -4
- package/examples/gcode/math-surface.forge.js +3 -3
- package/examples/gcode/parametric-vase.forge.js +4 -4
- package/examples/gcode/spiral-tower.forge.js +4 -4
- package/examples/generative/crystal-growth.forge.js +7 -7
- package/examples/generative/frost-spires.forge.js +6 -6
- package/examples/generative/golden-spiral-tower.forge.js +8 -8
- package/examples/generative/molten-forge.forge.js +6 -6
- package/examples/generative/neon-coral.forge.js +7 -7
- package/examples/mechanical/3d-printer.forge.js +9 -9
- package/examples/mechanical/5-finger-robot-hand.forge.js +4 -4
- package/examples/mechanical/airplane-propeller.forge.js +7 -7
- package/examples/mechanical/bolt-and-nut.forge.js +10 -10
- package/examples/mechanical/door-with-hinges.forge.js +7 -7
- package/examples/mechanical/fillet-enclosure.forge.js +14 -10
- package/examples/mechanical/headphone-hanger-v2.forge.js +9 -9
- package/examples/mechanical/robot_hand.forge.js +10 -10
- package/examples/mechanical/robot_hand_2.forge.js +17 -17
- package/examples/nurbs-surface.forge.js +8 -0
- package/examples/nurbs-tube.forge.js +7 -0
- package/examples/products/bottle.forge.js +7 -7
- package/examples/products/chess-set.forge.js +6 -6
- package/examples/products/classical-piano.forge.js +9 -9
- package/examples/products/clock.forge.js +21 -21
- package/examples/products/cup.forge.js +5 -5
- package/examples/products/iphone.forge.js +12 -12
- package/examples/products/laptop.forge.js +9 -9
- package/examples/products/laser-cut-box.forge.js +6 -6
- package/examples/products/laser-cut-tray.forge.js +6 -6
- package/examples/products/liquid-soap-dispenser.forge.js +5 -5
- package/examples/products/origami-fish.forge.js +6 -6
- package/examples/products/spiderman-cake.forge.js +2 -2
- package/examples/shelf/container.forge.js +5 -5
- package/examples/shelf/shelf-unit.forge.js +6 -6
- package/examples/toolbox/bolted-joint.forge.js +5 -5
- package/package.json +3 -1
- package/dist/assets/EditorApp-D9bJvtf7.js +0 -11338
- package/dist/assets/LandingPage-CdCuEOdC.js +0 -451
- package/dist-cli/chunk-PZ5AY32C.js +0 -10
- package/dist-cli/chunk-PZ5AY32C.js.map +0 -1
- package/dist-skill/docs/CLI/export.md +0 -91
- package/dist-skill/docs/CLI/projects.md +0 -107
- package/dist-skill/docs/CLI/studio_publishing.md +0 -52
- package/dist-skill/docs/CLI/validation.md +0 -66
- package/dist-skill/docs-dev/API/core/sdf-advanced.md +0 -92
- package/dist-skill/docs-dev/API/core/sdf-primitives.md +0 -58
- package/dist-skill/docs-dev/API/core/sdf-workflow.md +0 -42
- package/dist-skill/docs-dev/CLI/export.md +0 -91
- package/dist-skill/docs-dev/CLI/projects.md +0 -107
- package/dist-skill/docs-dev/CLI/studio_publishing.md +0 -52
- package/dist-skill/docs-dev/CLI/validation.md +0 -66
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill-group: cli
|
|
3
|
+
skill-order: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ForgeCAD CLI
|
|
7
|
+
|
|
8
|
+
Run, export, render, and publish `.forge.js` models from your terminal. Everything stays in code.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 1. Install
|
|
14
|
+
npm install -g forgecad
|
|
15
|
+
|
|
16
|
+
# 2. Create a model
|
|
17
|
+
forgecad new cup
|
|
18
|
+
|
|
19
|
+
# 3. Run it
|
|
20
|
+
forgecad run cup.forge.js
|
|
21
|
+
|
|
22
|
+
# 4. Open the editor (live reload)
|
|
23
|
+
forgecad dev
|
|
24
|
+
|
|
25
|
+
# 5. Export
|
|
26
|
+
forgecad export stl cup.forge.js
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Editor
|
|
30
|
+
|
|
31
|
+
ForgeCAD includes a local editor with live reload. Edit a `.forge.js` file, save, and the 3D view updates instantly — parameters become interactive sliders.
|
|
32
|
+
|
|
33
|
+
| Command | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| `dev` | Start the Vite dev server with live reload. No build step required — the preferred way to run ForgeCAD during active development. |
|
|
36
|
+
| `studio` | Serve the production build of the studio (requires dist/ — run `npm run build` first). |
|
|
37
|
+
| `web` | Start a local dev server in web/playground mode (no filesystem, localStorage only). |
|
|
38
|
+
| `open` | Alias for `forgecad studio`. |
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Common flags for dev / studio</summary>
|
|
42
|
+
|
|
43
|
+
| Option | Description |
|
|
44
|
+
|--------|-------------|
|
|
45
|
+
| `--blank` | Start without a project folder |
|
|
46
|
+
| `--port <n>` | Bind to a specific port |
|
|
47
|
+
| `--host [host]` | Expose the server on the network |
|
|
48
|
+
| `--open` | Open a browser window automatically |
|
|
49
|
+
| `--strict-port` | Fail instead of selecting another port |
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
## Run & Render
|
|
54
|
+
|
|
55
|
+
Execute scripts and produce images headless — no browser window. Renders use Chrome under the hood.
|
|
56
|
+
|
|
57
|
+
### `forgecad run`
|
|
58
|
+
|
|
59
|
+
Execute a Forge script and print full geometry diagnostics — object summary, collision detection, spatial analysis, verification results, and solver profiling.
|
|
60
|
+
|
|
61
|
+
The primary validation command. Runs your script with the real geometry kernel (no browser needed) and prints a comprehensive report:
|
|
62
|
+
|
|
63
|
+
**Object summary** — lists every named shape with its volume, bounding box, and body count. For constrained sketches, shows solver status (FULLY / UNDER / OVER constrained), DOF, and error residuals. Problematic constraints (conflicting, redundant, or high-residual) are flagged individually.
|
|
64
|
+
|
|
65
|
+
**Construction history** — shows the build sequence for each shape (primitives, operations, modifications) so you can verify the modeling intent.
|
|
66
|
+
|
|
67
|
+
**Feature summary** — tallies geometry features across all objects (e.g. `3 extrude, 2 fillet, 1 chamfer`).
|
|
68
|
+
|
|
69
|
+
**Verification results** — runs any `verify.*` checks in the script and reports pass/fail with expected vs actual values.
|
|
70
|
+
|
|
71
|
+
**Automatic collision detection** — performs an all-pairs collision check on every named shape. For each pair whose bounding boxes overlap, computes the boolean intersection and reports overlap above 0.1 mm³:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
⚠ COLLISION: bolt ∩ base (shared vol: 42.3mm³)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Intra-group pairs (same assembly group) and mock-to-mock pairs are skipped. If a part passes through a boolean-subtracted hole, no collision is reported — the material is gone.
|
|
78
|
+
|
|
79
|
+
**Spatial analysis** — reports directional relationships and gap distances between nearby objects (e.g. `bracket is ABOVE base (gap: 5mm)`). When no issues are found: `(no collisions, all objects well-separated)`.
|
|
80
|
+
|
|
81
|
+
**Parameters** — lists all declared parameters with their current values. Overridden values are marked with `*`.
|
|
82
|
+
|
|
83
|
+
**Solver profiling** — when constraint solving occurs, shows timing breakdown (clone, solve, redundancy detection, surface building) and solver internals.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
forgecad run examples/cup.forge.js
|
|
87
|
+
forgecad run examples/cup.forge.js --focus
|
|
88
|
+
forgecad run examples/cup.forge.js --focus bracket,hinge
|
|
89
|
+
forgecad run examples/cup.forge.js --hide "wall,bolt"
|
|
90
|
+
forgecad run examples/cup.forge.js --backend occt
|
|
91
|
+
forgecad run examples/cup.forge.js --debug-imports
|
|
92
|
+
forgecad run examples/cup.forge.js -p "Wall Thickness=3" -p "Body Height=200"
|
|
93
|
+
forgecad run examples/constraints/06-complex-spectrogram.forge.js --solver-debug-out tmp/spectrogram-debug
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `forgecad render`
|
|
97
|
+
|
|
98
|
+
Render a Forge scene. Use a subcommand — `3d`, `section`, `wireframe`, `sketch`, or `hq`.
|
|
99
|
+
|
|
100
|
+
`forgecad render` is a group of rendering subcommands. Pick one based on what you want:
|
|
101
|
+
|
|
102
|
+
- `render 3d` — standard viewport PNG, the usual way to visually verify geometry
|
|
103
|
+
- `render wireframe` — edges only, no shading
|
|
104
|
+
- `render section` — 2D cross-section cut by a plane (SVG or PNG)
|
|
105
|
+
- `render sketch` — 2D sketch script to PNG
|
|
106
|
+
- `render hq` — path-traced via Blender Cycles, for documentation and marketing shots
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
forgecad render 3d examples/cup.forge.js
|
|
110
|
+
forgecad render wireframe examples/cup.forge.js
|
|
111
|
+
forgecad render section examples/furniture/01-table.forge.js --plane XZ
|
|
112
|
+
forgecad render hq examples/cup.forge.js --preset dramatic
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### `forgecad render 3d`
|
|
116
|
+
|
|
117
|
+
Render a Forge scene to PNG using the real viewport renderer.
|
|
118
|
+
|
|
119
|
+
Launches a headless Chrome instance, renders the scene with the same WebGL viewport as the editor, and saves a PNG. The output path defaults to `<script-name>.png` next to the input file.
|
|
120
|
+
|
|
121
|
+
Use `--focus` to isolate specific parts (hides everything else) or `--hide` to remove clutter like mock objects. The `--camera` flag accepts named views (`front`, `top`, `iso`) or `azimuth:elevation` angles — pass it multiple times to render several viewpoints in one run.
|
|
122
|
+
|
|
123
|
+
Use `--edges=<off|thin|bold>` to control the edge overlay. For a pure wireframe look, use `render wireframe` instead.
|
|
124
|
+
|
|
125
|
+
This is the standard way to visually verify geometry from the CLI or in agent workflows. For higher quality (path-traced, materials, HDRI lighting), use `render hq` instead.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
forgecad render 3d examples/cup.forge.js
|
|
129
|
+
forgecad render 3d examples/cup.forge.js --focus
|
|
130
|
+
forgecad render 3d examples/cup.forge.js --focus bracket
|
|
131
|
+
forgecad render 3d examples/cup.forge.js --hide "wall,bolt"
|
|
132
|
+
forgecad render 3d model.forge.js --camera 45:30
|
|
133
|
+
forgecad render 3d model.forge.js --camera front --camera side
|
|
134
|
+
forgecad render 3d model.forge.js --edges bold
|
|
135
|
+
forgecad render 3d model.forge.js --edges off
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### `forgecad render wireframe`
|
|
139
|
+
|
|
140
|
+
Render a Forge scene as a wireframe (edges only, no shading).
|
|
141
|
+
|
|
142
|
+
Same as `render 3d` but renders only the edge geometry — no shaded surfaces. Useful for construction-style documentation or highlighting structural features without material detail.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
forgecad render wireframe examples/cup.forge.js
|
|
146
|
+
forgecad render wireframe examples/cup.forge.js --camera iso
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### `forgecad render hq` **\[Pro\]**
|
|
150
|
+
|
|
151
|
+
High-quality render via Blender Cycles — path-traced, HDRI, material presets.
|
|
152
|
+
|
|
153
|
+
Exports the scene to Blender and renders with Cycles (path tracer). Requires Blender installed and on PATH.
|
|
154
|
+
|
|
155
|
+
Choose a `--preset` for the look: `studio` (neutral product shot), `dramatic` (high-contrast), `clay` (matte, no color), `glass`, `metallic`, `toon`, `xray`, `normals`, `silhouette`, and more. Control quality vs speed with `--samples` (default 256). Use `--transparent` for a transparent background (compositing-ready).
|
|
156
|
+
|
|
157
|
+
Output defaults to `<script-name>-hq.png`. Great for documentation, marketing renders, and social media.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
forgecad render hq examples/cup.forge.js
|
|
161
|
+
forgecad render hq examples/cup.forge.js hero.png --preset dramatic --samples 1024
|
|
162
|
+
forgecad render hq examples/cup.forge.js --preset clay --size 2048
|
|
163
|
+
forgecad render hq examples/cup.forge.js --transparent --preset glass
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### `forgecad capture gif|mp4` **\[Pro\]**
|
|
167
|
+
|
|
168
|
+
Animated orbit or joint playback.
|
|
169
|
+
|
|
170
|
+
Renders an animated sequence by either orbiting the camera around the model or playing back a `jointsView` animation. Use `--capture orbit` (default) for a turntable rotation, or `--capture animation --animation <name>` to play a named joints clip. Supports `--cut-plane` to animate with a cross-section visible.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
forgecad capture gif examples/cup.forge.js
|
|
174
|
+
forgecad capture gif examples/3d-printer.forge.js out/section.gif --cut-plane "Front Section"
|
|
175
|
+
forgecad capture mp4 examples/cup.forge.js
|
|
176
|
+
forgecad capture mp4 examples/api/runtime-joints-view.forge.js out/step.mp4 --capture animation --animation Step
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### `forgecad render section`
|
|
180
|
+
|
|
181
|
+
Render a 2D cross-section of a 3D model (cut by a plane) to SVG or PNG.
|
|
182
|
+
|
|
183
|
+
Cuts all shapes in the scene with an axis-aligned plane and produces a 2D cross-section drawing. The default plane is XY at Z=0. Use `--plane XZ` or `--plane YZ` for other orientations, and `--offset` to shift the cut position.
|
|
184
|
+
|
|
185
|
+
Output format is determined by the file extension: `.svg` (default, vector) or `.png` (rasterized at `--size` pixels). Use `--edges=<off|thin|bold>` to control the outline stroke on cut shapes.
|
|
186
|
+
|
|
187
|
+
Useful for verifying internal geometry, wall thicknesses, and fit checks that aren't visible in 3D renders.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
forgecad render section examples/furniture/01-table.forge.js
|
|
191
|
+
forgecad render section examples/furniture/01-table.forge.js out/section.svg --plane XZ --offset 10
|
|
192
|
+
forgecad render section examples/furniture/01-table.forge.js out/section.png --size 2048
|
|
193
|
+
forgecad render section examples/furniture/01-table.forge.js out/bold.svg --edges bold
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
| Command | Description |
|
|
197
|
+
|---------|-------------|
|
|
198
|
+
| `render sketch` | Render a 2D sketch .forge.js to PNG. |
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary>All render / capture flags</summary>
|
|
202
|
+
|
|
203
|
+
| Option | Description |
|
|
204
|
+
|--------|-------------|
|
|
205
|
+
| `--focus <names>` | Focus: no arg hides mocks; comma-separated names shows only those |
|
|
206
|
+
| `--hide <names>` | Hide comma-separated object names |
|
|
207
|
+
| `--camera <front\|side\|top\|iso\|az:el\|az:el:dist\|spec>` | Camera preset, spherical (az:el), or full spec. Repeatable. |
|
|
208
|
+
| `--size <px>` | Image size in pixels |
|
|
209
|
+
| `--scene <json>` | Viewport scene state JSON |
|
|
210
|
+
| `--background <color>` | Canvas background override |
|
|
211
|
+
| `--render-mode <solid\|wireframe>` | Shaded solid (default) or wireframe only |
|
|
212
|
+
| `--edges <off\|thin\|bold>` | Edge overlay preset in solid mode (default: thin) |
|
|
213
|
+
| `--port <n>` | Vite dev server port |
|
|
214
|
+
| `--chrome-path <path>` | Chrome or Chromium executable path |
|
|
215
|
+
| `--output <path>` | Output file path |
|
|
216
|
+
| `--preset <name>` | Material/lighting preset |
|
|
217
|
+
| `--width <px>` | Output width in pixels |
|
|
218
|
+
| `--height <px>` | Output height in pixels |
|
|
219
|
+
| `--samples <n>` | Render samples (more = higher quality, slower) |
|
|
220
|
+
| `--engine <cycles\|eevee>` | Render engine |
|
|
221
|
+
| `--transparent` | Transparent background (RGBA) |
|
|
222
|
+
| `--no-denoise` | Disable denoising |
|
|
223
|
+
| `--hdri <path.hdr>` | Custom HDRI environment map path |
|
|
224
|
+
| `--video` | Render orbit turntable video (MP4) |
|
|
225
|
+
| `--frames <n>` | Video frames per revolution |
|
|
226
|
+
| `--fps <n>` | Video frame rate |
|
|
227
|
+
| `--pitch <deg>` | Camera pitch angle in degrees |
|
|
228
|
+
| `--quality <default\|live\|high>` | Mesh tessellation quality |
|
|
229
|
+
| `--backend <manifold\|occt>` | Geometry backend |
|
|
230
|
+
| `--format <gif\|mp4>` | Output format |
|
|
231
|
+
| `--capture <orbit\|animation>` | Capture preset |
|
|
232
|
+
| `--animation <name>` | Named jointsView animation clip |
|
|
233
|
+
| `--animation-loops <n>` | Repeat the selected animation clip |
|
|
234
|
+
| `--cut-plane <name>` | Enable a named cut plane |
|
|
235
|
+
| `--wireframe-pass` | Enable an extra wireframe pass (off by default) |
|
|
236
|
+
| `--no-wireframe-pass` | Disable the extra wireframe pass |
|
|
237
|
+
| `--pixel-ratio <n>` | Render supersampling factor |
|
|
238
|
+
| `--frames-per-turn <n>` | Frames for one orbit turn |
|
|
239
|
+
| `--hold-frames <n>` | Freeze frames before each pass |
|
|
240
|
+
| `--encoder <auto\|ffmpeg\|js>` | GIF encoder strategy |
|
|
241
|
+
| `--crf <n>` | ffmpeg/libx264 quality |
|
|
242
|
+
| `--ffmpeg-path <path>` | ffmpeg executable path |
|
|
243
|
+
| `--list` | Print available animations and cut planes |
|
|
244
|
+
|
|
245
|
+
</details>
|
|
246
|
+
|
|
247
|
+
## Export
|
|
248
|
+
|
|
249
|
+
Export to every format you need. Free-tier formats work out of the box.
|
|
250
|
+
|
|
251
|
+
| Command | Format | Use case |
|
|
252
|
+
|---------|--------|----------|
|
|
253
|
+
| `export svg` | SVG | 2D vector output from sketches |
|
|
254
|
+
| `export sketch-pdf` **\[Pro\]** | PDF | Sketch with dimensions and constraints |
|
|
255
|
+
| `export step` **\[Pro\]** | STEP | CAD interchange (exact geometry) |
|
|
256
|
+
| `export brep` **\[Pro\]** | BREP | Boundary representation |
|
|
257
|
+
| `export 3mf` | 3MF | 3D printing (color, multi-part) |
|
|
258
|
+
| `export stl` | STL | 3D printing |
|
|
259
|
+
| `export gcode` **\[Pro\]** | G-code | Toolpath (scripted, not sliced) |
|
|
260
|
+
| `export sdf` **\[Pro\]** | SDF package | Gazebo robot simulation |
|
|
261
|
+
| `export urdf` **\[Pro\]** | URDF package | ROS / PyBullet / MuJoCo |
|
|
262
|
+
| `export report` **\[Pro\]** | PDF report | Multi-view report with BOM and dimensions |
|
|
263
|
+
| `export cutting-layout` **\[Pro\]** | PDF | Sheet cutting layout with cut sequence |
|
|
264
|
+
| `link` | URL | Generate a ForgeCAD share link from a GitHub Gist URL or ID and copy it to clipboard. |
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# 3D printing
|
|
268
|
+
forgecad export stl bracket.forge.js
|
|
269
|
+
forgecad export 3mf bracket.forge.js --quality high
|
|
270
|
+
|
|
271
|
+
# CAD interchange
|
|
272
|
+
forgecad export step bracket.forge.js
|
|
273
|
+
forgecad export step bracket.forge.js --allow-faceted
|
|
274
|
+
|
|
275
|
+
# Technical drawings
|
|
276
|
+
forgecad export report bracket.forge.js out/report.pdf
|
|
277
|
+
|
|
278
|
+
# Robot simulation
|
|
279
|
+
forgecad export sdf rover.forge.js --output out/forge_scout
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
<details>
|
|
283
|
+
<summary>Export flags</summary>
|
|
284
|
+
|
|
285
|
+
| Option | Description |
|
|
286
|
+
|--------|-------------|
|
|
287
|
+
| `--output <path>` | Output STEP path |
|
|
288
|
+
| `--python <path>` | Python interpreter for uv |
|
|
289
|
+
| `--uv <path>` | uv executable path |
|
|
290
|
+
| `--allow-faceted` | Allow faceted fallback for closed mesh solids |
|
|
291
|
+
| `--quality <default\|live\|high>` | Forge quality preset |
|
|
292
|
+
| `--backend <manifold\|occt>` | Geometry backend |
|
|
293
|
+
| `--dim-angle-tol <deg>` | Dimension routing tolerance in degrees |
|
|
294
|
+
| `--sheet-width <mm>` | Stock sheet width in mm |
|
|
295
|
+
| `--sheet-height <mm>` | Stock sheet height in mm |
|
|
296
|
+
| `--kerf <mm>` | Cutting clearance (saw blade width) in mm |
|
|
297
|
+
|
|
298
|
+
</details>
|
|
299
|
+
|
|
300
|
+
## Projects & Publishing
|
|
301
|
+
|
|
302
|
+
ForgeCAD has a hosted platform at [forgecad.io](https://forgecad.io). The CLI connects your local files to it.
|
|
303
|
+
|
|
304
|
+
### Get started
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
forgecad login
|
|
308
|
+
forgecad project init "Spool Adapter"
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Sync
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
forgecad project push # Upload local changes
|
|
315
|
+
forgecad project pull # Download remote changes
|
|
316
|
+
forgecad project status # See what's different
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Publish
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
forgecad publish adapter.forge.js --title "AMS Lite Adapter"
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Shares are live references — always the current version, not a snapshot.
|
|
326
|
+
|
|
327
|
+
<details>
|
|
328
|
+
<summary>All project commands</summary>
|
|
329
|
+
|
|
330
|
+
**Authentication**
|
|
331
|
+
|
|
332
|
+
| Command | Description |
|
|
333
|
+
|---------|-------------|
|
|
334
|
+
| `login` | Authenticate with ForgeCAD (email/password). |
|
|
335
|
+
| `logout` | Clear stored authentication credentials. |
|
|
336
|
+
| `whoami` | Show the current user, server, and license status. |
|
|
337
|
+
|
|
338
|
+
**Projects**
|
|
339
|
+
|
|
340
|
+
| Command | Description |
|
|
341
|
+
|---------|-------------|
|
|
342
|
+
| `project init` | Initialize the current directory as a ForgeCAD project and create it on the server. |
|
|
343
|
+
| `project clone` | Download a remote project into a new local directory. |
|
|
344
|
+
| `project pull` | Download remote changes into the current project. |
|
|
345
|
+
| `project push` | Upload local changes to the remote project. |
|
|
346
|
+
| `project status` | Show differences between local and remote project files. |
|
|
347
|
+
| `project list` | List your remote projects. |
|
|
348
|
+
| `project open` | Open the current project in the browser. |
|
|
349
|
+
| `project info` | Show details of the current project (name, visibility, files, URL). |
|
|
350
|
+
| `project rename` | Rename the current project. |
|
|
351
|
+
| `project set-visibility` | Change project visibility. |
|
|
352
|
+
| `project delete` | Permanently delete the current project and all its files on the server. |
|
|
353
|
+
|
|
354
|
+
**Members**
|
|
355
|
+
|
|
356
|
+
| Command | Description |
|
|
357
|
+
|---------|-------------|
|
|
358
|
+
| `project members` | List members of the current project. |
|
|
359
|
+
| `project add-member` | Add a member to the current project. |
|
|
360
|
+
| `project remove-member` | Remove a member from the current project. |
|
|
361
|
+
| `project set-role` | Change a member's role. |
|
|
362
|
+
|
|
363
|
+
**Files (remote)**
|
|
364
|
+
|
|
365
|
+
| Command | Description |
|
|
366
|
+
|---------|-------------|
|
|
367
|
+
| `file list` | List remote files in the current project. |
|
|
368
|
+
| `file read` | Read a remote file and print its contents. |
|
|
369
|
+
| `file save` | Create or update a remote file. Reads from local file, --content, or --stdin. |
|
|
370
|
+
| `file delete` | Delete a remote file. |
|
|
371
|
+
| `file rename` | Rename or move a remote file. |
|
|
372
|
+
| `file mkdir` | Create a directory in the remote project. |
|
|
373
|
+
| `file copy` | Copy a file from another project into the current one. |
|
|
374
|
+
|
|
375
|
+
**Shares**
|
|
376
|
+
|
|
377
|
+
| Command | Description |
|
|
378
|
+
|---------|-------------|
|
|
379
|
+
| `publish` | Publish a model and get a shareable link. Auto-syncs project if inside one. |
|
|
380
|
+
| `shares list` | List your published models. |
|
|
381
|
+
| `shares delete` | Unpublish a shared model. |
|
|
382
|
+
|
|
383
|
+
**API Tokens**
|
|
384
|
+
|
|
385
|
+
| Command | Description |
|
|
386
|
+
|---------|-------------|
|
|
387
|
+
| `token create` | Create a new API token for CLI and CI/CD access. |
|
|
388
|
+
| `token list` | List your API tokens. |
|
|
389
|
+
| `token revoke` | Revoke an API token. |
|
|
390
|
+
|
|
391
|
+
**Scaffolding**
|
|
392
|
+
|
|
393
|
+
| Command | Description |
|
|
394
|
+
|---------|-------------|
|
|
395
|
+
| `new` | Create a new .forge.js file from a template. |
|
|
396
|
+
|
|
397
|
+
</details>
|
|
398
|
+
|
|
399
|
+
## AI Integration
|
|
400
|
+
|
|
401
|
+
ForgeCAD files are plain JavaScript. AI coding agents write and iterate on them directly. The CLI closes the loop.
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# Give your agent full ForgeCAD API knowledge
|
|
405
|
+
forgecad skill install
|
|
406
|
+
|
|
407
|
+
# Or export a single context file for chat UIs (Claude.ai, ChatGPT, ...)
|
|
408
|
+
forgecad skill one-file ~/Desktop/forgecad-context.md
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
> **Workflow:** Agent writes the model → `forgecad run` validates it → `forgecad check params` sweeps the parameter range → `forgecad export stl` ships the result. All in the terminal.
|
|
412
|
+
|
|
413
|
+
## Validation
|
|
414
|
+
|
|
415
|
+
Test parameter ranges and run invariant suites.
|
|
416
|
+
|
|
417
|
+
### `forgecad check params`
|
|
418
|
+
|
|
419
|
+
Sweep parameter ranges and report runtime failures, degeneracy, and new collisions.
|
|
420
|
+
|
|
421
|
+
For each declared parameter, samples `N` values evenly across its `[min, max]` range (default 8) while holding all other parameters at their defaults. At each sample, checks for:
|
|
422
|
+
|
|
423
|
+
1. **Runtime errors** — script crashes at certain parameter values
|
|
424
|
+
2. **Degenerate geometry** — shapes with near-zero volume (collapsed geometry)
|
|
425
|
+
3. **New collisions** — part pairs that collide at the sampled value but not at the default
|
|
426
|
+
|
|
427
|
+
Baseline collisions (those present at default parameter values) are listed but not flagged as issues — only *new* collisions introduced by parameter changes are reported. Results are grouped by parameter with the problematic value ranges shown.
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
forgecad check params examples/shoe-rack-doors.forge.js
|
|
431
|
+
forgecad check params path/to/model.forge.js --samples 12
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
<details>
|
|
435
|
+
<summary>All check commands (CI / development)</summary>
|
|
436
|
+
|
|
437
|
+
| Command | Description |
|
|
438
|
+
|---------|-------------|
|
|
439
|
+
| `check suite` | Run the repo invariant suite, with local and full profiles for everyday checks vs CI gates. |
|
|
440
|
+
| `check transforms` | Run transform and assembly invariants. |
|
|
441
|
+
| `check dimensions` | Run dimension propagation invariants. |
|
|
442
|
+
| `check placement` | Run placement reference invariants. |
|
|
443
|
+
| `check js-modules` | Run JavaScript module import invariants. |
|
|
444
|
+
| `check brep` | Run exact BREP export invariants. |
|
|
445
|
+
| `check constraints` | Run constraint solver invariants and snapshot regression tests. |
|
|
446
|
+
| `check compiler` | Run compiler routing snapshots and runtime-vs-lowered invariants. |
|
|
447
|
+
| `check query-propagation` | Run focused topology-rewrite query-propagation snapshots and invariants. |
|
|
448
|
+
| `check examples` | Run the example architecture gate across the checked manifest for `examples/`. |
|
|
449
|
+
| `check api` | Run script API contract invariants. |
|
|
450
|
+
| `check text` | Run text2d geometry contract tests. |
|
|
451
|
+
| `check occt-lower` | Run OCCT lowerer geometry invariant tests. |
|
|
452
|
+
| `check backend-parity` | Compare Manifold vs OCCT backend outputs across example files. |
|
|
453
|
+
|
|
454
|
+
</details>
|
|
455
|
+
|
|
456
|
+
<details>
|
|
457
|
+
<summary>Debug commands (ForgeCAD development)</summary>
|
|
458
|
+
|
|
459
|
+
| Command | Description |
|
|
460
|
+
|---------|-------------|
|
|
461
|
+
| `debug compiler` | Inspect compiler routes, lowered plans, and runtime snapshots for a script. |
|
|
462
|
+
| `debug dimensions` | Inspect report-dimension routing for a script. |
|
|
463
|
+
| `debug faces` | Inspect face transformation histories for a script. |
|
|
464
|
+
|
|
465
|
+
</details>
|
|
466
|
+
|
|
467
|
+
## Setup & Licensing
|
|
468
|
+
|
|
469
|
+
| Command | Description |
|
|
470
|
+
|---------|-------------|
|
|
471
|
+
| `completion` | Generate shell completion scripts for bash, zsh, or fish. |
|
|
472
|
+
| `whoami` | Show the current user, server, and license status. |
|
|
473
|
+
| `new` | Create a new .forge.js file from a template. |
|
|
474
|
+
| `doctor` | Check system dependencies for all CLI features. |
|
|
475
|
+
|
|
476
|
+
### Licensing
|
|
477
|
+
|
|
478
|
+
The CLI is free for core workflows. Advanced exports and rendering are Pro.
|
|
479
|
+
|
|
480
|
+
| Free | Pro |
|
|
481
|
+
|------|-----|
|
|
482
|
+
| `run`, `dev`, `studio`, `render 3d`, `export stl`, `export 3mf`, `export svg`, `check params`, `check suite` | `render hq`, `capture gif`, `capture mp4`, `export sketch-pdf`, `export step`, `export brep`, `export gcode`, `export sdf`, `export urdf`, `export report`, `export cutting-layout` |
|
|
483
|
+
|
|
484
|
+
```bash
|
|
485
|
+
forgecad license # Check status
|
|
486
|
+
forgecad license activate # Activate Pro
|
|
487
|
+
forgecad license deactivate # Remove license
|
|
488
|
+
```
|
|
@@ -33,6 +33,8 @@ bomToCsv(rows: BomRow[]): string
|
|
|
33
33
|
|
|
34
34
|
#### `assembly()` — Create an assembly container with named parts and joints for kinematic mechanisms.
|
|
35
35
|
|
|
36
|
+
**Use this from iteration 1 for any model with moving parts.** Hinges, sliders, gears, articulated fingers, doors — all start with `assembly()`, not with manual rotation math. Don't build a static "extended pose" first and refactor to an assembly later: joint sliders, animations, sweeps, collision detection, and robot export all flow from the kinematic graph.
|
|
37
|
+
|
|
36
38
|
An assembly models a mechanism as a directed graph of parts connected by joints. Parts are the nodes; joints are directed edges from parent to child. The graph must be a forest (no cycles). Root parts (those with no incoming joint) are anchored to world space.
|
|
37
39
|
|
|
38
40
|
Three joint types are supported: `'revolute'` (hinge), `'prismatic'` (slider), and `'fixed'` (rigid attachment). Use `addPart()` to add geometry, `addJoint()` (or the shorthands `addRevolute()`, `addPrismatic()`, `addFixed()`) to connect parts, and `solve()` to compute world-space positions at a given joint state.
|
|
@@ -62,7 +64,7 @@ assembly(name?: string): Assembly
|
|
|
62
64
|
|
|
63
65
|
#### `joint()` — Create a revolute joint that auto-generates a parameter slider and rotates the shape.
|
|
64
66
|
|
|
65
|
-
This is a convenience wrapper for single-shape, single-joint use cases. It calls
|
|
67
|
+
This is a convenience wrapper for single-shape, single-joint use cases. It calls `param()` to create a named angle slider, then applies `rotateAroundAxis()` to the shape. Use the full `Assembly` API for mechanisms with multiple parts and joints.
|
|
66
68
|
|
|
67
69
|
```ts
|
|
68
70
|
const arm = joint("Shoulder", armShape, [0, 0, 20], {
|
|
@@ -268,22 +270,28 @@ addFixed(name: string, parent: string, child: string, options?: JointOptions): A
|
|
|
268
270
|
|
|
269
271
|
Connector references use `"PartName.connectorName"` format. The system aligns connector origins (child connector lands exactly on parent connector) and derives the joint frame and axis from the connector geometry — no manual `frame` or `axis` math needed.
|
|
270
272
|
|
|
271
|
-
|
|
273
|
+
**Face-to-face convention:** Connectors always meet face-to-face, like a USB plug meeting a socket. Each connector's axis points "outward" from its part. When two connectors mate, the system brings them together so their axes oppose (anti-parallel). This is the same convention used by `matchTo()`.
|
|
274
|
+
|
|
275
|
+
For a revolute joint (hinge), both connectors' axes should point outward from their respective parts along the hinge line. For a prismatic joint (slider), both axes should point along the slide direction from their part's perspective.
|
|
276
|
+
|
|
277
|
+
The joint type is inferred from the connector's `kind` field if not specified in `options`.
|
|
272
278
|
|
|
273
279
|
When connectors are defined with `start`/`end`, you can control which point on each connector meets via `align` / `parentAlign` / `childAlign` (`'start'`, `'middle'`, `'end'`).
|
|
274
280
|
|
|
275
281
|
Use `connect()` when connector origins must physically coincide (flange-to-flange, bolt-into-bore). For mechanisms where parts share an axis but are deliberately spaced apart, use `addRevolute()` with pre-positioned parts instead.
|
|
276
282
|
|
|
277
283
|
```ts
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
// Hinge: both axes point outward along the hinge line
|
|
285
|
+
const frame = box(100, 10, 80).withConnectors({
|
|
286
|
+
hinge: connector("hinge", { origin: [0, 0, 40], axis: [0, 0, 1] }),
|
|
287
|
+
});
|
|
288
|
+
const door = box(60, 4, 80).withConnectors({
|
|
289
|
+
hinge: connector("hinge", { origin: [0, 0, 40], axis: [0, 0, -1] }),
|
|
290
|
+
});
|
|
291
|
+
assembly("Door")
|
|
292
|
+
.addPart("Frame", frame)
|
|
293
|
+
.addPart("Door", door)
|
|
294
|
+
.connect("Frame.hinge", "Door.hinge", { as: "swing", min: 0, max: 110 });
|
|
287
295
|
```
|
|
288
296
|
|
|
289
297
|
```ts
|