forgecad 0.6.3 → 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 +3 -12
- package/dist/assets/{AdminPage-CeqCUUgu.js → AdminPage-D4bocK4E.js} +250 -151
- package/dist/assets/{BlogPage-P_AJP0v9.js → BlogPage-CJEXL_zJ.js} +94 -70
- package/dist/assets/{DocsPage-CKRV2iq2.js → DocsPage-D3A_g8V3.js} +329 -163
- package/dist/assets/{EditorApp-CnC2k4cW.css → EditorApp-BWYUSpUN.css} +590 -136
- package/dist/assets/EditorApp-Cihhqcsq.js +11692 -0
- package/dist/assets/{EmbedViewer-DBlzmQ5i.js → EmbedViewer-kWjKaC_t.js} +2 -4
- package/dist/assets/LandingPageProofDriven-Bg2IUc3l.css +856 -0
- package/dist/assets/LandingPageProofDriven-DXkKlyhI.js +601 -0
- package/dist/assets/PricingPage-BsU5vzEx.js +232 -0
- package/dist/assets/{SettingsPage-BqCh9JcC.js → SettingsPage-PqvpAKIs.js} +129 -5
- package/dist/assets/{evalWorker-Ql-aKwLA.js → evalWorker-C-hzNUMy.js} +8949 -3161
- package/dist/assets/{Viewport-CoB46f5R.js → index-Pz321YAt.js} +38382 -7501
- package/dist/assets/{index-2hfs_ub0.css → index-ay13WNfa.css} +726 -53
- package/dist/assets/{javascript-DCxGoE5Y.js → javascript-DAl8Gmyo.js} +1 -1
- package/dist/assets/{manifold-CqNMHHKO.js → manifold-BcbjWLIo.js} +4 -3
- package/dist/assets/{manifold-Cce9wRFz.js → manifold-DBckbFgx.js} +1 -1
- package/dist/assets/{manifold-D6BeHIOo.js → manifold-O2AAGXyj.js} +1 -1
- package/dist/assets/{reportWorker-sFEFonXf.js → reportWorker-Dxr-5A7w.js} +8760 -3559
- package/dist/assets/{vendor-react-Dt7-aaJH.js → vendor-react-CG3i_wp0.js} +65 -8
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/CLI.md +341 -718
- package/dist/docs-raw/generated/assembly.md +699 -112
- package/dist/docs-raw/generated/concepts.md +1834 -1346
- package/dist/docs-raw/generated/core.md +1012 -1059
- package/dist/docs-raw/generated/curves.md +759 -116
- package/dist/docs-raw/generated/lib.md +43 -748
- package/dist/docs-raw/generated/output.md +139 -245
- package/dist/docs-raw/generated/sdf.md +208 -0
- package/dist/docs-raw/generated/sheet-metal.md +473 -21
- package/dist/docs-raw/generated/sketch.md +1518 -362
- package/dist/docs-raw/generated/viewport.md +368 -299
- package/dist/docs-raw/generated/wood.md +104 -0
- 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 +12321 -5700
- package/dist-cli/forgecad.js.map +1 -0
- package/dist-cli/solver-46FFSK2U.js +363 -0
- package/dist-cli/solver-46FFSK2U.js.map +1 -0
- package/dist-skill/CONTEXT.md +4890 -6302
- package/dist-skill/SKILL-dev.md +22 -66
- package/dist-skill/SKILL.md +20 -59
- package/dist-skill/docs/API/core/concepts.md +37 -92
- package/dist-skill/docs/CLI.md +341 -718
- package/dist-skill/docs/generated/assembly.md +699 -112
- package/dist-skill/docs/generated/core.md +1012 -1059
- package/dist-skill/docs/generated/curves.md +759 -116
- package/dist-skill/docs/generated/lib.md +43 -748
- package/dist-skill/docs/generated/output.md +139 -245
- package/dist-skill/docs/generated/sdf.md +208 -0
- package/dist-skill/docs/generated/sheet-metal.md +473 -21
- package/dist-skill/docs/generated/sketch.md +1518 -362
- package/dist-skill/docs/generated/viewport.md +368 -299
- package/dist-skill/docs/generated/wood.md +104 -0
- package/dist-skill/docs/guides/coordinate-system.md +11 -17
- package/dist-skill/docs/guides/geometry-conventions.md +13 -70
- package/dist-skill/docs/guides/joint-design.md +78 -0
- package/dist-skill/docs/guides/modeling-recipes.md +22 -195
- package/dist-skill/docs/guides/positioning.md +88 -147
- package/dist-skill/docs-dev/API/core/concepts.md +78 -0
- package/dist-skill/docs-dev/CLI.md +488 -0
- package/dist-skill/{docs → docs-dev}/blueprint-first.md +5 -0
- package/dist-skill/{docs → docs-dev}/coding-best-practices.md +6 -8
- package/dist-skill/{docs → docs-dev}/coding.md +2 -4
- package/dist-skill/docs-dev/component-model.md +164 -0
- package/dist-skill/docs-dev/generated/assembly.md +779 -0
- package/dist-skill/docs-dev/generated/core.md +1676 -0
- package/dist-skill/docs-dev/generated/curves.md +855 -0
- package/dist-skill/docs-dev/generated/lib.md +55 -0
- package/dist-skill/docs-dev/generated/output.md +234 -0
- package/dist-skill/docs-dev/generated/sdf.md +208 -0
- package/dist-skill/docs-dev/generated/sheet-metal.md +506 -0
- package/dist-skill/docs-dev/generated/sketch.md +1753 -0
- package/dist-skill/docs-dev/generated/viewport.md +513 -0
- package/dist-skill/docs-dev/generated/wood.md +104 -0
- package/dist-skill/docs-dev/guides/coordinate-system.md +46 -0
- package/dist-skill/docs-dev/guides/geometry-conventions.md +52 -0
- package/dist-skill/docs-dev/guides/joint-design.md +78 -0
- package/dist-skill/docs-dev/guides/modeling-recipes.md +77 -0
- package/dist-skill/docs-dev/guides/positioning.md +151 -0
- package/dist-skill/{docs → docs-dev}/guides/skill-maintenance.md +21 -10
- package/dist-skill/{docs → docs-dev}/internals/compiler.md +5 -6
- package/dist-skill/{docs → docs-dev}/internals/constraint-solver-quality.md +0 -1
- package/dist-skill/{docs → docs-dev}/internals/constraint-solver.md +0 -1
- package/dist-skill/{docs → docs-dev}/internals/sketch-2d-pipeline.md +2 -3
- package/examples/api/attachTo-basics.forge.js +8 -8
- 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 +5 -5
- package/examples/api/bounding-box-visualizer.forge.js +3 -3
- package/examples/api/clone-duplicate.forge.js +2 -2
- package/examples/api/colors-union-vs-array.forge.js +6 -6
- package/examples/api/connector-assembly.forge.js +8 -6
- package/examples/api/connector-basics.forge.js +7 -7
- 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 +8 -14
- package/examples/api/feature-created-faces.forge.js +6 -10
- package/examples/api/fillet-showcase.forge.js +2 -2
- package/examples/api/folded-service-panel-cover.forge.js +2 -2
- package/examples/api/gears-tier1.forge.js +5 -5
- package/examples/api/group-test.forge.js +3 -3
- package/examples/api/group-vs-union.forge.js +1 -1
- package/examples/api/highlight-debug.forge.js +4 -0
- package/examples/api/js-module-pillars.js +1 -1
- package/examples/api/js-module-scene.js +2 -2
- package/examples/api/mesh-import-slats.forge.js +4 -4
- package/examples/api/patterns.forge.js +3 -3
- package/examples/api/pointAlong-orientation.forge.js +3 -3
- package/examples/api/profile-2020-b-slot6.forge.js +4 -5
- package/examples/api/route-perimeter-flange.forge.js +1 -1
- package/examples/api/sdf-rover-demo.forge.js +10 -10
- package/examples/api/sketch-on-face-demo.forge.js +2 -2
- package/examples/api/sketch-regions.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 +4 -4
- package/examples/api/variable-sweep-pure-sdf-test.forge.js +162 -0
- package/examples/api/variable-sweep-test.forge.js +2 -2
- package/examples/api/wood-joinery.forge.js +60 -0
- package/examples/compiler-corpus/enclosure-shell-cuts.forge.js +3 -3
- package/examples/compiler-corpus/fastener-plate-variants.forge.js +2 -2
- 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/experiments/drone-arm.forge.js +53 -0
- package/examples/furniture/adjustable-table.forge.js +15 -15
- package/examples/furniture/bathroom.forge.js +26 -26
- package/examples/furniture/chair.forge.js +13 -13
- 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 +9 -9
- package/examples/generative/frost-spires.forge.js +9 -9
- package/examples/generative/golden-spiral-tower.forge.js +11 -11
- 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 +37 -37
- package/examples/mechanical/5-finger-robot-hand.forge.js +19 -19
- package/examples/mechanical/airplane-propeller.forge.js +9 -9
- 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 +15 -11
- package/examples/mechanical/headphone-hanger-v2.forge.js +11 -11
- package/examples/mechanical/robot_hand.forge.js +24 -24
- package/examples/mechanical/robot_hand_2.forge.js +26 -26
- package/examples/nurbs-surface.forge.js +8 -0
- package/examples/nurbs-tube.forge.js +7 -0
- package/examples/products/bottle.forge.js +8 -8
- package/examples/products/chess-set.forge.js +25 -25
- package/examples/products/classical-piano.forge.js +20 -20
- package/examples/products/clock.forge.js +33 -33
- package/examples/products/cup.forge.js +5 -5
- package/examples/products/iphone.forge.js +20 -20
- package/examples/products/laptop.forge.js +24 -24
- 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 +23 -23
- package/examples/products/origami-fish.forge.js +14 -12
- package/examples/products/spiderman-cake.forge.js +6 -6
- package/examples/shelf/container.forge.js +5 -5
- package/examples/shelf/shelf-unit.forge.js +6 -6
- package/examples/toolbox/bolted-joint.forge.js +7 -7
- package/package.json +9 -4
- package/dist/assets/EditorApp-B-vQvgam.js +0 -9888
- package/dist/assets/LandingPage-C5n9hDXI.js +0 -322
- package/dist/assets/PublishedModelPage-Dt7PCVBj.js +0 -146
- package/dist/assets/__vite-browser-external-CURh0WXD.js +0 -8
- package/dist/assets/deserializeRunResult-BLAFoiE0.js +0 -19365
- package/dist/assets/index-1CYp3zUp.js +0 -1455
- package/dist-skill/docs/API/API.md +0 -1666
- package/dist-skill/docs/API/README.md +0 -37
- package/dist-skill/docs/API/assembly/assembly.md +0 -617
- package/dist-skill/docs/API/core/edge-queries.md +0 -130
- package/dist-skill/docs/API/core/parameters.md +0 -122
- package/dist-skill/docs/API/core/reserved-terms.md +0 -137
- package/dist-skill/docs/API/core/sdf.md +0 -326
- package/dist-skill/docs/API/core/skill-cli.md +0 -194
- package/dist-skill/docs/API/core/skill-guide.md +0 -205
- package/dist-skill/docs/API/core/specs.md +0 -186
- package/dist-skill/docs/API/core/topology.md +0 -372
- package/dist-skill/docs/API/entities.md +0 -268
- package/dist-skill/docs/API/output/bom.md +0 -58
- package/dist-skill/docs/API/output/brep-export.md +0 -87
- package/dist-skill/docs/API/output/dimensions.md +0 -67
- package/dist-skill/docs/API/output/export.md +0 -110
- package/dist-skill/docs/API/output/gcode.md +0 -195
- package/dist-skill/docs/API/runtime/viewport.md +0 -420
- package/dist-skill/docs/API/sheet-metal/sheet-metal.md +0 -185
- package/dist-skill/docs/API/sketch/anchor.md +0 -37
- package/dist-skill/docs/API/sketch/booleans.md +0 -91
- package/dist-skill/docs/API/sketch/core.md +0 -73
- package/dist-skill/docs/API/sketch/extrude.md +0 -62
- package/dist-skill/docs/API/sketch/on-face.md +0 -104
- package/dist-skill/docs/API/sketch/operations.md +0 -78
- package/dist-skill/docs/API/sketch/path.md +0 -75
- package/dist-skill/docs/API/sketch/primitives.md +0 -146
- package/dist-skill/docs/API/sketch/regions.md +0 -80
- package/dist-skill/docs/API/sketch/text.md +0 -108
- package/dist-skill/docs/API/sketch/transforms.md +0 -65
- package/dist-skill/docs/API/toolbox/fasteners.md +0 -129
- package/dist-skill/docs/INDEX.md +0 -94
- package/dist-skill/docs/RELEASING.md +0 -55
- package/dist-skill/docs/cli-monetization.md +0 -111
- package/dist-skill/docs/deployment.md +0 -281
- package/dist-skill/docs/generated/concepts.md +0 -2112
- package/dist-skill/docs/internals/shape-from-slices.md +0 -152
- package/dist-skill/docs/platform/admin.md +0 -45
- package/dist-skill/docs/platform/architecture.md +0 -79
- package/dist-skill/docs/platform/auth.md +0 -110
- package/dist-skill/docs/platform/email.md +0 -67
- package/dist-skill/docs/platform/projects.md +0 -111
- package/dist-skill/docs/platform/sharing.md +0 -90
- package/dist-skill/docs/runbook.md +0 -345
package/dist/docs-raw/CLI.md
CHANGED
|
@@ -1,865 +1,488 @@
|
|
|
1
1
|
---
|
|
2
2
|
skill-group: cli
|
|
3
3
|
skill-order: 1
|
|
4
|
-
skill-tiers: [standard]
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
# ForgeCAD CLI
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
Run, export, render, and publish `.forge.js` models from your terminal. Everything stays in code.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
**Browser** imports via `src/forge/index.ts` → re-exports from `headless.ts`.
|
|
14
|
-
**CLI tools** import directly from `src/forge/headless.ts`.
|
|
15
|
-
|
|
16
|
-
The key function is `runScript(code, fileName, allFiles)` — it wraps user code in a `Function()` sandbox with the entire forge API injected, and transpiles project files so standard JS `import` / `export` / `require(...)` work for shared utility modules. CLI scripts just call `init()` + `runScript()` and work with the results.
|
|
17
|
-
|
|
18
|
-
## When to use what
|
|
19
|
-
|
|
20
|
-
ForgeCAD has two overlapping interfaces. Use the right one for each context.
|
|
21
|
-
|
|
22
|
-
| Context | Use | Avoid |
|
|
23
|
-
|---------|-----|-------|
|
|
24
|
-
| **Using ForgeCAD as a tool** | `forgecad *` commands | `npm run *` |
|
|
25
|
-
| **Developing ForgeCAD itself** | `npm run dev` (live reload), `npm run build` (prod) | — |
|
|
26
|
-
| **CI / publishing** | `npm run build && npm run test` | forgecad CLI (not installed in CI) |
|
|
27
|
-
| **AI agents in this repo** | `forgecad *` commands only | `npm run build`, `npm run build:cli` |
|
|
28
|
-
|
|
29
|
-
The CLI is always available after `npm install` — no explicit build step needed.
|
|
30
|
-
|
|
31
|
-
### Dev server vs production server
|
|
32
|
-
|
|
33
|
-
| Command | What it does | Requires |
|
|
34
|
-
|---------|-------------|---------|
|
|
35
|
-
| `forgecad dev [path]` | Vite dev server, live reload | nothing beyond `npm install` |
|
|
36
|
-
| `forgecad studio [path]` | Fast static server for the production build | `dist/` built via `npm run build` |
|
|
37
|
-
| `npm run dev` | Same as `forgecad dev` — standard JS project entry point | nothing |
|
|
38
|
-
|
|
39
|
-
Use `forgecad dev` during active development of forge scripts. Use `forgecad studio` to verify the production build or serve it to others.
|
|
40
|
-
|
|
41
|
-
## Install
|
|
10
|
+
## Quick Start
|
|
42
11
|
|
|
43
12
|
```bash
|
|
13
|
+
# 1. Install
|
|
44
14
|
npm install -g forgecad
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
For developers working on ForgeCAD itself:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npm install
|
|
51
|
-
npm link
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
The npm package ships a minified JS bundle (`cli.js`) — no source maps. A compiled native binary build script exists (`npm run build:binary`) for future Homebrew distribution but is not the primary channel.
|
|
55
|
-
|
|
56
|
-
## Licensing
|
|
57
|
-
|
|
58
|
-
Some commands require a ForgeCAD Pro license. Free-tier commands work without any key.
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
forgecad license # Show current license status
|
|
62
|
-
forgecad license activate <key> # Activate a license key
|
|
63
|
-
forgecad license deactivate # Remove license from this machine
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
| Tier | What's included |
|
|
67
|
-
|------|----------------|
|
|
68
|
-
| **Free** | dev, studio, run, render, export stl/3mf/svg, all checks, debug |
|
|
69
|
-
| **Pro** | export step/brep, render-hq, capture gif/mp4, gcode, report, cutting-layout, sdf, urdf, sketch-pdf |
|
|
70
|
-
|
|
71
|
-
Pro commands show a `[Pro]` badge in `forgecad help` and display a clear upgrade message when invoked without a license.
|
|
72
|
-
|
|
73
|
-
See [cli-monetization.md](project/cli-monetization.md) for the full monetization strategy.
|
|
74
|
-
|
|
75
|
-
### Shell Autocomplete
|
|
76
|
-
|
|
77
|
-
ForgeCAD now ships shell completion scripts in the usual modern-tool style:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
forgecad completion bash
|
|
81
|
-
forgecad completion zsh
|
|
82
|
-
forgecad completion fish
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Quick install:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
# bash
|
|
89
|
-
echo 'source <(forgecad completion bash)' >> ~/.bashrc
|
|
90
|
-
|
|
91
|
-
# zsh
|
|
92
|
-
mkdir -p ~/.zsh/completions
|
|
93
|
-
forgecad completion zsh > ~/.zsh/completions/_forgecad
|
|
94
|
-
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
|
|
95
|
-
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
|
|
96
|
-
|
|
97
|
-
# fish
|
|
98
|
-
mkdir -p ~/.config/fish/completions
|
|
99
|
-
forgecad completion fish > ~/.config/fish/completions/forgecad.fish
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The completions are contextual:
|
|
103
|
-
|
|
104
|
-
- nested subcommands such as `forgecad notebook view` and `forgecad export step`
|
|
105
|
-
- command-specific flags and common enum values
|
|
106
|
-
- ForgeCAD file suggestions where a command expects `.forge.js` or `.forge-notebook.json`
|
|
107
|
-
|
|
108
|
-
## Available Commands
|
|
109
|
-
|
|
110
|
-
### Authentication & Account
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
forgecad login # Interactive email/password login
|
|
114
|
-
forgecad login --server http://localhost:5174 # Login to local dev server
|
|
115
|
-
forgecad logout # Clear stored credentials
|
|
116
|
-
forgecad whoami # Show user, server, and license status
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Credentials are stored in `~/.forgecad/auth.json`.
|
|
120
|
-
|
|
121
|
-
### Project Management
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
# Create and sync
|
|
125
|
-
forgecad project init "My Project" # Create on server + link current directory
|
|
126
|
-
forgecad project init "My Project" --slug my-project --visibility public
|
|
127
|
-
forgecad project clone my-project # Download into ./my-project/
|
|
128
|
-
forgecad project push [--force] # Upload local changes
|
|
129
|
-
forgecad project pull [--force] # Download remote changes
|
|
130
|
-
forgecad project status # Show local vs remote diff
|
|
131
|
-
|
|
132
|
-
# Inspect and modify
|
|
133
|
-
forgecad project list # List all your projects
|
|
134
|
-
forgecad project info # Show current project details (name, visibility, files, URL)
|
|
135
|
-
forgecad project rename "New Name" # Rename the project
|
|
136
|
-
forgecad project set-visibility public # Change visibility (private|shared|public)
|
|
137
|
-
forgecad project delete [--force] # Permanently delete project and all files
|
|
138
|
-
forgecad project open # Open in browser
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Projects are stored on forgecad.io. Local projects are linked to their remote counterpart via `forgecad.json`.
|
|
142
|
-
|
|
143
|
-
### File Management (Remote)
|
|
144
|
-
|
|
145
|
-
Operate directly on remote project files without the push/pull cycle:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
forgecad file list [path] # List remote files (optional path prefix filter)
|
|
149
|
-
forgecad file read <path> # Print file contents to stdout
|
|
150
|
-
forgecad file save <path> # Upload local file to remote (same relative path)
|
|
151
|
-
forgecad file save <path> --content "code here" # Save inline content
|
|
152
|
-
cat model.forge.js | forgecad file save model.forge.js --stdin # Pipe content from stdin
|
|
153
|
-
forgecad file delete <path> [--force] # Delete remote file
|
|
154
|
-
forgecad file rename <old> <new> # Rename or move a remote file
|
|
155
|
-
forgecad file mkdir <path> # Create a remote directory
|
|
156
|
-
forgecad file copy <source-slug> <path> [--dest <dest-path>] # Copy from another project
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
These commands require the current directory to be an initialized ForgeCAD project (has `forgecad.json`).
|
|
160
|
-
|
|
161
|
-
### Member Management
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
forgecad project members # List project members
|
|
165
|
-
forgecad project add-member alice@example.com # Add as editor (default)
|
|
166
|
-
forgecad project add-member bob@example.com --role viewer
|
|
167
|
-
forgecad project remove-member alice@example.com
|
|
168
|
-
forgecad project set-role bob@example.com editor
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Roles: **owner** (full control, manage members), **editor** (read/write files), **viewer** (read-only).
|
|
172
15
|
|
|
173
|
-
|
|
16
|
+
# 2. Create a model
|
|
17
|
+
forgecad new cup
|
|
174
18
|
|
|
175
|
-
|
|
176
|
-
forgecad
|
|
177
|
-
forgecad publish model.forge.js --no-sync # Publish without auto-pushing project
|
|
178
|
-
forgecad shares list # List all published models with URLs
|
|
179
|
-
forgecad shares delete <share-id> [--force] # Unpublish a shared model
|
|
180
|
-
forgecad link <gist-url-or-id> # Generate share link from GitHub Gist
|
|
181
|
-
```
|
|
19
|
+
# 3. Run it
|
|
20
|
+
forgecad run cup.forge.js
|
|
182
21
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
### New File from Template
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
forgecad new mypart # Part template (default)
|
|
189
|
-
forgecad new bracket --template sketch # Constrained sketch template
|
|
190
|
-
forgecad new robot --template assembly # Multi-part assembly template
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Studio & Dev Server
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Development — Vite dev server, live reload, no build needed
|
|
22
|
+
# 4. Open the editor (live reload)
|
|
197
23
|
forgecad dev
|
|
198
|
-
forgecad dev ~/cad/gearbox
|
|
199
|
-
forgecad dev --blank --port 4173
|
|
200
|
-
|
|
201
|
-
# Production — static server, requires dist/ (npm run build)
|
|
202
|
-
forgecad studio
|
|
203
|
-
forgecad studio ~/cad/gearbox
|
|
204
|
-
forgecad studio --blank --port 4173
|
|
205
24
|
|
|
206
|
-
#
|
|
207
|
-
forgecad
|
|
208
|
-
forgecad web --open
|
|
25
|
+
# 5. Export
|
|
26
|
+
forgecad export stl cup.forge.js
|
|
209
27
|
```
|
|
210
28
|
|
|
211
|
-
|
|
212
|
-
- `--blank` — open without any project folder
|
|
213
|
-
- `--port <n>` — bind to a specific port (default: 5173)
|
|
214
|
-
- `--host [host]` — expose on the network
|
|
215
|
-
- `--open` — open a browser tab automatically
|
|
216
|
-
- `--strict-port` — fail if the port is already in use
|
|
29
|
+
## Editor
|
|
217
30
|
|
|
218
|
-
|
|
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.
|
|
219
32
|
|
|
220
|
-
|
|
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`. |
|
|
221
39
|
|
|
222
|
-
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Common flags for dev / studio</summary>
|
|
223
42
|
|
|
224
|
-
|
|
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 |
|
|
225
50
|
|
|
226
|
-
|
|
51
|
+
</details>
|
|
227
52
|
|
|
228
|
-
|
|
229
|
-
forgecad notebook examples/demo.forge-notebook.json --code "show(box(40, 20, 10));"
|
|
230
|
-
```
|
|
53
|
+
## Run & Render
|
|
231
54
|
|
|
232
|
-
|
|
55
|
+
Execute scripts and produce images headless — no browser window. Renders use Chrome under the hood.
|
|
233
56
|
|
|
234
|
-
|
|
57
|
+
### `forgecad run`
|
|
235
58
|
|
|
236
|
-
|
|
237
|
-
cat /tmp/cell.js | forgecad notebook examples/demo.forge-notebook.json
|
|
238
|
-
```
|
|
59
|
+
Execute a Forge script and print full geometry diagnostics — object summary, collision detection, spatial analysis, verification results, and solver profiling.
|
|
239
60
|
|
|
240
|
-
|
|
61
|
+
The primary validation command. Runs your script with the real geometry kernel (no browser needed) and prints a comprehensive report:
|
|
241
62
|
|
|
242
|
-
|
|
243
|
-
forgecad notebook examples/demo.forge-notebook.json
|
|
244
|
-
forgecad notebook run examples/demo.forge-notebook.json <cell-id>
|
|
245
|
-
```
|
|
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.
|
|
246
64
|
|
|
247
|
-
|
|
65
|
+
**Construction history** — shows the build sequence for each shape (primitives, operations, modifications) so you can verify the modeling intent.
|
|
248
66
|
|
|
249
|
-
|
|
250
|
-
forgecad notebook view examples/demo.forge-notebook.json
|
|
251
|
-
forgecad notebook view examples/demo.forge-notebook.json preview
|
|
252
|
-
forgecad notebook view examples/demo.forge-notebook.json 2
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
`view` is local-only. It parses the notebook JSON and renders notebook metadata, numbered source lines, and stored outputs for each cell. The optional selector accepts a 1-based cell number, an exact cell id, or `preview`.
|
|
67
|
+
**Feature summary** — tallies geometry features across all objects (e.g. `3 extrude, 2 fillet, 1 chamfer`).
|
|
256
68
|
|
|
257
|
-
|
|
69
|
+
**Verification results** — runs any `verify.*` checks in the script and reports pass/fail with expected vs actual values.
|
|
258
70
|
|
|
259
|
-
|
|
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³:
|
|
260
72
|
|
|
261
|
-
```bash
|
|
262
|
-
forgecad notebook export examples/demo.forge-notebook.json
|
|
263
|
-
forgecad notebook export examples/demo.forge-notebook.json out/demo-from-notebook.forge.js
|
|
264
73
|
```
|
|
265
|
-
|
|
266
|
-
If you already have a Forge server running, point the CLI at it:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
forgecad notebook examples/demo.forge-notebook.json --server http://localhost:5173 --code "show(box(40, 20, 10));"
|
|
74
|
+
⚠ COLLISION: bolt ∩ base (shared vol: 42.3mm³)
|
|
270
75
|
```
|
|
271
76
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
Notebook cell behavior:
|
|
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.
|
|
275
78
|
|
|
276
|
-
|
|
277
|
-
- `show(value)` pins the geometry that should stay visible in the viewport
|
|
278
|
-
- A trailing expression is also treated as the cell value
|
|
279
|
-
- Cell outputs are written back into the notebook JSON, similar to Jupyter
|
|
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)`.
|
|
280
80
|
|
|
281
|
-
|
|
81
|
+
**Parameters** — lists all declared parameters with their current values. Overridden values are marked with `*`.
|
|
282
82
|
|
|
283
|
-
|
|
83
|
+
**Solver profiling** — when constraint solving occurs, shows timing breakdown (clone, solve, redundancy detection, surface building) and solver internals.
|
|
284
84
|
|
|
285
85
|
```bash
|
|
286
86
|
forgecad run examples/cup.forge.js
|
|
287
|
-
forgecad run examples/
|
|
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
|
|
288
91
|
forgecad run examples/cup.forge.js --debug-imports
|
|
289
|
-
forgecad run examples/cup.forge.js
|
|
290
|
-
forgecad run examples/cup.forge.js --param "Show Lid=0"
|
|
291
|
-
forgecad run examples/cup.forge.js --param "Pan Style=wok"
|
|
92
|
+
forgecad run examples/cup.forge.js -p "Wall Thickness=3" -p "Body Height=200"
|
|
292
93
|
forgecad run examples/constraints/06-complex-spectrogram.forge.js --solver-debug-out tmp/spectrogram-debug
|
|
293
94
|
```
|
|
294
95
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
`--param "Key=Value"` overrides script parameters for that run. It supports:
|
|
298
|
-
|
|
299
|
-
- numeric `param()` values such as `"Wall Thickness=3"`
|
|
300
|
-
- boolean `boolParam()` values using `1` or `0`
|
|
301
|
-
- string `choiceParam()` values using the displayed label, such as `"Pan Style=wok"`
|
|
302
|
-
|
|
303
|
-
`--debug-imports` adds an import trace (source file, target file, overrides, return type, success/error phase), useful when debugging `require()` import behavior.
|
|
304
|
-
|
|
305
|
-
`--solver-debug-out <dir>` enables the Rust planner's constructive transcript and SVG snapshots for every solved sketch in that run, then writes a reusable artifact bundle to disk:
|
|
306
|
-
|
|
307
|
-
- `README.md` summary at the output root
|
|
308
|
-
- one subdirectory per sketch
|
|
309
|
-
- `constructive-transcript.md` with the step-by-step planner story
|
|
310
|
-
- `svg/*.svg` snapshots keyed to transcript steps
|
|
311
|
-
|
|
312
|
-
### SVG Export (no browser needed)
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
forgecad export svg examples/constraints/01-fully-constrained-rect.forge.js [output.svg]
|
|
316
|
-
```
|
|
96
|
+
### `forgecad render`
|
|
317
97
|
|
|
318
|
-
|
|
98
|
+
Render a Forge scene. Use a subcommand — `3d`, `section`, `wireframe`, `sketch`, or `hq`.
|
|
319
99
|
|
|
320
|
-
|
|
100
|
+
`forgecad render` is a group of rendering subcommands. Pick one based on what you want:
|
|
321
101
|
|
|
322
|
-
|
|
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
|
|
323
107
|
|
|
324
108
|
```bash
|
|
325
|
-
forgecad
|
|
326
|
-
forgecad
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
forgecad export step examples/api/brep-exportable.forge.js --output out/demo.step
|
|
330
|
-
forgecad export step examples/api/brep-exportable.forge.js --python 3.11
|
|
331
|
-
forgecad export step examples/api/brep-exportable.forge.js --uv /custom/path/to/uv
|
|
332
|
-
forgecad export step examples/chess-set.forge.js --allow-faceted
|
|
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
|
|
333
113
|
```
|
|
334
114
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
By default this exporter is exact-subset only. It does **not** silently convert arbitrary triangle meshes back into fake BREP. Instead, Forge lowers compile-covered geometry into the `cadquery-occt` compiler target and exports that exact subset through CadQuery/OpenCascade.
|
|
338
|
-
|
|
339
|
-
If you pass `--allow-faceted`, unsupported closed mesh solids are exported as explicit faceted OCCT solids. This keeps mesh-heavy designs exportable to STEP/BREP, but that fallback is tessellation-driven rather than exact replay.
|
|
340
|
-
|
|
341
|
-
The maintained feature matrix lives in [`docs/permanent/API/output/brep-export.md`](API/output/brep-export.md).
|
|
115
|
+
### `forgecad render 3d`
|
|
342
116
|
|
|
343
|
-
|
|
117
|
+
Render a Forge scene to PNG using the real viewport renderer.
|
|
344
118
|
|
|
345
|
-
|
|
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.
|
|
346
120
|
|
|
347
|
-
|
|
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.
|
|
348
122
|
|
|
349
|
-
|
|
350
|
-
uv run scripts/brep/matrix.py --format step examples
|
|
351
|
-
uv run scripts/brep/matrix.py --format brep examples
|
|
352
|
-
uv run scripts/brep/rerun_failures.py tmp/brep-matrix-step-20260306T120000Z.json
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
These scripts use the repo-local `.venv-brep/.venv/bin/python` by default, run exports through a bounded parallel worker pool, and write JSON reports under `tmp/`.
|
|
123
|
+
Use `--edges=<off|thin|bold>` to control the edge overlay. For a pure wireframe look, use `render wireframe` instead.
|
|
356
124
|
|
|
357
|
-
|
|
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.
|
|
358
126
|
|
|
359
127
|
```bash
|
|
360
|
-
forgecad
|
|
361
|
-
forgecad
|
|
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
|
|
362
136
|
```
|
|
363
137
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
This is a **toolpath scripting API**, not a slicer. You define print movements directly in code — enabling parametric vases, mathematical surfaces, non-planar paths, and other geometries that conventional slicers cannot produce.
|
|
367
|
-
|
|
368
|
-
**How it works:** Initializes the forge kernel, runs the script, extracts the `GCodeBuilder` result, and writes the generated G-code text to disk. Prints segment count, estimated time, filament usage, and bounding box.
|
|
138
|
+
### `forgecad render wireframe`
|
|
369
139
|
|
|
370
|
-
|
|
371
|
-
- `--output <path>` / `-o <path>` — Output file path (default: replaces `.forge.js` with `.gcode`)
|
|
140
|
+
Render a Forge scene as a wireframe (edges only, no shading).
|
|
372
141
|
|
|
373
|
-
|
|
374
|
-
- `examples/gcode/parametric-vase.forge.js` — Sine-wave modulated continuous spiral vase
|
|
375
|
-
- `examples/gcode/spiral-tower.forge.js` — Twisted hexagonal polygon tower
|
|
376
|
-
- `examples/gcode/math-surface.forge.js` — Non-planar bowl with wave rim
|
|
377
|
-
- `examples/gcode/lissajous-vase.forge.js` — Lissajous curve vase with morphing profile
|
|
378
|
-
|
|
379
|
-
Preview these scripts in ForgeCAD's interactive viewport. The current `forgecad render` CLI expects shape outputs and does not render `GCodeBuilder` scenes yet.
|
|
380
|
-
|
|
381
|
-
See [`docs/permanent/API/output/gcode.md`](API/output/gcode.md) for the dedicated G-code mode guide and full `GCodeBuilder` API reference.
|
|
382
|
-
|
|
383
|
-
### SDF Robot Export (Gazebo package)
|
|
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.
|
|
384
143
|
|
|
385
144
|
```bash
|
|
386
|
-
forgecad
|
|
387
|
-
|
|
388
|
-
# Optional output directory:
|
|
389
|
-
forgecad export sdf examples/api/sdf-rover-demo.forge.js --output out/forge_scout
|
|
145
|
+
forgecad render wireframe examples/cup.forge.js
|
|
146
|
+
forgecad render wireframe examples/cup.forge.js --camera iso
|
|
390
147
|
```
|
|
391
148
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
- `models/<model-name>/model.sdf`
|
|
395
|
-
- `models/<model-name>/model.config`
|
|
396
|
-
- `models/<model-name>/meshes/*.stl`
|
|
397
|
-
- `worlds/<world-name>.sdf` when the script requests a demo world
|
|
398
|
-
- `manifest.json` with topic names, link/joint mappings, and exporter warnings
|
|
149
|
+
### `forgecad render hq` **\[Pro\]**
|
|
399
150
|
|
|
400
|
-
|
|
151
|
+
High-quality render via Blender Cycles — path-traced, HDRI, material presets.
|
|
401
152
|
|
|
402
|
-
|
|
153
|
+
Exports the scene to Blender and renders with Cycles (path tracer). Requires Blender installed and on PATH.
|
|
403
154
|
|
|
404
|
-
-
|
|
405
|
-
- server-side `TriggeredPublisher` bindings that map arrow keys to the diff-drive `cmd_vel` topic
|
|
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).
|
|
406
156
|
|
|
407
|
-
|
|
157
|
+
Output defaults to `<script-name>-hq.png`. Great for documentation, marketing renders, and social media.
|
|
408
158
|
|
|
409
159
|
```bash
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
# Terminal 2: GUI client using the same world layout
|
|
416
|
-
gz sim -g out/forge_scout/worlds/forge_scout_trial.sdf
|
|
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
|
|
417
164
|
```
|
|
418
165
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
- On macOS, use the split `-s` / `-g` flow above. `gz sim <world.sdf>` is not supported there.
|
|
422
|
-
- Click the 3D view so it has keyboard focus, then use `W` / `X` for forward / reverse, `A` / `D` to rotate, `Q` / `E` / `Z` / `C` for diagonals, and `S` or `Space` to stop.
|
|
423
|
-
- For older exports created before the GUI plugin was added, load `Key Publisher` manually from the Gazebo GUI plugins menu.
|
|
424
|
-
|
|
425
|
-
Current behavior:
|
|
426
|
-
|
|
427
|
-
- Per-link geometry is exported as STL mesh assets
|
|
428
|
-
- Collision geometry reuses the same mesh unless `collision: 'none'` is set on a link
|
|
429
|
-
- Link mass comes from `massKg`, else `densityKgM3 * volume`, else a default density
|
|
430
|
-
- Inertia is an approximate box fit based on link bounds
|
|
431
|
-
- Coupled joints are currently rejected
|
|
432
|
-
- Parts without geometry are currently rejected
|
|
433
|
-
|
|
434
|
-
### PNG Render (requires Chrome)
|
|
435
|
-
|
|
436
|
-
```bash
|
|
437
|
-
forgecad render examples/cup.forge.js [output.png]
|
|
438
|
-
forgecad render examples/api/notebook-iteration.forge-notebook.json [output.png]
|
|
439
|
-
forgecad render examples/cup.forge.js out/scene.png --scene '{"camera":{"projectionMode":"perspective","position":[200,-160,120],"target":[0,0,20],"up":[0,0,1]},"objects":{"obj-2":{"visible":false},"obj-3":{"opacity":0.35}}}'
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
Renders 3D shapes to PNG images from multiple camera angles. Uses Puppeteer to launch headless Chrome with WebGL for Three.js rendering.
|
|
443
|
-
|
|
444
|
-
When the input is a notebook, `forgecad render` renders the notebook's preview cell.
|
|
445
|
-
|
|
446
|
-
**How it works:**
|
|
447
|
-
1. `cli/forge-render.mjs` — Node launcher script. Auto-starts Vite dev server if not running, launches Puppeteer.
|
|
448
|
-
2. `cli/render.html` + `cli/render.ts` — Loaded in the browser by Puppeteer. Imports from `src/forge/headless.ts`, runs the script, builds a Three.js scene, renders from multiple angles.
|
|
449
|
-
3. Screenshots are captured as base64 PNG and saved to disk.
|
|
450
|
-
|
|
451
|
-
**Environment variables:**
|
|
452
|
-
|
|
453
|
-
| Variable | Default | Description |
|
|
454
|
-
|----------|---------|-------------|
|
|
455
|
-
| `FORGE_ANGLES` | `front,side,top,iso` | Camera angles to render |
|
|
456
|
-
| `FORGE_SIZE` | `1024` | Image size in pixels |
|
|
457
|
-
| `FORGE_PORT` | `5173` | Vite dev server port |
|
|
458
|
-
| `CHROME_PATH` | Auto-detected | Chrome/Chromium executable path |
|
|
166
|
+
### `forgecad capture gif|mp4` **\[Pro\]**
|
|
459
167
|
|
|
460
|
-
|
|
461
|
-
- `--angles <front,side,top,iso>` — standard angles to render
|
|
462
|
-
- `--size <px>` — output size override
|
|
463
|
-
- `--port <n>` — Vite port override
|
|
464
|
-
- `--camera <spec>` — exact camera pose, e.g. `proj=perspective;pos=120,80,120;target=0,0,0;up=0,0,1`
|
|
465
|
-
- `--scene <json>` — full scene state copied from the viewport, including camera plus object visibility/opacity/color overrides
|
|
466
|
-
- `--background <color>` — background override
|
|
467
|
-
- `--chrome-path <path>` — Chrome executable path override
|
|
168
|
+
Animated orbit or joint playback.
|
|
468
169
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
### Animated Capture (GIF or MP4, requires Chrome)
|
|
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.
|
|
472
171
|
|
|
473
172
|
```bash
|
|
474
|
-
forgecad capture gif examples/cup.forge.js
|
|
475
|
-
forgecad capture mp4 examples/cup.forge.js [output.mp4]
|
|
476
|
-
forgecad capture gif examples/api/notebook-assembly-debug.forge-notebook.json --list
|
|
477
|
-
forgecad capture mp4 examples/api/runtime-joints-view.forge.js out/step.mp4 --capture animation --animation Step
|
|
173
|
+
forgecad capture gif examples/cup.forge.js
|
|
478
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
|
|
479
177
|
```
|
|
480
178
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
-
|
|
536
|
-
-
|
|
537
|
-
-
|
|
538
|
-
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
```bash
|
|
547
|
-
forgecad export report examples/cup.forge.js [output.pdf]
|
|
548
|
-
forgecad export report examples/cup.forge.js [output.pdf] --dim-angle-tol 18
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
Generates a searchable-text PDF report with multiple projected drawing views:
|
|
552
|
-
- Bill of Materials page (auto-summed from script `bom()` entries)
|
|
553
|
-
- Combined model page (front/right/top/isometric)
|
|
554
|
-
- Disassembled component pages (same view set per unique component geometry; repeated identical items collapse into one page)
|
|
555
|
-
- Auto-generated detail continuation pages for elongated/high-detail views (separate pages, not overlayed)
|
|
556
|
-
- `dim()` annotations included per view only when their axis aligns with that view's projection plane axes
|
|
557
|
-
|
|
558
|
-
BOM aggregation rules:
|
|
559
|
-
- Each `bom(quantity, description, { unit })` call contributes one raw entry
|
|
560
|
-
- Report export groups by `key` (if provided) else by normalized `description + unit`
|
|
561
|
-
- Quantities are summed per group and rendered as line items in the BOM table
|
|
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 |
|
|
562
244
|
|
|
563
|
-
|
|
564
|
-
- Preferred: explicit binding via `dim(..., { component: \"Part Name\" })`
|
|
565
|
-
- Imported-part ownership: `dim(..., { currentComponent: true })` to pin to the owning returned component instance (no bbox heuristic)
|
|
566
|
-
- Other-component ownership: `dim(..., { component: \"Tabletop\" })`
|
|
567
|
-
- If multiple owners are bound (e.g. `currentComponent: true` plus another component), it is treated as shared and stays on the overview page
|
|
568
|
-
- Fallback: automatic ownership only when both dimension endpoints are unambiguously inside exactly one returned component bounding box
|
|
569
|
-
- Ambiguous dimensions are intentionally skipped for disassembled pages
|
|
245
|
+
</details>
|
|
570
246
|
|
|
571
|
-
|
|
572
|
-
- `--dim-angle-tol <degrees>`: include dimensions whose projected direction is within this many degrees of the nearest view axis (default: `12`)
|
|
247
|
+
## Export
|
|
573
248
|
|
|
574
|
-
|
|
249
|
+
Export to every format you need. Free-tier formats work out of the box.
|
|
575
250
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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. |
|
|
579
265
|
|
|
580
266
|
```bash
|
|
581
|
-
|
|
582
|
-
|
|
267
|
+
# 3D printing
|
|
268
|
+
forgecad export stl bracket.forge.js
|
|
269
|
+
forgecad export 3mf bracket.forge.js --quality high
|
|
583
270
|
|
|
584
|
-
|
|
271
|
+
# CAD interchange
|
|
272
|
+
forgecad export step bracket.forge.js
|
|
273
|
+
forgecad export step bracket.forge.js --allow-faceted
|
|
585
274
|
|
|
586
|
-
|
|
587
|
-
|
|
275
|
+
# Technical drawings
|
|
276
|
+
forgecad export report bracket.forge.js out/report.pdf
|
|
588
277
|
|
|
589
|
-
|
|
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"
|
|
590
309
|
```
|
|
591
|
-
✓ Baseline: 6 objects, 12 params
|
|
592
|
-
✓ Checked 91 parameter samples (8 per param)
|
|
593
310
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
Parameter "Bottom Left Door":
|
|
597
|
-
💥 New collision at values: -120.0, -102.9
|
|
598
|
-
Bottom Left Door ∩ Frame (shared vol: 2561.9mm³)
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
### Transform/Assembly Invariant Check
|
|
311
|
+
### Sync
|
|
602
312
|
|
|
603
313
|
```bash
|
|
604
|
-
forgecad
|
|
314
|
+
forgecad project push # Upload local changes
|
|
315
|
+
forgecad project pull # Download remote changes
|
|
316
|
+
forgecad project status # See what's different
|
|
605
317
|
```
|
|
606
318
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
### Compiler Snapshot Check
|
|
319
|
+
### Publish
|
|
610
320
|
|
|
611
321
|
```bash
|
|
612
|
-
forgecad
|
|
613
|
-
forgecad check compiler --case segmented-runtime-hints
|
|
614
|
-
forgecad check compiler --update
|
|
322
|
+
forgecad publish adapter.forge.js --title "AMS Lite Adapter"
|
|
615
323
|
```
|
|
616
324
|
|
|
617
|
-
|
|
618
|
-
This is a unit-style invariant check, not just a debugger convenience.
|
|
619
|
-
The ordinary multi-feature part corpus lives in [`examples/compiler-corpus/README.md`](../../examples/compiler-corpus/README.md).
|
|
620
|
-
|
|
621
|
-
Each snapshot records:
|
|
622
|
-
- Forge compile plans
|
|
623
|
-
- CadQuery/OCCT lowerings
|
|
624
|
-
- export routing decisions
|
|
625
|
-
- quantized runtime Manifold mesh summaries
|
|
626
|
-
- quantized compiler-lowered Manifold mesh summaries
|
|
325
|
+
Shares are live references — always the current version, not a snapshot.
|
|
627
326
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
- export manifests drift away from the per-object compiler routing decisions
|
|
631
|
-
- exact/faceted support claims stop matching the lowered artifacts and diagnostics
|
|
327
|
+
<details>
|
|
328
|
+
<summary>All project commands</summary>
|
|
632
329
|
|
|
633
|
-
|
|
330
|
+
**Authentication**
|
|
634
331
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
Runs focused topology-rewrite query-propagation snapshots without dumping the
|
|
641
|
-
entire compiler scene. This keeps supported, ambiguous, and intentionally
|
|
642
|
-
unsupported rewrite semantics reviewable as the propagation layer evolves.
|
|
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. |
|
|
643
337
|
|
|
644
|
-
|
|
645
|
-
- the propagated shape objects that actually carry topology-rewrite metadata
|
|
646
|
-
- exact versus faceted routing outcomes for those objects
|
|
647
|
-
- deterministic rewrite-operation ordering
|
|
648
|
-
- preserved and created query summaries
|
|
649
|
-
- explicit ambiguity/unsupported diagnostic codes
|
|
338
|
+
**Projects**
|
|
650
339
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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. |
|
|
655
353
|
|
|
656
|
-
|
|
354
|
+
**Members**
|
|
657
355
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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. |
|
|
663
362
|
|
|
664
|
-
|
|
363
|
+
**Files (remote)**
|
|
665
364
|
|
|
666
|
-
|
|
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. |
|
|
667
374
|
|
|
668
|
-
|
|
669
|
-
- `.forge-notebook.json`
|
|
375
|
+
**Shares**
|
|
670
376
|
|
|
671
|
-
|
|
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. |
|
|
672
382
|
|
|
673
|
-
|
|
674
|
-
- a checked manifest entry points at a missing file
|
|
675
|
-
- an example's assigned validation path fails
|
|
676
|
-
- a `part` example's declared route expectation no longer matches the compiler report
|
|
383
|
+
**API Tokens**
|
|
677
384
|
|
|
678
|
-
|
|
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. |
|
|
679
390
|
|
|
680
|
-
|
|
681
|
-
- `assembly`: runtime solve + scene emission, not exact-route parity
|
|
682
|
-
- `runtime-scene`: viewport/report/runtime examples that still need to execute successfully
|
|
683
|
-
- `sketch`: sketch payload validation via the sketch export path
|
|
684
|
-
- `notebook`: preview-cell validation for `.forge-notebook.json`
|
|
685
|
-
- `experimental`: temporary fenced examples that still have to run
|
|
391
|
+
**Scaffolding**
|
|
686
392
|
|
|
687
|
-
|
|
393
|
+
| Command | Description |
|
|
394
|
+
|---------|-------------|
|
|
395
|
+
| `new` | Create a new .forge.js file from a template. |
|
|
688
396
|
|
|
689
|
-
|
|
690
|
-
- `assembly-runtime`: execute and validate solved-scene/assembly-owned runtime behavior
|
|
691
|
-
- `runtime-scene`: execute as a viewport/report/runtime scene without treating it as part-route evidence
|
|
692
|
-
- `sketch-svg`: render returned sketch payloads through the sketch SVG path
|
|
693
|
-
- `notebook-preview`: materialize and execute the notebook preview cell
|
|
694
|
-
- `experimental-runtime`: execute only, while the example stays outside the active architecture claim
|
|
397
|
+
</details>
|
|
695
398
|
|
|
696
|
-
|
|
697
|
-
must remain available to repo checks, such as BOM entries, cut planes,
|
|
698
|
-
`jointsView()` controls, grouped scene structure, or collected
|
|
699
|
-
`robotExport(...)` data.
|
|
399
|
+
## AI Integration
|
|
700
400
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
- `exact`: selected primary shapes must stay on the exact compiler route
|
|
704
|
-
- `faceted`: exact must stay blocked and allow-faceted must succeed with diagnostics
|
|
705
|
-
- `holdout`: runtime-checked, but intentionally outside the exact-route claim because the example still mixes route outcomes or depends on a documented unsupported capability; this is a temporary recovery state and should normally trend back to zero
|
|
706
|
-
|
|
707
|
-
Successful runs also print the current temporary fence list, including each
|
|
708
|
-
remaining `holdout` or `experimental` entry's blocker and follow-up task, so
|
|
709
|
-
the command output can be used directly in a phase-entry review.
|
|
710
|
-
|
|
711
|
-
Use `--family` when a task owns only one manifest lane, and `--example` when you
|
|
712
|
-
want to debug a single checked artifact.
|
|
713
|
-
|
|
714
|
-
### Invariant Test Suite
|
|
401
|
+
ForgeCAD files are plain JavaScript. AI coding agents write and iterate on them directly. The CLI closes the loop.
|
|
715
402
|
|
|
716
403
|
```bash
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
npm run test:examples
|
|
720
|
-
npm run test:compiler
|
|
721
|
-
npm run test:compiler:update
|
|
722
|
-
npm run test:query-propagation
|
|
723
|
-
npm run test:query-propagation:update
|
|
724
|
-
```
|
|
404
|
+
# Give your agent full ForgeCAD API knowledge
|
|
405
|
+
forgecad skill install
|
|
725
406
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
The important entrypoints are:
|
|
729
|
-
- `npm test` runs the repo invariant suite (`transforms`, `dimensions`, `placement`, `js-modules`, `brep`, `compiler`, `query-propagation`, `examples`, `api`)
|
|
730
|
-
- `npm run test:examples` runs the example architecture gate across the checked `examples/` manifest
|
|
731
|
-
- `npm run test:compiler` runs just the compiler snapshot/invariant suite
|
|
732
|
-
- `npm run test:compiler:update` refreshes committed compiler snapshots after an intentional change
|
|
733
|
-
- `npm run test:query-propagation` runs the focused topology-rewrite query-propagation snapshots
|
|
734
|
-
- `npm run test:query-propagation:update` refreshes those query-propagation snapshots after an intentional change
|
|
735
|
-
- `forgecad check suite` is the CLI equivalent of the invariant suite runner
|
|
736
|
-
|
|
737
|
-
### Dimension Propagation Invariant Check
|
|
738
|
-
|
|
739
|
-
```bash
|
|
740
|
-
forgecad check dimensions
|
|
407
|
+
# Or export a single context file for chat UIs (Claude.ai, ChatGPT, ...)
|
|
408
|
+
forgecad skill one-file ~/Desktop/forgecad-context.md
|
|
741
409
|
```
|
|
742
410
|
|
|
743
|
-
|
|
744
|
-
- transform APIs (`translate`, `rotate`, `transform`, `scale`, `mirror`, `rotateAround`)
|
|
745
|
-
- copy/style APIs (`clone`, `color`, `setColor`)
|
|
746
|
-
- boolean APIs (`add/subtract/intersect`, plus `union/difference/intersection`)
|
|
747
|
-
- import runtime path (`require(...).color(...).translate(...)`)
|
|
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.
|
|
748
412
|
|
|
749
|
-
|
|
413
|
+
## Validation
|
|
750
414
|
|
|
751
|
-
|
|
752
|
-
forgecad debug dimensions /path/to/file.forge.js [--all]
|
|
753
|
-
forgecad debug dimensions /path/to/file.forge.js [--all] [--dim-angle-tol 12]
|
|
754
|
-
```
|
|
415
|
+
Test parameter ranges and run invariant suites.
|
|
755
416
|
|
|
756
|
-
|
|
757
|
-
- total object count
|
|
758
|
-
- total dimension count
|
|
759
|
-
- per-view visibility counts (`front/right/top/iso`) using report angle tolerance
|
|
760
|
-
- report ownership routing (`combined` vs `component:<name>`) per dimension
|
|
761
|
-
- per-object approximate dimension ownership (both endpoints inside object bbox)
|
|
762
|
-
- a dimension coordinate list (first 20 by default, `--all` for full dump)
|
|
417
|
+
### `forgecad check params`
|
|
763
418
|
|
|
764
|
-
|
|
419
|
+
Sweep parameter ranges and report runtime failures, degeneracy, and new collisions.
|
|
765
420
|
|
|
766
|
-
|
|
767
|
-
forgecad debug compiler /path/to/file.forge.js
|
|
768
|
-
forgecad debug compiler /path/to/file.forge.js --compact
|
|
769
|
-
```
|
|
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:
|
|
770
422
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
- faceted fallback eligibility
|
|
775
|
-
- runtime Manifold summaries
|
|
776
|
-
- compiler-lowered Manifold summaries
|
|
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
|
|
777
426
|
|
|
778
|
-
|
|
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.
|
|
779
428
|
|
|
780
429
|
```bash
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
uv run cli/forge-prune-local-branches.py --base mainline
|
|
430
|
+
forgecad check params examples/shoe-rack-doors.forge.js
|
|
431
|
+
forgecad check params path/to/model.forge.js --samples 12
|
|
784
432
|
```
|
|
785
433
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
Behavior:
|
|
789
|
-
- Deletes with `git branch -d`, not force-delete
|
|
790
|
-
- Removes linked worktrees first when the branch is checked out in a secondary worktree
|
|
791
|
-
- Requires an explicit `force` choice if one of those linked worktrees is dirty
|
|
792
|
-
- Refuses to touch the current worktree, the primary worktree, or prunable/missing worktree entries
|
|
793
|
-
- `--path` lets you point at any location inside the target repository
|
|
794
|
-
|
|
795
|
-
## Adding New CLI Commands
|
|
796
|
-
|
|
797
|
-
1. Create or extend a module under `cli/`
|
|
798
|
-
2. Import from `../src/forge/headless`
|
|
799
|
-
3. Call `await init()` to load the WASM kernel
|
|
800
|
-
4. Use `runScript(code, fileName, allFiles)` to execute user scripts
|
|
801
|
-
5. Register the new subcommand in `cli/forgecad.ts`
|
|
802
|
-
|
|
803
|
-
### Minimal Example
|
|
804
|
-
|
|
805
|
-
```typescript
|
|
806
|
-
#!/usr/bin/env node
|
|
807
|
-
import { readFileSync } from 'fs';
|
|
808
|
-
import { init, runScript } from '../src/forge/headless';
|
|
809
|
-
|
|
810
|
-
const code = readFileSync(process.argv[2], 'utf-8');
|
|
811
|
-
|
|
812
|
-
await init();
|
|
813
|
-
const result = runScript(code, 'main.forge.js', {});
|
|
814
|
-
|
|
815
|
-
if (result.error) {
|
|
816
|
-
console.error(result.error);
|
|
817
|
-
process.exit(1);
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
for (const obj of result.objects) {
|
|
821
|
-
if (obj.shape) {
|
|
822
|
-
console.log(`${obj.name}: volume=${obj.shape.volume().toFixed(1)}mm³`);
|
|
823
|
-
}
|
|
824
|
-
if (obj.sketch) {
|
|
825
|
-
console.log(`${obj.name}: area=${obj.sketch.area().toFixed(1)}mm²`);
|
|
826
|
-
}
|
|
827
|
-
if (obj.toolpath) {
|
|
828
|
-
console.log(`${obj.name}: ${obj.toolpath.segments.length} G-code segments`);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
```
|
|
434
|
+
<details>
|
|
435
|
+
<summary>All check commands (CI / development)</summary>
|
|
832
436
|
|
|
833
|
-
|
|
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. |
|
|
834
453
|
|
|
835
|
-
|
|
454
|
+
</details>
|
|
836
455
|
|
|
837
|
-
|
|
838
|
-
|
|
456
|
+
<details>
|
|
457
|
+
<summary>Debug commands (ForgeCAD development)</summary>
|
|
839
458
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}
|
|
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. |
|
|
846
464
|
|
|
847
|
-
|
|
848
|
-
```
|
|
465
|
+
</details>
|
|
849
466
|
|
|
850
|
-
|
|
467
|
+
## Setup & Licensing
|
|
851
468
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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
|
|
855
477
|
|
|
856
|
-
|
|
478
|
+
The CLI is free for core workflows. Advanced exports and rendering are Pro.
|
|
857
479
|
|
|
858
|
-
|
|
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` |
|
|
859
483
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
| `three` | 3D rendering (used by render.ts) | Loaded in browser context by Puppeteer |
|
|
484
|
+
```bash
|
|
485
|
+
forgecad license # Check status
|
|
486
|
+
forgecad license activate # Activate Pro
|
|
487
|
+
forgecad license deactivate # Remove license
|
|
488
|
+
```
|