forgecad 0.6.3 → 0.7.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 +2 -11
- package/dist/assets/{AdminPage-CeqCUUgu.js → AdminPage-DAu1C1ST.js} +250 -151
- package/dist/assets/{BlogPage-P_AJP0v9.js → BlogPage-CJEXL_zJ.js} +94 -70
- package/dist/assets/{DocsPage-CKRV2iq2.js → DocsPage-Gc_BCdqC.js} +269 -143
- package/dist/assets/EditorApp-D9bJvtf7.js +11338 -0
- package/dist/assets/{EditorApp-CnC2k4cW.css → EditorApp-DG1-oUSV.css} +459 -87
- package/dist/assets/{EmbedViewer-DBlzmQ5i.js → EmbedViewer-CEO8XbV8.js} +2 -4
- package/dist/assets/LandingPage-CdCuEOdC.js +451 -0
- package/dist/assets/PricingPage-BSrxu6d7.js +232 -0
- package/dist/assets/{SettingsPage-BqCh9JcC.js → SettingsPage-FUCSIRq6.js} +129 -5
- package/dist/assets/{evalWorker-Ql-aKwLA.js → evalWorker-KoR0SNKq.js} +6770 -2914
- package/dist/assets/{index-2hfs_ub0.css → index-CyVd1D4D.css} +227 -53
- package/dist/assets/{Viewport-CoB46f5R.js → index-wTEK39at.js} +31385 -6439
- package/dist/assets/{javascript-DCxGoE5Y.js → javascript-DAl8Gmyo.js} +1 -1
- package/dist/assets/{manifold-CqNMHHKO.js → manifold-B1sGWdYk.js} +4 -3
- package/dist/assets/{manifold-Cce9wRFz.js → manifold-D7o0N50J.js} +1 -1
- package/dist/assets/{manifold-D6BeHIOo.js → manifold-G5sBaXzi.js} +1 -1
- package/dist/assets/{reportWorker-sFEFonXf.js → reportWorker-DYcRHhv9.js} +6798 -3341
- package/dist/assets/{vendor-react-Dt7-aaJH.js → vendor-react-CG3i_wp0.js} +65 -8
- package/dist/docs-raw/generated/assembly.md +691 -112
- package/dist/docs-raw/generated/concepts.md +1225 -1400
- package/dist/docs-raw/generated/core.md +464 -1412
- package/dist/docs-raw/generated/curves.md +593 -117
- package/dist/docs-raw/generated/lib.md +38 -748
- package/dist/docs-raw/generated/output.md +139 -245
- package/dist/docs-raw/generated/sheet-metal.md +473 -21
- package/dist/docs-raw/generated/sketch.md +553 -349
- package/dist/docs-raw/generated/viewport.md +345 -303
- package/dist/docs-raw/generated/wood.md +104 -0
- package/dist/index.html +2 -2
- package/dist/sitemap.xml +6 -6
- package/dist-cli/chunk-PZ5AY32C.js +10 -0
- package/dist-cli/chunk-PZ5AY32C.js.map +1 -0
- package/dist-cli/forgecad.js +9435 -5407
- package/dist-cli/forgecad.js.map +1 -0
- package/dist-cli/solver-FV7TJZGI.js +365 -0
- package/dist-cli/solver-FV7TJZGI.js.map +1 -0
- package/dist-skill/CONTEXT.md +3186 -7145
- package/dist-skill/SKILL-dev.md +21 -63
- package/dist-skill/SKILL.md +12 -56
- package/dist-skill/docs/API/core/concepts.md +16 -98
- package/dist-skill/docs/CLI/export.md +91 -0
- package/dist-skill/docs/CLI/projects.md +107 -0
- package/dist-skill/docs/CLI/studio_publishing.md +52 -0
- package/dist-skill/docs/CLI/validation.md +66 -0
- package/dist-skill/docs/generated/assembly.md +691 -112
- package/dist-skill/docs/generated/core.md +464 -1412
- package/dist-skill/docs/generated/curves.md +593 -117
- package/dist-skill/docs/generated/lib.md +38 -748
- package/dist-skill/docs/generated/output.md +139 -245
- package/dist-skill/docs/generated/sheet-metal.md +473 -21
- package/dist-skill/docs/generated/sketch.md +553 -349
- package/dist-skill/docs/generated/viewport.md +345 -303
- 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/modeling-recipes.md +22 -195
- package/dist-skill/docs/guides/positioning.md +88 -147
- package/dist-skill/docs-dev/API/core/concepts.md +51 -0
- package/dist-skill/docs-dev/API/core/sdf-advanced.md +92 -0
- package/dist-skill/docs-dev/API/core/sdf-primitives.md +58 -0
- package/dist-skill/docs-dev/API/core/sdf-workflow.md +42 -0
- package/dist-skill/docs-dev/CLI/export.md +91 -0
- package/dist-skill/docs-dev/CLI/projects.md +107 -0
- package/dist-skill/docs-dev/CLI/studio_publishing.md +52 -0
- package/dist-skill/docs-dev/CLI/validation.md +66 -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 +1 -3
- package/dist-skill/docs-dev/generated/assembly.md +771 -0
- package/dist-skill/docs-dev/generated/core.md +775 -0
- package/dist-skill/docs-dev/generated/curves.md +688 -0
- package/dist-skill/docs-dev/generated/lib.md +50 -0
- package/dist-skill/docs-dev/generated/output.md +234 -0
- package/dist-skill/docs-dev/generated/sheet-metal.md +506 -0
- package/dist-skill/docs-dev/generated/sketch.md +801 -0
- package/dist-skill/docs-dev/generated/viewport.md +486 -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/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 +5 -5
- package/examples/api/boolean-operations.forge.js +3 -3
- package/examples/api/bounding-box-visualizer.forge.js +2 -2
- package/examples/api/clone-duplicate.forge.js +1 -1
- package/examples/api/colors-union-vs-array.forge.js +6 -6
- package/examples/api/connector-assembly.forge.js +4 -4
- package/examples/api/connector-basics.forge.js +2 -2
- package/examples/api/extrude-options.forge.js +4 -10
- package/examples/api/feature-created-faces.forge.js +6 -10
- package/examples/api/fillet-showcase.forge.js +1 -1
- package/examples/api/folded-service-panel-cover.forge.js +2 -2
- package/examples/api/group-test.forge.js +1 -1
- 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 +1 -1
- package/examples/api/pointAlong-orientation.forge.js +1 -1
- package/examples/api/profile-2020-b-slot6.forge.js +0 -1
- 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/transition-curves.forge.js +1 -1
- 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/experiments/drone-arm.forge.js +53 -0
- package/examples/furniture/adjustable-table.forge.js +2 -2
- package/examples/furniture/bathroom.forge.js +11 -11
- package/examples/furniture/chair.forge.js +1 -1
- package/examples/generative/crystal-growth.forge.js +2 -2
- package/examples/generative/frost-spires.forge.js +3 -3
- package/examples/generative/golden-spiral-tower.forge.js +3 -3
- package/examples/mechanical/3d-printer.forge.js +28 -28
- package/examples/mechanical/5-finger-robot-hand.forge.js +15 -15
- package/examples/mechanical/airplane-propeller.forge.js +2 -2
- package/examples/mechanical/fillet-enclosure.forge.js +1 -1
- package/examples/mechanical/headphone-hanger-v2.forge.js +2 -2
- package/examples/mechanical/robot_hand.forge.js +15 -15
- package/examples/mechanical/robot_hand_2.forge.js +9 -9
- package/examples/products/bottle.forge.js +1 -1
- package/examples/products/chess-set.forge.js +19 -19
- package/examples/products/classical-piano.forge.js +11 -11
- package/examples/products/clock.forge.js +12 -12
- package/examples/products/iphone.forge.js +8 -8
- package/examples/products/laptop.forge.js +15 -15
- package/examples/products/liquid-soap-dispenser.forge.js +18 -18
- package/examples/products/origami-fish.forge.js +8 -6
- package/examples/products/spiderman-cake.forge.js +4 -4
- package/examples/toolbox/bolted-joint.forge.js +2 -2
- package/package.json +7 -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/docs-raw/CLI.md +0 -865
- 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/CLI.md +0 -865
- 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-skill/SKILL-dev.md
CHANGED
|
@@ -5,43 +5,24 @@ description: ForgeCAD development skill — model authoring plus compiler intern
|
|
|
5
5
|
|
|
6
6
|
# ForgeCAD
|
|
7
7
|
|
|
8
|
-
Author or modify ForgeCAD models, sketches, assemblies,
|
|
8
|
+
Author or modify ForgeCAD models, sketches, assemblies, and CLI workflows. Prefer documented primitives, import rules, placement strategies, and CLI commands over inventing new APIs.
|
|
9
9
|
|
|
10
10
|
## Workflow
|
|
11
11
|
|
|
12
|
-
1. Identify the artifact: `.forge.js`,
|
|
12
|
+
1. Identify the artifact: `.forge.js`, SVG asset, or CLI/export task.
|
|
13
13
|
2. Load only the docs the task needs (see Source Map below). Start from the top group, add others as needed.
|
|
14
14
|
3. Default to a concrete first pass — easy iteration beats speculative design review.
|
|
15
15
|
4. If an existing model is broken, replace the weak structure rather than preserving bad architecture.
|
|
16
|
-
5. Validate with `forgecad run <file>` (add `--debug-imports` for import chain issues).
|
|
16
|
+
5. Validate with `forgecad run <file>` (add `--debug-imports` for import chain issues).
|
|
17
17
|
6. For `jointsView()` animations, keep wrapped revolute tracks continuous across branch cuts; do not assume the viewport will auto-fix `-180/180` jumps.
|
|
18
18
|
|
|
19
19
|
### Import and Composition
|
|
20
20
|
|
|
21
21
|
- `require("./file.forge.js", { Param: value })` for any model file, with optional param overrides.
|
|
22
22
|
- `importSvgSketch()` for SVG files (file format loader, not a module import).
|
|
23
|
-
- `.
|
|
23
|
+
- `.placeReference('bottom', [0,0,0])` to align any built-in anchor to a world coordinate; also works with custom `.withReferences()`.
|
|
24
24
|
- Plain `.js` modules for shared helpers/constants (not model imports).
|
|
25
25
|
|
|
26
|
-
### Notebooks
|
|
27
|
-
|
|
28
|
-
Use `.forge-notebook.json` for stateful iteration and debugging. Cells share state, `show()` pins visible geometry, and the preview cell can be validated or rendered directly from the CLI.
|
|
29
|
-
|
|
30
|
-
Prefer notebooks when:
|
|
31
|
-
|
|
32
|
-
- the task is exploratory or the geometry strategy is still unclear
|
|
33
|
-
- you are debugging booleans, placements, or assembly kinematics
|
|
34
|
-
- you want to inspect intermediate shapes or sketches without rewriting the whole file
|
|
35
|
-
|
|
36
|
-
Useful notebook loop:
|
|
37
|
-
|
|
38
|
-
- keep stable setup in early cells and the current experiment in the preview cell
|
|
39
|
-
- use `show(...)` for intermediate geometry you want pinned in the viewport
|
|
40
|
-
- use `forgecad notebook view <file> preview` to inspect the notebook from the terminal
|
|
41
|
-
- use `forgecad run <file>.forge-notebook.json` for preview-cell validation and spatial analysis
|
|
42
|
-
- use `forgecad render <file>.forge-notebook.json` or `forgecad capture gif <file>.forge-notebook.json --list` to inspect the preview cell through the CLI
|
|
43
|
-
- export to `.forge.js` when the exploratory phase is over and the structure is ready to stabilize
|
|
44
|
-
|
|
45
26
|
## Source Map
|
|
46
27
|
|
|
47
28
|
Load groups top-to-bottom, stopping when you have what the task needs.
|
|
@@ -50,19 +31,9 @@ Load groups top-to-bottom, stopping when you have what the task needs.
|
|
|
50
31
|
|
|
51
32
|
Execution model, colors, coordinate system, primitives, booleans, patterns, imports, parameters, topology, edge queries.
|
|
52
33
|
|
|
53
|
-
- `{{SKILL_DIR}}/docs/API/core/reserved-terms.md`
|
|
54
34
|
- `{{SKILL_DIR}}/docs/API/core/concepts.md`
|
|
55
|
-
- `{{SKILL_DIR}}/docs/API/core/parameters.md`
|
|
56
|
-
- `{{SKILL_DIR}}/docs/API/core/topology.md`
|
|
57
|
-
- `{{SKILL_DIR}}/docs/API/core/edge-queries.md`
|
|
58
35
|
- `{{SKILL_DIR}}/docs/generated/core.md`
|
|
59
36
|
|
|
60
|
-
### 1b. SDF Modeling (when using smooth booleans, TPMS, deformations, or fromFunction)
|
|
61
|
-
|
|
62
|
-
Primitives, smooth booleans, TPMS lattices, twist/bend/displace, morph, custom functions, gotchas.
|
|
63
|
-
|
|
64
|
-
- `{{SKILL_DIR}}/docs/API/core/sdf.md`
|
|
65
|
-
|
|
66
37
|
### 2. Geometry and Positioning (when placement/orientation matters)
|
|
67
38
|
|
|
68
39
|
Axis conventions, winding rules, and placement strategy.
|
|
@@ -71,21 +42,10 @@ Axis conventions, winding rules, and placement strategy.
|
|
|
71
42
|
- `{{SKILL_DIR}}/docs/guides/geometry-conventions.md`
|
|
72
43
|
- `{{SKILL_DIR}}/docs/guides/positioning.md`
|
|
73
44
|
|
|
74
|
-
### 3. Sketch APIs
|
|
45
|
+
### 3. Sketch APIs
|
|
75
46
|
|
|
76
47
|
2D construction, transforms, booleans, paths, on-face sketching, extrusion, anchors, text, regions.
|
|
77
48
|
|
|
78
|
-
- `{{SKILL_DIR}}/docs/API/sketch/core.md`
|
|
79
|
-
- `{{SKILL_DIR}}/docs/API/sketch/primitives.md`
|
|
80
|
-
- `{{SKILL_DIR}}/docs/API/sketch/path.md`
|
|
81
|
-
- `{{SKILL_DIR}}/docs/API/sketch/transforms.md`
|
|
82
|
-
- `{{SKILL_DIR}}/docs/API/sketch/booleans.md`
|
|
83
|
-
- `{{SKILL_DIR}}/docs/API/sketch/operations.md`
|
|
84
|
-
- `{{SKILL_DIR}}/docs/API/sketch/on-face.md`
|
|
85
|
-
- `{{SKILL_DIR}}/docs/API/sketch/extrude.md`
|
|
86
|
-
- `{{SKILL_DIR}}/docs/API/sketch/anchor.md`
|
|
87
|
-
- `{{SKILL_DIR}}/docs/API/sketch/text.md`
|
|
88
|
-
- `{{SKILL_DIR}}/docs/API/sketch/regions.md`
|
|
89
49
|
- `{{SKILL_DIR}}/docs/generated/sketch.md`
|
|
90
50
|
|
|
91
51
|
### 4. Curves and Surfacing (for lofts, sweeps, splines)
|
|
@@ -98,38 +58,31 @@ Smooth curves, Hermite splines, lofted and swept solids.
|
|
|
98
58
|
|
|
99
59
|
Assembly graph, joint types, couplings, validation, robot export.
|
|
100
60
|
|
|
101
|
-
- `{{SKILL_DIR}}/docs/API/assembly/assembly.md`
|
|
102
61
|
- `{{SKILL_DIR}}/docs/generated/assembly.md`
|
|
103
62
|
|
|
104
63
|
### 6. Sheet Metal (for bent parts, K-factor, flat patterns)
|
|
105
64
|
|
|
106
65
|
Bend operations, flat pattern unfolding, K-factor configuration.
|
|
107
66
|
|
|
108
|
-
- `{{SKILL_DIR}}/docs/API/sheet-metal/sheet-metal.md`
|
|
109
67
|
- `{{SKILL_DIR}}/docs/generated/sheet-metal.md`
|
|
110
68
|
|
|
111
69
|
### 7. Output and Export (for STL/3MF/STEP, BOM, dimensions)
|
|
112
70
|
|
|
113
71
|
Mesh export, exact geometry export, bill of materials, dimension annotations.
|
|
114
72
|
|
|
115
|
-
- `{{SKILL_DIR}}/docs/API/output/export.md`
|
|
116
|
-
- `{{SKILL_DIR}}/docs/API/output/brep-export.md`
|
|
117
|
-
- `{{SKILL_DIR}}/docs/API/output/bom.md`
|
|
118
|
-
- `{{SKILL_DIR}}/docs/API/output/dimensions.md`
|
|
119
73
|
- `{{SKILL_DIR}}/docs/generated/output.md`
|
|
120
74
|
|
|
121
75
|
### 8. Toolbox (fasteners and standard parts)
|
|
122
76
|
|
|
123
77
|
Parametric bolts, nuts, washers, standard hardware, gears, pipes, and structural profiles.
|
|
124
78
|
|
|
125
|
-
- `{{SKILL_DIR}}/docs/API/toolbox/fasteners.md`
|
|
126
79
|
- `{{SKILL_DIR}}/docs/generated/lib.md`
|
|
80
|
+
- `{{SKILL_DIR}}/docs/generated/wood.md`
|
|
127
81
|
|
|
128
82
|
### 9. Runtime Viewport APIs (for cut planes, jointsView, and animation playback)
|
|
129
83
|
|
|
130
84
|
Viewer-only APIs such as cutPlane, explodeView, jointsView, and animation behavior.
|
|
131
85
|
|
|
132
|
-
- `{{SKILL_DIR}}/docs/API/runtime/viewport.md`
|
|
133
86
|
- `{{SKILL_DIR}}/docs/generated/viewport.md`
|
|
134
87
|
|
|
135
88
|
### 10. Recipes and Debugging (for patterns and troubleshooting)
|
|
@@ -140,15 +93,19 @@ Modeling patterns, debugging tactics, copyable snippets.
|
|
|
140
93
|
|
|
141
94
|
### 11. CLI (for validation/render/export tasks)
|
|
142
95
|
|
|
143
|
-
Test-run,
|
|
96
|
+
Test-run, export pipelines, debug flags.
|
|
144
97
|
|
|
145
|
-
- `{{SKILL_DIR}}/docs/CLI.md`
|
|
98
|
+
- `{{SKILL_DIR}}/docs/CLI/projects.md`
|
|
99
|
+
- `{{SKILL_DIR}}/docs/CLI/validation.md`
|
|
100
|
+
- `{{SKILL_DIR}}/docs/CLI/export.md`
|
|
101
|
+
- `{{SKILL_DIR}}/docs/CLI/studio_publishing.md`
|
|
146
102
|
|
|
147
103
|
### 12. Internals — Compiler & Geometry Pipeline (for ForgeCAD developers)
|
|
148
104
|
|
|
149
105
|
Semantic feature graphs, lowering strategy, compile plans. Read when working on the compiler or geometry backends.
|
|
150
106
|
|
|
151
107
|
- `{{SKILL_DIR}}/docs/internals/compiler.md`
|
|
108
|
+
- `{{SKILL_DIR}}/docs/internals/sketch-2d-pipeline.md`
|
|
152
109
|
|
|
153
110
|
### 13. Internals — Constraint Solver (for solver work)
|
|
154
111
|
|
|
@@ -157,20 +114,13 @@ Solver architecture, phases, Gauss-Seidel/Newton-Raphson, quality tuning.
|
|
|
157
114
|
- `{{SKILL_DIR}}/docs/internals/constraint-solver.md`
|
|
158
115
|
- `{{SKILL_DIR}}/docs/internals/constraint-solver-quality.md`
|
|
159
116
|
|
|
160
|
-
### 14. Internals — Sketch 2D Pipeline
|
|
161
|
-
|
|
162
|
-
2D sketch pipeline stages, constraint evaluation, winding enforcement.
|
|
163
|
-
|
|
164
|
-
- `{{SKILL_DIR}}/docs/internals/sketch-2d-pipeline.md`
|
|
165
|
-
|
|
166
117
|
### 15. Project Conventions (coding standards, releases)
|
|
167
118
|
|
|
168
119
|
Coding best practices, PR guidelines, release checklist, deployment.
|
|
169
120
|
|
|
170
121
|
- `{{SKILL_DIR}}/docs/coding-best-practices.md`
|
|
171
122
|
- `{{SKILL_DIR}}/docs/coding.md`
|
|
172
|
-
- `{{SKILL_DIR}}/docs/
|
|
173
|
-
- `{{SKILL_DIR}}/docs/RELEASING.md`
|
|
123
|
+
- `{{SKILL_DIR}}/docs/blueprint-first.md`
|
|
174
124
|
|
|
175
125
|
### 16. Skill System Maintenance
|
|
176
126
|
|
|
@@ -178,3 +128,11 @@ How to add docs, maintain standard vs dev skill, build and install flow.
|
|
|
178
128
|
|
|
179
129
|
- `{{SKILL_DIR}}/docs/guides/skill-maintenance.md`
|
|
180
130
|
|
|
131
|
+
### 1b. SDF Modeling — Experimental (smooth booleans, TPMS, deformations, fromFunction)
|
|
132
|
+
|
|
133
|
+
Primitives, smooth booleans, TPMS lattices, twist/bend/displace, morph, custom functions, gotchas. Experimental — slower render, lower mesh quality than B-rep.
|
|
134
|
+
|
|
135
|
+
- `{{SKILL_DIR}}/docs/API/core/sdf-primitives.md`
|
|
136
|
+
- `{{SKILL_DIR}}/docs/API/core/sdf-advanced.md`
|
|
137
|
+
- `{{SKILL_DIR}}/docs/API/core/sdf-workflow.md`
|
|
138
|
+
|
package/dist-skill/SKILL.md
CHANGED
|
@@ -1,47 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: forgecad
|
|
3
|
-
description: ForgeCAD model authoring, editing, debugging, and execution guidance for .forge.js,
|
|
3
|
+
description: ForgeCAD model authoring, editing, debugging, and execution guidance for .forge.js, SVG-import, assembly, and CLI workflows. Use when building or modifying ForgeCAD geometry, structuring multi-file projects, validating scripts, or using ForgeCAD export/render tooling.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ForgeCAD
|
|
7
7
|
|
|
8
|
-
Author or modify ForgeCAD models, sketches, assemblies,
|
|
8
|
+
Author or modify ForgeCAD models, sketches, assemblies, and CLI workflows. Prefer documented primitives, import rules, placement strategies, and CLI commands over inventing new APIs.
|
|
9
9
|
|
|
10
10
|
## Workflow
|
|
11
11
|
|
|
12
|
-
1. Identify the artifact: `.forge.js`,
|
|
12
|
+
1. Identify the artifact: `.forge.js`, SVG asset, or CLI/export task.
|
|
13
13
|
2. Load only the docs the task needs (see Source Map below). Start from the top group, add others as needed.
|
|
14
14
|
3. Default to a concrete first pass — easy iteration beats speculative design review.
|
|
15
15
|
4. If an existing model is broken, replace the weak structure rather than preserving bad architecture.
|
|
16
|
-
5. Validate with `forgecad run <file>` (add `--debug-imports` for import chain issues).
|
|
16
|
+
5. Validate with `forgecad run <file>` (add `--debug-imports` for import chain issues).
|
|
17
17
|
6. For `jointsView()` animations, keep wrapped revolute tracks continuous across branch cuts; do not assume the viewport will auto-fix `-180/180` jumps.
|
|
18
18
|
|
|
19
19
|
### Import and Composition
|
|
20
20
|
|
|
21
21
|
- `require("./file.forge.js", { Param: value })` for any model file, with optional param overrides.
|
|
22
22
|
- `importSvgSketch()` for SVG files (file format loader, not a module import).
|
|
23
|
-
- `.
|
|
23
|
+
- `.placeReference('bottom', [0,0,0])` to align any built-in anchor to a world coordinate; also works with custom `.withReferences()`.
|
|
24
24
|
- Plain `.js` modules for shared helpers/constants (not model imports).
|
|
25
25
|
|
|
26
|
-
### Notebooks
|
|
27
|
-
|
|
28
|
-
Use `.forge-notebook.json` for stateful iteration and debugging. Cells share state, `show()` pins visible geometry, and the preview cell can be validated or rendered directly from the CLI.
|
|
29
|
-
|
|
30
|
-
Prefer notebooks when:
|
|
31
|
-
|
|
32
|
-
- the task is exploratory or the geometry strategy is still unclear
|
|
33
|
-
- you are debugging booleans, placements, or assembly kinematics
|
|
34
|
-
- you want to inspect intermediate shapes or sketches without rewriting the whole file
|
|
35
|
-
|
|
36
|
-
Useful notebook loop:
|
|
37
|
-
|
|
38
|
-
- keep stable setup in early cells and the current experiment in the preview cell
|
|
39
|
-
- use `show(...)` for intermediate geometry you want pinned in the viewport
|
|
40
|
-
- use `forgecad notebook view <file> preview` to inspect the notebook from the terminal
|
|
41
|
-
- use `forgecad run <file>.forge-notebook.json` for preview-cell validation and spatial analysis
|
|
42
|
-
- use `forgecad render <file>.forge-notebook.json` or `forgecad capture gif <file>.forge-notebook.json --list` to inspect the preview cell through the CLI
|
|
43
|
-
- export to `.forge.js` when the exploratory phase is over and the structure is ready to stabilize
|
|
44
|
-
|
|
45
26
|
## Source Map
|
|
46
27
|
|
|
47
28
|
Load groups top-to-bottom, stopping when you have what the task needs.
|
|
@@ -50,19 +31,9 @@ Load groups top-to-bottom, stopping when you have what the task needs.
|
|
|
50
31
|
|
|
51
32
|
Execution model, colors, coordinate system, primitives, booleans, patterns, imports, parameters, topology, edge queries.
|
|
52
33
|
|
|
53
|
-
- `{{SKILL_DIR}}/docs/API/core/reserved-terms.md`
|
|
54
34
|
- `{{SKILL_DIR}}/docs/API/core/concepts.md`
|
|
55
|
-
- `{{SKILL_DIR}}/docs/API/core/parameters.md`
|
|
56
|
-
- `{{SKILL_DIR}}/docs/API/core/topology.md`
|
|
57
|
-
- `{{SKILL_DIR}}/docs/API/core/edge-queries.md`
|
|
58
35
|
- `{{SKILL_DIR}}/docs/generated/core.md`
|
|
59
36
|
|
|
60
|
-
### 1b. SDF Modeling (when using smooth booleans, TPMS, deformations, or fromFunction)
|
|
61
|
-
|
|
62
|
-
Primitives, smooth booleans, TPMS lattices, twist/bend/displace, morph, custom functions, gotchas.
|
|
63
|
-
|
|
64
|
-
- `{{SKILL_DIR}}/docs/API/core/sdf.md`
|
|
65
|
-
|
|
66
37
|
### 2. Geometry and Positioning (when placement/orientation matters)
|
|
67
38
|
|
|
68
39
|
Axis conventions, winding rules, and placement strategy.
|
|
@@ -71,21 +42,10 @@ Axis conventions, winding rules, and placement strategy.
|
|
|
71
42
|
- `{{SKILL_DIR}}/docs/guides/geometry-conventions.md`
|
|
72
43
|
- `{{SKILL_DIR}}/docs/guides/positioning.md`
|
|
73
44
|
|
|
74
|
-
### 3. Sketch APIs
|
|
45
|
+
### 3. Sketch APIs
|
|
75
46
|
|
|
76
47
|
2D construction, transforms, booleans, paths, on-face sketching, extrusion, anchors, text, regions.
|
|
77
48
|
|
|
78
|
-
- `{{SKILL_DIR}}/docs/API/sketch/core.md`
|
|
79
|
-
- `{{SKILL_DIR}}/docs/API/sketch/primitives.md`
|
|
80
|
-
- `{{SKILL_DIR}}/docs/API/sketch/path.md`
|
|
81
|
-
- `{{SKILL_DIR}}/docs/API/sketch/transforms.md`
|
|
82
|
-
- `{{SKILL_DIR}}/docs/API/sketch/booleans.md`
|
|
83
|
-
- `{{SKILL_DIR}}/docs/API/sketch/operations.md`
|
|
84
|
-
- `{{SKILL_DIR}}/docs/API/sketch/on-face.md`
|
|
85
|
-
- `{{SKILL_DIR}}/docs/API/sketch/extrude.md`
|
|
86
|
-
- `{{SKILL_DIR}}/docs/API/sketch/anchor.md`
|
|
87
|
-
- `{{SKILL_DIR}}/docs/API/sketch/text.md`
|
|
88
|
-
- `{{SKILL_DIR}}/docs/API/sketch/regions.md`
|
|
89
49
|
- `{{SKILL_DIR}}/docs/generated/sketch.md`
|
|
90
50
|
|
|
91
51
|
### 4. Curves and Surfacing (for lofts, sweeps, splines)
|
|
@@ -98,38 +58,31 @@ Smooth curves, Hermite splines, lofted and swept solids.
|
|
|
98
58
|
|
|
99
59
|
Assembly graph, joint types, couplings, validation, robot export.
|
|
100
60
|
|
|
101
|
-
- `{{SKILL_DIR}}/docs/API/assembly/assembly.md`
|
|
102
61
|
- `{{SKILL_DIR}}/docs/generated/assembly.md`
|
|
103
62
|
|
|
104
63
|
### 6. Sheet Metal (for bent parts, K-factor, flat patterns)
|
|
105
64
|
|
|
106
65
|
Bend operations, flat pattern unfolding, K-factor configuration.
|
|
107
66
|
|
|
108
|
-
- `{{SKILL_DIR}}/docs/API/sheet-metal/sheet-metal.md`
|
|
109
67
|
- `{{SKILL_DIR}}/docs/generated/sheet-metal.md`
|
|
110
68
|
|
|
111
69
|
### 7. Output and Export (for STL/3MF/STEP, BOM, dimensions)
|
|
112
70
|
|
|
113
71
|
Mesh export, exact geometry export, bill of materials, dimension annotations.
|
|
114
72
|
|
|
115
|
-
- `{{SKILL_DIR}}/docs/API/output/export.md`
|
|
116
|
-
- `{{SKILL_DIR}}/docs/API/output/brep-export.md`
|
|
117
|
-
- `{{SKILL_DIR}}/docs/API/output/bom.md`
|
|
118
|
-
- `{{SKILL_DIR}}/docs/API/output/dimensions.md`
|
|
119
73
|
- `{{SKILL_DIR}}/docs/generated/output.md`
|
|
120
74
|
|
|
121
75
|
### 8. Toolbox (fasteners and standard parts)
|
|
122
76
|
|
|
123
77
|
Parametric bolts, nuts, washers, standard hardware, gears, pipes, and structural profiles.
|
|
124
78
|
|
|
125
|
-
- `{{SKILL_DIR}}/docs/API/toolbox/fasteners.md`
|
|
126
79
|
- `{{SKILL_DIR}}/docs/generated/lib.md`
|
|
80
|
+
- `{{SKILL_DIR}}/docs/generated/wood.md`
|
|
127
81
|
|
|
128
82
|
### 9. Runtime Viewport APIs (for cut planes, jointsView, and animation playback)
|
|
129
83
|
|
|
130
84
|
Viewer-only APIs such as cutPlane, explodeView, jointsView, and animation behavior.
|
|
131
85
|
|
|
132
|
-
- `{{SKILL_DIR}}/docs/API/runtime/viewport.md`
|
|
133
86
|
- `{{SKILL_DIR}}/docs/generated/viewport.md`
|
|
134
87
|
|
|
135
88
|
### 10. Recipes and Debugging (for patterns and troubleshooting)
|
|
@@ -140,7 +93,10 @@ Modeling patterns, debugging tactics, copyable snippets.
|
|
|
140
93
|
|
|
141
94
|
### 11. CLI (for validation/render/export tasks)
|
|
142
95
|
|
|
143
|
-
Test-run,
|
|
96
|
+
Test-run, export pipelines, debug flags.
|
|
144
97
|
|
|
145
|
-
- `{{SKILL_DIR}}/docs/CLI.md`
|
|
98
|
+
- `{{SKILL_DIR}}/docs/CLI/projects.md`
|
|
99
|
+
- `{{SKILL_DIR}}/docs/CLI/validation.md`
|
|
100
|
+
- `{{SKILL_DIR}}/docs/CLI/export.md`
|
|
101
|
+
- `{{SKILL_DIR}}/docs/CLI/studio_publishing.md`
|
|
146
102
|
|
|
@@ -5,45 +5,28 @@ skill-order: 1
|
|
|
5
5
|
|
|
6
6
|
# ForgeCAD Core Concepts
|
|
7
7
|
|
|
8
|
-
ForgeCAD scripts are JavaScript
|
|
9
|
-
|
|
10
|
-
## Basic Structure
|
|
8
|
+
ForgeCAD scripts are JavaScript that returns geometry. The forge API is globally available — no imports needed.
|
|
11
9
|
|
|
12
10
|
```javascript
|
|
13
|
-
// 1. Declare parameters (creates UI sliders)
|
|
14
11
|
const width = param("Width", 50, { min: 20, max: 100, unit: "mm" });
|
|
15
|
-
|
|
16
|
-
// 2. Create geometry
|
|
17
|
-
const shape = box(width, 30, 10);
|
|
18
|
-
|
|
19
|
-
// 3. Return the final shape
|
|
20
|
-
return shape;
|
|
12
|
+
return box(width, 30, 10);
|
|
21
13
|
```
|
|
22
14
|
|
|
23
15
|
## Execution Model
|
|
24
16
|
|
|
25
17
|
- Scripts re-execute on every parameter change (400ms debounce)
|
|
26
|
-
- All operations are **immutable** —
|
|
27
|
-
- Must return one of:
|
|
28
|
-
- A `Shape` (3D solid)
|
|
29
|
-
- A `Sketch` (2D profile — rendered flat on XY plane)
|
|
30
|
-
- A `TrackedShape` (3D solid with named faces/edges — auto-unwrapped)
|
|
31
|
-
- A `ShapeGroup` (multiple shapes/sketches grouped for joint transforms)
|
|
32
|
-
- An `Array` of shapes/sketches/groups (multi-object scene)
|
|
33
|
-
- An `Array` of `{ name, shape?, sketch?, color? }` objects (named multi-object scene)
|
|
18
|
+
- All operations are **immutable** — return new shapes, never modify in place
|
|
19
|
+
- Must return one of: `Shape`, `Sketch`, `ShapeGroup`, `Array` of shapes/sketches/groups, or `Array` of `{ name, shape?, sketch?, color? }`
|
|
34
20
|
|
|
35
|
-
##
|
|
21
|
+
## Coordinate System
|
|
36
22
|
|
|
37
|
-
|
|
23
|
+
Z-up right-handed: X = left/right, Y = forward/back, Z = up/down.
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
const red = box(50, 50, 50).color('#ff0000');
|
|
41
|
-
const blue = circle2d(25).color('#0066ff');
|
|
42
|
-
```
|
|
25
|
+
## Colors
|
|
43
26
|
|
|
44
|
-
|
|
27
|
+
`.color(hex)` works on `Shape` and `Sketch`. Colors survive transforms. In booleans the first operand's color wins.
|
|
45
28
|
|
|
46
|
-
|
|
29
|
+
**`union()` removes colors** — shapes merge into one solid mesh. Return named objects instead:
|
|
47
30
|
|
|
48
31
|
```javascript
|
|
49
32
|
return [
|
|
@@ -52,82 +35,17 @@ return [
|
|
|
52
35
|
];
|
|
53
36
|
```
|
|
54
37
|
|
|
55
|
-
## ⚠️ Unions Remove Colors
|
|
56
|
-
|
|
57
|
-
`union()` merges shapes into one solid mesh — individual colors are lost:
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
// ❌ BAD: Colors are lost after union
|
|
61
|
-
const red = box(30, 30, 30).color('#ff0000');
|
|
62
|
-
const blue = box(20, 20, 20).translate(30, 0, 0).color('#0066ff');
|
|
63
|
-
return union(red, blue); // Result is all one color
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Return as named objects instead to keep each color:
|
|
67
|
-
|
|
68
|
-
```javascript
|
|
69
|
-
// ✅ GOOD: Each object keeps its color
|
|
70
|
-
return [
|
|
71
|
-
{ name: "Red Box", shape: box(30, 30, 30), color: '#ff0000' },
|
|
72
|
-
{ name: "Blue Box", shape: box(20, 20, 20).translate(30, 0, 0), color: '#0066ff' },
|
|
73
|
-
];
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Coordinate System
|
|
77
|
-
|
|
78
|
-
ForgeCAD uses **Z-up** right-handed coordinates:
|
|
79
|
-
- **X** = left/right
|
|
80
|
-
- **Y** = forward/back
|
|
81
|
-
- **Z** = up/down
|
|
82
|
-
|
|
83
|
-
See [coordinate-system.md](../guides/coordinate-system.md) for view mapping details.
|
|
84
|
-
|
|
85
38
|
## Face Operations
|
|
86
39
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
### Face Selection
|
|
90
|
-
|
|
91
|
-
```javascript
|
|
92
|
-
// Canonical names (primitives and tracked shapes)
|
|
93
|
-
shape.face('top') // topmost upward face
|
|
94
|
-
shape.face('front') // front face (-Y normal)
|
|
95
|
-
|
|
96
|
-
// Geometric queries (any shape — booleans, imports, complex bodies)
|
|
97
|
-
shape.face({ normal: [0, 0, 1], pick: 'largest' }) // largest upward face
|
|
98
|
-
shape.face({ normal: [0, 0, 1], nearest: [50, 50] }) // nearest to XY point
|
|
99
|
-
shape.faces({ normal: [0, 0, 1] }) // all upward faces (FaceRef[])
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Query properties: `normal`, `nearest`, `at`, `pick` (`'largest'`/`'smallest'`/`'max-z'`/...), `area` (`{ min?, max? }`).
|
|
40
|
+
Shapes carry semantic face labels through their lifecycle. The flow is:
|
|
103
41
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
box(100, 100, 20).pocket('top', 8, { inset: 5 })
|
|
42
|
+
1. **Primitives** assign canonical names — `box()` gives you `top`, `bottom`, `side-left`, etc.; `cylinder()` gives `top`, `bottom`, `side`.
|
|
43
|
+
2. **Extrusions** inherit labels from the sketch and add `top`/`bottom`.
|
|
44
|
+
3. **Transforms** (translate, rotate, scale, mirror) preserve all labels.
|
|
45
|
+
4. **Booleans** preserve labels from the first operand where geometry survives.
|
|
109
46
|
|
|
110
|
-
|
|
111
|
-
box(100, 100, 20).boss('top', 5, { scale: 0.6 })
|
|
112
|
-
|
|
113
|
-
// Target a specific face on a complex body with a query
|
|
114
|
-
const body = box(100, 100, 20).pocket('top', 10, { inset: 5 });
|
|
115
|
-
body.boss({ normal: [0, 0, 1], pick: 'smallest' }, 5) // boss from pocket floor
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Options: `inset` (shrink boundary, mm), `scale` (uniform scale, e.g. 0.8), `join` (`'Round'`/`'Square'`/`'Miter'`).
|
|
119
|
-
|
|
120
|
-
### Face Profile
|
|
121
|
-
|
|
122
|
-
Extract a face's 2D boundary as a `Sketch` for manual workflows:
|
|
123
|
-
|
|
124
|
-
```javascript
|
|
125
|
-
const profile = faceProfile(box(100, 100, 20), 'top');
|
|
126
|
-
const tool = profile.offset(-5).extrude(8); // shrink + extrude manually
|
|
127
|
-
```
|
|
47
|
+
You resolve labels to geometry with `.face(name)` or `.face(query)` — see the Shape class docs for the full query API. Operations like `.pocket()`, `.boss()`, `.hole()`, and `faceProfile()` all consume face references.
|
|
128
48
|
|
|
129
49
|
## SDF Modeling
|
|
130
50
|
|
|
131
|
-
For organic shapes, smooth blending, TPMS lattices, and surface deformations
|
|
132
|
-
|
|
133
|
-
See [sdf.md](sdf.md) for the full reference — primitives, smooth booleans, TPMS, twist/bend/displace, custom functions, and workflow tips.
|
|
51
|
+
For organic shapes, smooth blending, TPMS lattices, and surface deformations. SDF shapes convert via `.toShape()`. See [sdf-primitives.md](sdf-primitives.md).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill-group: cli
|
|
3
|
+
skill-order: 3
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ForgeCAD CLI: Export Commands
|
|
7
|
+
|
|
8
|
+
## SVG Export
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
forgecad export svg examples/constraints/01-fully-constrained-rect.forge.js [output.svg]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Pure Node — no browser needed. Runs the sketch script through the forge engine and converts polygons to SVG paths.
|
|
15
|
+
|
|
16
|
+
## STEP / BREP Export (exact subset, CadQuery)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
forgecad export step examples/api/brep-exportable.forge.js [--output out/demo.step] [--python 3.11] [--uv /path/to/uv]
|
|
20
|
+
forgecad export brep examples/api/brep-exportable.forge.js
|
|
21
|
+
forgecad export step examples/chess-set.forge.js --allow-faceted
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`uv`-first: provisions CadQuery automatically. Exact-subset only by default — fails with a reason rather than silently exporting degraded geometry. With `--allow-faceted`, unsupported mesh solids export as faceted OCCT solids (tessellation-driven, not exact replay).
|
|
25
|
+
|
|
26
|
+
The maintained feature matrix: `docs/permanent/API/output/brep-export.md`.
|
|
27
|
+
|
|
28
|
+
## G-code Toolpath Export
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
forgecad export gcode examples/gcode/parametric-vase.forge.js [--output out/vase.gcode]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The script must return a `GCodeBuilder` (from the `gcode()` factory). This is a toolpath scripting API, not a slicer — you define print movements in code. See `docs/permanent/API/output/gcode.md` for the full API.
|
|
35
|
+
|
|
36
|
+
## SDF Robot Export (Gazebo)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
forgecad export sdf examples/api/sdf-rover-demo.forge.js [--output out/forge_scout]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Writes a Gazebo-friendly package: `model.sdf`, `model.config`, `meshes/*.stl`, optional world file. Script must call `robotExport({...})` with an `assembly(...)` graph.
|
|
43
|
+
|
|
44
|
+
Launch flow (macOS — use split `-s`/`-g`):
|
|
45
|
+
```bash
|
|
46
|
+
export GZ_SIM_RESOURCE_PATH="$PWD/out/forge_scout/models${GZ_SIM_RESOURCE_PATH:+:$GZ_SIM_RESOURCE_PATH}"
|
|
47
|
+
gz sim -s -r out/forge_scout/worlds/forge_scout_trial.sdf
|
|
48
|
+
gz sim -g out/forge_scout/worlds/forge_scout_trial.sdf
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## URDF Export
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
forgecad export urdf examples/api/sdf-rover-demo.forge.js
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## PNG Render (requires Chrome/Puppeteer)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
forgecad render examples/cup.forge.js [output.png]
|
|
61
|
+
forgecad render examples/cup.forge.js out/scene.png --scene '<json from viewport>'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Options: `--angles <front,side,top,iso>`, `--size <px>`, `--port <n>`, `--camera <spec>`, `--scene <json>`, `--background <color>`, `--chrome-path <path>`.
|
|
65
|
+
|
|
66
|
+
## Animated Capture (GIF or MP4, requires Chrome)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
forgecad capture gif examples/cup.forge.js [output.gif]
|
|
70
|
+
forgecad capture mp4 examples/cup.forge.js [output.mp4]
|
|
71
|
+
forgecad capture mp4 examples/api/runtime-joints-view.forge.js out/step.mp4 --capture animation --animation Step
|
|
72
|
+
forgecad capture gif examples/3d-printer.forge.js out/section.gif --cut-plane "Front Section"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`--list` prints available animation clips and cut planes. Uses `ffmpeg` when available (better GIF colors, H.264 MP4); falls back to pure-JS GIF encoder.
|
|
76
|
+
|
|
77
|
+
Key options: `--capture <orbit|animation>`, `--animation <name>`, `--cut-plane <name>`, `--camera <spec>`, `--scene <json>`, `--size <px>`, `--fps <n>`, `--frames-per-turn <n>`, `--quality <default|live|high>`.
|
|
78
|
+
|
|
79
|
+
Use `Copy CLI --scene` from the View Panel to grab the current viewport framing and paste into `render` or `capture`.
|
|
80
|
+
|
|
81
|
+
## PDF Report
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
forgecad export report examples/cup.forge.js [output.pdf] [--dim-angle-tol 18]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Generates a searchable PDF with BOM page, combined model page, and per-component pages. Dimensions included per view when their axis aligns with that view's projection plane (within `--dim-angle-tol` degrees, default 12).
|
|
88
|
+
|
|
89
|
+
## STL Export
|
|
90
|
+
|
|
91
|
+
Available in the browser UI via the Export panel (binary STL).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill-group: cli
|
|
3
|
+
skill-order: 1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ForgeCAD CLI: Projects & Setup
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g forgecad
|
|
12
|
+
# Developers working on ForgeCAD itself:
|
|
13
|
+
npm install && npm link
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## When to use what
|
|
17
|
+
|
|
18
|
+
| Context | Use |
|
|
19
|
+
|---------|-----|
|
|
20
|
+
| Using ForgeCAD as a tool | `forgecad *` commands |
|
|
21
|
+
| Developing ForgeCAD itself | `npm run dev` / `npm run build` |
|
|
22
|
+
| CI / publishing | `npm run build && npm run test:full` |
|
|
23
|
+
|
|
24
|
+
## Dev vs production server
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
forgecad dev [path] # Vite dev server, live reload
|
|
28
|
+
forgecad studio [path] # Static server for production build (requires dist/)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Both accept `--blank`, `--port <n>`, `--host`, `--open`, `--strict-port`.
|
|
32
|
+
|
|
33
|
+
## Licensing
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
forgecad license # Show license status
|
|
37
|
+
forgecad license activate <key> # Activate a Pro license key
|
|
38
|
+
forgecad license deactivate # Remove license
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Tier | Included |
|
|
42
|
+
|------|----------|
|
|
43
|
+
| Free | dev, studio, run, render, export stl/3mf/svg, all checks, debug |
|
|
44
|
+
| Pro | export step/brep, render-hq, capture gif/mp4, gcode, report, cutting-layout, sdf, urdf, sketch-pdf |
|
|
45
|
+
|
|
46
|
+
## Authentication
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
forgecad login # Interactive login
|
|
50
|
+
forgecad login --server http://localhost:5174
|
|
51
|
+
forgecad logout
|
|
52
|
+
forgecad whoami # Show user, server, and license status
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Credentials stored in `~/.forgecad/auth.json`.
|
|
56
|
+
|
|
57
|
+
## Project Management
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
forgecad project init "My Project" # Create on server + link current directory
|
|
61
|
+
forgecad project clone my-project # Download into ./my-project/
|
|
62
|
+
forgecad project push [--force] # Upload local changes
|
|
63
|
+
forgecad project pull [--force] # Download remote changes
|
|
64
|
+
forgecad project status # Show local vs remote diff
|
|
65
|
+
forgecad project list
|
|
66
|
+
forgecad project info
|
|
67
|
+
forgecad project rename "New Name"
|
|
68
|
+
forgecad project set-visibility public # private|shared|public
|
|
69
|
+
forgecad project delete [--force]
|
|
70
|
+
forgecad project open
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Projects are linked to remote via `forgecad.json`.
|
|
74
|
+
|
|
75
|
+
## File Management (Remote)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
forgecad file list [path]
|
|
79
|
+
forgecad file read <path>
|
|
80
|
+
forgecad file save <path> # Upload local file
|
|
81
|
+
forgecad file save <path> --content "code here"
|
|
82
|
+
cat model.forge.js | forgecad file save model.forge.js --stdin
|
|
83
|
+
forgecad file delete <path> [--force]
|
|
84
|
+
forgecad file rename <old> <new>
|
|
85
|
+
forgecad file mkdir <path>
|
|
86
|
+
forgecad file copy <source-slug> <path> [--dest <dest-path>]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Requires the current directory to have `forgecad.json`.
|
|
90
|
+
|
|
91
|
+
## Member Management
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
forgecad project members
|
|
95
|
+
forgecad project add-member alice@example.com # editor by default
|
|
96
|
+
forgecad project add-member bob@example.com --role viewer
|
|
97
|
+
forgecad project remove-member alice@example.com
|
|
98
|
+
forgecad project set-role bob@example.com editor
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Roles: **owner** (full control), **editor** (read/write), **viewer** (read-only).
|
|
102
|
+
|
|
103
|
+
## Shell Autocomplete
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
forgecad completion bash # or zsh / fish
|
|
107
|
+
```
|