forgecad 0.10.2 → 0.10.3
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 +7 -6
- package/dist/assets/{AdminPage-CHY6ZN-p.js → AdminPage-CK7ObBz3.js} +1 -1
- package/dist/assets/{BenchmarkPage-BcRT5iGN.js → BenchmarkPage-Ds7Z2doN.js} +1 -1
- package/dist/assets/{BlogPage-BssBbnb-.js → BlogPage-DlPbpt6A.js} +1 -1
- package/dist/assets/{DocsPage-DsvdiRNK.js → DocsPage-vZb3b3Y0.js} +9 -14
- package/dist/assets/{EditorApp-BpjZgzk0.css → EditorApp-C5f24ZN9.css} +8 -0
- package/dist/assets/{EditorApp-Bfd3jbtC.js → EditorApp-HLoKfe15.js} +141 -12
- package/dist/assets/{EmbedViewer-D5t8WamV.js → EmbedViewer--KnqBKrJ.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-DbN7o-Be.js → LandingPageProofDriven-C_LssmnA.js} +1 -1
- package/dist/assets/{LegalPage-DNGrrY0p.js → LegalPage-DGsyo4n1.js} +1 -1
- package/dist/assets/{PricingPage-Nczr3pRz.js → PricingPage-BOE27B-R.js} +1 -1
- package/dist/assets/{SettingsPage-DZlyu4d4.js → SettingsPage-f47cnk39.js} +1 -1
- package/dist/assets/{app-C9ct2hRD.js → app-D6ccu2Xx.js} +6854 -7373
- package/dist/assets/{backendInit-ymjonyQp.js → backendInit-DbTkQN9J.js} +2557 -809
- package/dist/assets/cli/{render-B_0lQwKU.js → render-BsngirjC.js} +114 -9
- package/dist/assets/{constructionHistoryWorker-CZ42Dksy.js → constructionHistoryWorker-PCwXrTDB.js} +175 -36
- package/dist/assets/{evalWorker-C2pm8LHP.js → evalWorker-CS63PfZu.js} +1125 -447
- package/dist/assets/{forgecad_geometry-BlMtqluF.js → forgecad_geometry-CZ_IfuvA.js} +1 -9
- package/dist/assets/{forgecad_geometry_bg-BllP_WiL.wasm → forgecad_geometry_bg-C3rQHfwg.wasm} +0 -0
- package/dist/assets/{inspectWorker-D5T5VbfK.js → inspectWorker-Y4cOzNyA.js} +4345 -373
- package/dist/assets/{jointPose-4r8ed8_5.js → jointPose-AMvCywzS.js} +1 -1
- package/dist/assets/{manifold-C4r6B-XY.js → manifold-CBry38ly.js} +2 -2
- package/dist/assets/{manifold-5PP1eGLN.js → manifold-Crd_F2qx.js} +1 -1
- package/dist/assets/{manifold-DjBkyIc8.js → manifold-k2kRcc85.js} +1 -1
- package/dist/assets/{reportWorker-CwenM7wB.js → reportWorker-CWvn0CEv.js} +1095 -400
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/usage.md +2 -4
- package/dist/docs-raw/CLI.md +9 -7
- package/dist/docs-raw/README.md +1 -1
- package/dist/docs-raw/component-model.md +1 -1
- package/dist/docs-raw/generated/assembly.md +1 -1
- package/dist/docs-raw/generated/concepts.md +5 -3
- package/dist/docs-raw/generated/core.md +70 -1
- package/dist/docs-raw/generated/curves.md +8 -1
- package/dist/docs-raw/generated/output.md +0 -64
- package/dist/docs-raw/generated/runtime-names.md +6 -6
- package/dist/docs-raw/generated/viewport.md +3 -12
- package/dist/docs-raw/guides/inspection-bundles.md +1 -1
- package/dist/docs-raw/simulation-workflow.md +58 -0
- package/dist/docs-raw/skills/forgecad-blockout-model.md +1 -1
- package/dist/docs-raw/skills/forgecad-image-replicator.md +2 -2
- package/dist/docs-raw/skills/forgecad-mujoco-verify.md +78 -0
- package/dist/docs-raw/skills/forgecad-spec-by-walking-through-it.md +145 -0
- package/dist/docs-raw/skills/forgecad-visual-spec.md +1 -1
- package/dist/docs-raw/skills/forgecad.md +24 -24
- package/dist/docs-raw/skills/index.md +2 -3
- package/dist/index.html +1 -1
- package/dist/sitemap.xml +15 -15
- package/dist-cli/{check-compiler-SP7FAL7R.js → check-compiler-HPF2T2FS.js} +1 -1
- package/dist-cli/{check-query-propagation-BRLSHP22.js → check-query-propagation-HYSLTXAB.js} +1 -1
- package/dist-cli/{chunk-RQQ42YCP.js → chunk-WLUKAW3H.js} +1025 -158
- package/dist-cli/forgecad.js +2621 -232
- package/dist-cli/{forgecad_geometry-7TVSNVUB.js → forgecad_geometry-2IMYCUWW.js} +0 -8
- package/dist-cli/forgecad_geometry_bg.wasm +0 -0
- package/dist-skill/CONTEXT.md +85 -73
- package/dist-skill/SKILL.md +1 -1
- package/dist-skill/docs/CLI.md +9 -7
- package/dist-skill/docs/generated/assembly.md +1 -1
- package/dist-skill/docs/generated/core.md +70 -1
- package/dist-skill/docs/generated/curves.md +8 -1
- package/dist-skill/docs/generated/output.md +0 -64
- package/dist-skill/docs/generated/runtime-names.md +6 -6
- package/dist-skill/docs/generated/viewport.md +3 -12
- package/dist-skill/docs/guides/inspection-bundles.md +1 -1
- package/dist-skill/library/README.md +2 -3
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +1 -1
- package/dist-skill/library/forgecad-image-replicator/SKILL.md +2 -2
- package/dist-skill/library/forgecad-mujoco-verify/SKILL.md +66 -0
- package/dist-skill/library/forgecad-mujoco-verify/scripts/mujoco_verify.py +385 -0
- package/dist-skill/library/forgecad-spec-by-walking-through-it/SKILL.md +132 -0
- package/dist-skill/library/forgecad-visual-spec/SKILL.md +1 -1
- package/dist-skill/website/skills/forgecad-blockout-model.md +1 -1
- package/dist-skill/website/skills/forgecad-image-replicator.md +2 -2
- package/dist-skill/website/skills/forgecad-mujoco-verify.md +78 -0
- package/dist-skill/website/skills/forgecad-spec-by-walking-through-it.md +145 -0
- package/dist-skill/website/skills/forgecad-visual-spec.md +1 -1
- package/dist-skill/website/skills/forgecad.md +24 -24
- package/dist-skill/website/skills/index.md +2 -3
- package/examples/analysis/clearance-fit.forge.js +31 -0
- package/examples/analysis/lever-arm-actuator.forge.js +43 -0
- package/examples/analysis/tipping-tripod.forge.js +35 -0
- package/examples/products/sportscar.forge.js +77 -0
- package/package.json +1 -3
- package/dist/docs-raw/skills/forgecad-high-level-spec.md +0 -101
- package/dist/docs-raw/skills/forgecad-lld.md +0 -41
- package/dist/docs-raw/skills/forgecad-prepare-prompt.md +0 -63
- package/dist-skill/library/forgecad-high-level-spec/SKILL.md +0 -94
- package/dist-skill/library/forgecad-lld/SKILL.md +0 -34
- package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +0 -50
- package/dist-skill/website/skills/forgecad-high-level-spec.md +0 -101
- package/dist-skill/website/skills/forgecad-lld.md +0 -41
- package/dist-skill/website/skills/forgecad-prepare-prompt.md +0 -63
- /package/dist-skill/library/{forgecad-prepare-prompt → forgecad-spec-by-walking-through-it}/references/default-profiles.md +0 -0
- /package/dist-skill/library/{forgecad-prepare-prompt → forgecad-spec-by-walking-through-it}/references/master-prompt.md +0 -0
|
@@ -97,7 +97,7 @@ To verify installation, ask the agent:
|
|
|
97
97
|
What ForgeCAD skills are available?
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
You should see `forgecad` plus companion skills such as `forgecad-make-a-model`, `forgecad-render-inspect`, `forgecad-
|
|
100
|
+
You should see `forgecad` plus companion skills such as `forgecad-make-a-model`, `forgecad-render-inspect`, `forgecad-spec-by-walking-through-it`, and `forgecad-project`.
|
|
101
101
|
|
|
102
102
|
If you only want the core modeling skill without companion workflows:
|
|
103
103
|
|
|
@@ -205,9 +205,7 @@ For the full command reference, see [ForgeCAD CLI](../CLI.md).
|
|
|
205
205
|
| Skill | Use it for |
|
|
206
206
|
|---|---|
|
|
207
207
|
| `forgecad` | Core model authoring, editing, debugging, imports, assembly, render/export commands, and CLI validation. |
|
|
208
|
-
| `forgecad-
|
|
209
|
-
| `forgecad-high-level-spec` | Writing an HLD before modeling: requirements, alternatives, decisions, and open questions. |
|
|
210
|
-
| `forgecad-lld` | Writing the exact low-level model specification: dimensions, constraints, parameters, and verification criteria. |
|
|
208
|
+
| `forgecad-spec-by-walking-through-it` | Designing in a git-reviewed document before code: fuzzy-request intake and process choice, the HLD (requirements, alternatives, decisions), and the LLD (exact dimensions, constraints, parameters, verification). |
|
|
211
209
|
| `forgecad-make-a-model` | Creating a new `.forge.js` model in the active ForgeCAD project and validating it. |
|
|
212
210
|
| `forgecad-component-model` | Building or reviewing multi-file assemblies where parts build at origin and the parent assembly positions them through connectors. |
|
|
213
211
|
| `forgecad-blockout-model` | Making rough concept geometry to explore proportions, layout, motion envelope, or spatial intuition before detailed modeling. |
|
package/dist/docs-raw/CLI.md
CHANGED
|
@@ -265,7 +265,7 @@ forgecad render section model.forge.js --output out/section.svg --plane XZ --off
|
|
|
265
265
|
|
|
266
266
|
### Cross-cutting flags
|
|
267
267
|
|
|
268
|
-
These flags work across run
|
|
268
|
+
These flags work across script-backed run, render, export, capture, inspect, and check commands that evaluate `.forge.js` files. Use `--param Key=Value` for parameter overrides; repeat it for multiple parameters.
|
|
269
269
|
|
|
270
270
|
| Option | Description |
|
|
271
271
|
|--------|-------------|
|
|
@@ -306,39 +306,41 @@ Export to every format you need.
|
|
|
306
306
|
|
|
307
307
|
```bash
|
|
308
308
|
# Sheet material
|
|
309
|
-
forgecad cut-list shelf.forge.js
|
|
309
|
+
forgecad cut-list shelf.forge.js --param Material=plywood
|
|
310
310
|
forgecad export cutting-layout shelf.forge.js --sheet-width 420 --sheet-height 594 --kerf 3
|
|
311
311
|
forgecad export cutting-layout shelf.forge.js --output out/layout.dxf
|
|
312
312
|
|
|
313
313
|
# 3D printing
|
|
314
314
|
forgecad check print bracket.forge.js
|
|
315
|
-
forgecad export stl bracket.forge.js
|
|
315
|
+
forgecad export stl bracket.forge.js --param Width=42
|
|
316
316
|
forgecad export 3mf bracket.forge.js --quality high
|
|
317
317
|
|
|
318
318
|
# CAD interchange
|
|
319
|
-
forgecad export step bracket.forge.js
|
|
319
|
+
forgecad export step bracket.forge.js --param Width=42
|
|
320
320
|
|
|
321
321
|
# Technical drawings
|
|
322
322
|
forgecad export report bracket.forge.js --output out/report.pdf
|
|
323
323
|
|
|
324
324
|
# Robot simulation
|
|
325
325
|
forgecad export sdf rover.forge.js --output out/forge_scout
|
|
326
|
-
forgecad export mjcf rover.forge.js --output out/forge_scout_mjcf
|
|
326
|
+
forgecad export mjcf rover.forge.js --param Wheelbase=180 --output out/forge_scout_mjcf
|
|
327
327
|
forgecad export usd rover.forge.js --output out/forge_scout_usd
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
+
Script-backed exports accept repeatable `--param Key=Value` overrides before the model is evaluated. The MuJoCo/MJX package export command is `export mjcf`.
|
|
331
|
+
|
|
330
332
|
<details>
|
|
331
333
|
<summary>Export flags</summary>
|
|
332
334
|
|
|
333
335
|
| Option | Description |
|
|
334
336
|
|--------|-------------|
|
|
337
|
+
| `--param <Key=Value>` | Override a parameter value (Key=Value). Repeatable. |
|
|
338
|
+
| `-p <Key=Value>` | Shorthand for --param |
|
|
335
339
|
| `--joint <JointName=Value>` | Override a Motion tab joint value (JointName=Value). Repeatable. |
|
|
336
340
|
| `--output <path>` | Output SVG path for a single input |
|
|
337
341
|
| `--backend <occt\|truck>` | Exact BREP exporter: occt (default) or truck (native analytic kernel) |
|
|
338
342
|
| `--quality <default\|live\|high>` | Forge quality preset |
|
|
339
343
|
| `-o <path>` | Shorthand for --output |
|
|
340
|
-
| `--param <Key=Value>` | Override a parameter value (Key=Value). Repeatable. |
|
|
341
|
-
| `-p <Key=Value>` | Shorthand for --param |
|
|
342
344
|
| `--format <json\|webgpu-brick>` | Implicit artifact format |
|
|
343
345
|
| `-q <live\|default\|high>` | Shorthand for --quality |
|
|
344
346
|
| `--workgroup-size <x>x<y>x<z>` | WebGPU compute workgroup size |
|
package/dist/docs-raw/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Generated — do not edit
|
|
2
2
|
|
|
3
3
|
Everything in `docs/public/` is generated by `scripts/gen-public-docs.ts`:
|
|
4
|
-
docs are copied from `docs/
|
|
4
|
+
docs are copied from `docs/skill/` and `docs/internal/` per `docs/public-docs.json`, skill pages
|
|
5
5
|
from `dist-skill/website/skills/` (rendered out of `agent-skill-library/`), and
|
|
6
6
|
legal docs by `scripts/gen-legal-docs.ts`. Edit those sources instead.
|
|
@@ -5,7 +5,7 @@ skill-order: 4
|
|
|
5
5
|
|
|
6
6
|
# The Component Model
|
|
7
7
|
|
|
8
|
-
Long-form rationale for ForgeCAD's multi-part architecture. The enforceable rule sheet — anti-patterns, design gate, file-structure rules — lives in the `forgecad-component-model` skill (`agent-skill-library/forgecad-component-model/SKILL.md`). Connector and joint mechanics (frame semantics, mating, mirrored-revolute handedness) live in the assembly JSDoc, surfaced in `docs/
|
|
8
|
+
Long-form rationale for ForgeCAD's multi-part architecture. The enforceable rule sheet — anti-patterns, design gate, file-structure rules — lives in the `forgecad-component-model` skill (`agent-skill-library/forgecad-component-model/SKILL.md`). Connector and joint mechanics (frame semantics, mating, mirrored-revolute handedness) live in the assembly JSDoc, surfaced in `docs/skill/generated/assembly.md`.
|
|
9
9
|
|
|
10
10
|
## The Principle
|
|
11
11
|
|
|
@@ -373,7 +373,7 @@ return mech.solve({ theta: 45 });
|
|
|
373
373
|
|
|
374
374
|
#### `withSimulation(options: SimAssemblySimulationOptions): Assembly` — Attach the root simulation contract for this assembly.
|
|
375
375
|
|
|
376
|
-
Use this after adding physical parts and joints. Robot-body profiles require `rootPart`; asset profiles can describe one-part or multi-part physical assets. URDF/SDF exporters and `forgecad check simready` read this contract directly
|
|
376
|
+
Use this after adding physical parts and joints. Robot-body profiles require `rootPart`; asset profiles can describe one-part or multi-part physical assets. URDF/SDF/MJCF/USD exporters and `forgecad check simready` read this contract directly from the returned assembly.
|
|
377
377
|
|
|
378
378
|
`SimAssemblySimulationOptions`: `{ profile: SimProfileDef, rootPart?: string, controllers?: SimControllerDef[] }`
|
|
379
379
|
|
|
@@ -7,7 +7,7 @@ Every public API function belongs to one of 16 fundamental concepts. This is an
|
|
|
7
7
|
- **[C1: Primitive Construction](#c1-primitive-construction)** — Create geometry from parameters — no input geometry required. *(66 functions)*
|
|
8
8
|
- **[C2: Boolean Combination](#c2-boolean-combination)** — Combine same-dimension geometry using CSG set operations. *(6 functions)*
|
|
9
9
|
- **[C3: Rigid Transform](#c3-rigid-transform)** — Reposition or reorient geometry without changing its shape. *(0 functions)*
|
|
10
|
-
- **[C4: Dimensional Promotion](#c4-dimensional-promotion)** — Convert a 2D profile into a 3D solid (extrude, revolve, loft, sweep). *(
|
|
10
|
+
- **[C4: Dimensional Promotion](#c4-dimensional-promotion)** — Convert a 2D profile into a 3D solid (extrude, revolve, loft, sweep). *(50 functions)*
|
|
11
11
|
- **[C5: Topology Query](#c5-topology-query)** — Select or inspect named faces and edges on a shape. *(3 functions)*
|
|
12
12
|
- **[C6: Edge Feature](#c6-edge-feature)** — Modify edges of a solid — fillets, chamfers, draft, offset. *(4 functions)*
|
|
13
13
|
- **[C7: Pattern Replication](#c7-pattern-replication)** — Duplicate geometry in regular arrangements (linear, circular, mirror). *(6 functions)*
|
|
@@ -16,7 +16,7 @@ Every public API function belongs to one of 16 fundamental concepts. This is an
|
|
|
16
16
|
- **[C10: Assembly & Kinematics](#c10-assembly-kinematics)** — Compose parts with joints for kinematic simulation. *(15 functions)*
|
|
17
17
|
- **[C11: Parameterization & UI](#c11-parameterization-ui)** — Declare user-facing controls that drive model geometry. *(6 functions)*
|
|
18
18
|
- **[C12: Dimensional Demotion](#c12-dimensional-demotion)** — Extract 2D geometry from a 3D solid (section, projection). *(3 functions)*
|
|
19
|
-
- **[C13: Export & Output](#c13-export-output)** — Convert geometry to external formats (STL, 3MF, SVG, DXF, G-code, PDF). *(
|
|
19
|
+
- **[C13: Export & Output](#c13-export-output)** — Convert geometry to external formats (STL, 3MF, SVG, DXF, G-code, PDF). *(14 functions)*
|
|
20
20
|
- **[C14: Visual & Debugging](#c14-visual-debugging)** — Control viewport appearance and debugging aids. *(35 functions)*
|
|
21
21
|
- **[C15: Import & Composition](#c15-import-composition)** — Bring external geometry or other ForgeCAD modules into the current script. *(1 functions)*
|
|
22
22
|
- **[C16: Part Library](#c16-part-library)** — Pre-built parametric parts accessible via `lib.*`. *(4 functions)*
|
|
@@ -144,11 +144,13 @@ Convert a 2D profile into a 3D solid (extrude, revolve, loft, sweep).
|
|
|
144
144
|
- `Loft.withGuideRails(stations, rails, options?)` — Loft through profile stations while forcing generated sections to follow guide rails. → [curves](/docs/curves#curves-surfacing)
|
|
145
145
|
- `Analysis.EdgeContinuity(shape, options?)` → [curves](/docs/curves#analysis)
|
|
146
146
|
- `Analysis.SurfaceContinuity(shape, options?)` → [curves](/docs/curves#analysis)
|
|
147
|
+
- `Analysis.EdgeMatch(edgeA, edgeB, options?)` — Measure G0/G1/G2 agreement between two `Surface.Net` sheet edges: worst position gap, cross-boundary tangent angle (0 = G1), and normal-curvature mismatch (0 = G2). → [curves](/docs/curves#analysis)
|
|
147
148
|
- `Analysis.CurvatureComb(input, options?)` → [curves](/docs/curves#analysis)
|
|
148
149
|
- `Analysis.SurfaceHealth(shape, options?)` → [curves](/docs/curves#analysis)
|
|
149
150
|
- `Analysis.BRepValidity(shape, options?)` — Validate B-rep/shell/solid structure and return closedness, manifoldness, orientation, and issue diagnostics. → [curves](/docs/curves#analysis)
|
|
150
151
|
- `Blend.Edge(options)` → [curves](/docs/curves#blend)
|
|
151
152
|
- `Blend.Surface(options)` → [curves](/docs/curves#blend)
|
|
153
|
+
- `Blend.Bridge(edgeA, edgeB)` — Build a transition strip between two `Surface.Net` sheet edges. → [curves](/docs/curves#blend)
|
|
152
154
|
- `Surface.Plane(options)` — Create a finite analytic plane sheet that can be trimmed, sewn, thickened, or used as a low-level face. → [curves](/docs/curves#surface)
|
|
153
155
|
- `Surface.Cylinder(options)` — Create a finite analytic cylindrical sheet, optionally bounded by start/end angles. → [curves](/docs/curves#surface)
|
|
154
156
|
- `Surface.Cone(options)` — Create a finite analytic conical or frustum sheet, optionally bounded by start/end angles. → [curves](/docs/curves#surface)
|
|
@@ -165,6 +167,7 @@ Convert a 2D profile into a 3D solid (extrude, revolve, loft, sweep).
|
|
|
165
167
|
- `Surface.Trim(shape, tool)` → [curves](/docs/curves#surface)
|
|
166
168
|
- `Surface.Split(shape, tool)` → [curves](/docs/curves#surface)
|
|
167
169
|
- `Surface.Match(shape, options)` → [curves](/docs/curves#surface)
|
|
170
|
+
- `Surface.Net()` — Begin a curve-network (Gordon) surface — the class-A keystone. → [curves](/docs/curves#surface)
|
|
168
171
|
- `loft(profiles, heights, options?)` — Loft between multiple sketches along Z stations. → [curves](/docs/curves#loft)
|
|
169
172
|
- `sweep(profile, path, options?)` → [curves](/docs/curves#sweep)
|
|
170
173
|
- `variableSweep(spine, sections, options?)` — Sweep a variable cross-section along a 3D spine curve. → [curves](/docs/curves#variablesweep)
|
|
@@ -286,7 +289,6 @@ Convert geometry to external formats (STL, 3MF, SVG, DXF, G-code, PDF).
|
|
|
286
289
|
- `Laser.lookupKerf(material, thickness, laserType?)` — Look up kerf for a material + thickness + laser combo in `Laser.COMMON_KERFS`. → [sheet-metal](/docs/sheet-metal#laser)
|
|
287
290
|
- `Laser.COMMON_KERFS` — Common full-kerf values by material, thickness, and laser type. → [sheet-metal](/docs/sheet-metal#laser)
|
|
288
291
|
- `bom(quantity, description, opts?)` — Register a Bill of Materials entry for report export. → [output](/docs/output#bom)
|
|
289
|
-
- `robotExport(options)` — Compatibility shim for SDF/URDF robot package metadata. → [output](/docs/output#robotexport)
|
|
290
292
|
- `sheetMetal(options)` — Create a parametric sheet metal part with flanges, bend allowances, and flat-pattern unfolding. → [sheet-metal](/docs/sheet-metal#sheetmetal)
|
|
291
293
|
- `sketchToDxf(sketch, options?)` — Export a 2D sketch as a DXF string (R12/AC1009 — maximally compatible). → [output](/docs/output#sketchtodxf)
|
|
292
294
|
- `sketchToSvg(sketch, options?)` — Export a 2D sketch as an SVG string. → [output](/docs/output#sketchtosvg)
|
|
@@ -24,6 +24,10 @@ skill-order: 100
|
|
|
24
24
|
- [SurfacePattern](#surfacepattern)
|
|
25
25
|
- [Pattern2D](#pattern2d)
|
|
26
26
|
- [Pattern2DBuilder](#pattern2dbuilder)
|
|
27
|
+
- [Sheet](#sheet)
|
|
28
|
+
- [CurveNetBuilder](#curvenetbuilder)
|
|
29
|
+
- [MatchEdgeBuilder](#matchedgebuilder)
|
|
30
|
+
- [BridgeBuilder](#bridgebuilder)
|
|
27
31
|
- [ShapeRef](#shaperef)
|
|
28
32
|
- [ANCHOR3D_NAMES](#anchor3d-names)
|
|
29
33
|
- [verify](#verify)
|
|
@@ -708,7 +712,7 @@ Supports transforms (translate, rotate, scale, mirror, transform, rotateAround,
|
|
|
708
712
|
|
|
709
713
|
Returns a new Shape with the specified material properties merged on top of any previously set properties. All properties are optional — omitted keys retain their current value. Material properties survive transforms and boolean operations.
|
|
710
714
|
|
|
711
|
-
Use `.color()` to set the base diffuse color; `.material()` controls how that color behaves under light (metalness, roughness, clearcoat) and can add emissive glow independent of lighting.
|
|
715
|
+
Use `.color()` to set the base diffuse color; `.material()` controls how that color behaves under light (metalness, roughness, clearcoat) and can add emissive glow independent of lighting.
|
|
712
716
|
|
|
713
717
|
```js
|
|
714
718
|
box(50, 50, 50).material({ metalness: 0.9, roughness: 0.1 }); // polished metal
|
|
@@ -1333,6 +1337,71 @@ const bracket = group(
|
|
|
1333
1337
|
| `depth?` | `number` | Thread groove depth in millimeters. Default: 0.8. |
|
|
1334
1338
|
| `underScale?` | `number` | Relative height of the under-crossing thread. Default: 0.15. |
|
|
1335
1339
|
|
|
1340
|
+
### `Sheet`
|
|
1341
|
+
|
|
1342
|
+
A parametric open surface value (control grid + knots + analytic differential geometry).
|
|
1343
|
+
|
|
1344
|
+
**Properties:**
|
|
1345
|
+
|
|
1346
|
+
| Property | Type | Description |
|
|
1347
|
+
|----------|------|-------------|
|
|
1348
|
+
| `surface` | `BSplineSurface` | — |
|
|
1349
|
+
|
|
1350
|
+
**Methods:**
|
|
1351
|
+
|
|
1352
|
+
#### `get frontEdge(): SheetEdge` — Edge naming follows parameter direction (documented): front=v0, rear=v1, left=u0, right=u1.
|
|
1353
|
+
|
|
1354
|
+
#### `thicken(wall: number, options?: { resolution?: number; }): Shape` — Offset the sheet along its analytic normals into a watertight solid shell of the given wall thickness. Throws if the wall would self-intersect on a concave region (no silent degenerate solid).
|
|
1355
|
+
|
|
1356
|
+
#### `matchEdge(edge: SheetEdge): MatchEdgeBuilder` — Per-edge continuity match against a neighbor (returns a NEW Sheet).
|
|
1357
|
+
|
|
1358
|
+
**`SheetEdge`**
|
|
1359
|
+
- `fixed: "u" | "v"` — Which parameter is held fixed along this edge.
|
|
1360
|
+
- `value: 0 | 1` — The fixed value (0 or 1).
|
|
1361
|
+
- Also: `sheet: Sheet`.
|
|
1362
|
+
|
|
1363
|
+
- `get rearEdge(): SheetEdge`
|
|
1364
|
+
- `get leftEdge(): SheetEdge`
|
|
1365
|
+
- `get rightEdge(): SheetEdge`
|
|
1366
|
+
- `pointAt(u: number, v: number): Vec3`
|
|
1367
|
+
- `normalAt(u: number, v: number): Vec3`
|
|
1368
|
+
- `curvatureAt(u: number, v: number): SurfaceCurvature`
|
|
1369
|
+
|
|
1370
|
+
### `CurveNetBuilder`
|
|
1371
|
+
|
|
1372
|
+
#### `toSheet(): Sheet` — Build (once) and return the Sheet.
|
|
1373
|
+
|
|
1374
|
+
- `lengthwise(...curves: CurveInput[]): this`
|
|
1375
|
+
- `crosswise(...curves: CurveInput[]): this`
|
|
1376
|
+
- `alongRails(railA: CurveInput, railB: CurveInput): this`
|
|
1377
|
+
- `sections(...curves: CurveInput[]): this`
|
|
1378
|
+
- `cage(grid: Vec3[][]): this`
|
|
1379
|
+
- `degree(u: number, v: number): this`
|
|
1380
|
+
- `get frontEdge(): SheetEdge`
|
|
1381
|
+
- `get rearEdge(): SheetEdge`
|
|
1382
|
+
- `get leftEdge(): SheetEdge`
|
|
1383
|
+
- `get rightEdge(): SheetEdge`
|
|
1384
|
+
- `get surface(): BSplineSurface`
|
|
1385
|
+
- `pointAt(u: number, v: number): Vec3`
|
|
1386
|
+
- `normalAt(u: number, v: number): Vec3`
|
|
1387
|
+
- `curvatureAt(u: number, v: number): SurfaceCurvature`
|
|
1388
|
+
- `thicken(wall: number, options?: { resolution?: number; }): Shape`
|
|
1389
|
+
- `matchEdge(edge: SheetEdge): MatchEdgeBuilder`
|
|
1390
|
+
|
|
1391
|
+
### `MatchEdgeBuilder`
|
|
1392
|
+
|
|
1393
|
+
- `toG0(neighbor: SheetEdge): Sheet`
|
|
1394
|
+
- `toG1(neighbor: SheetEdge): Sheet`
|
|
1395
|
+
- `toG2(neighbor: SheetEdge): Sheet`
|
|
1396
|
+
|
|
1397
|
+
### `BridgeBuilder`
|
|
1398
|
+
|
|
1399
|
+
#### `bulge(a: number, b: number): this` — Tune the influence of each side (Rhino-style bulge).
|
|
1400
|
+
|
|
1401
|
+
- `g0(): Sheet`
|
|
1402
|
+
- `g1(): Sheet`
|
|
1403
|
+
- `g2(): Sheet`
|
|
1404
|
+
|
|
1336
1405
|
### `ShapeRef`
|
|
1337
1406
|
|
|
1338
1407
|
A first-class reference path over a shape's semantic faces and face relationships.
|
|
@@ -429,7 +429,11 @@ const outlet = route.port("outlet");
|
|
|
429
429
|
|
|
430
430
|
#### `pointAt(u: number, v: number): Vec3` — Evaluate the surface at parameters (u, v) ∈ [0, 1]². Uses tensor product evaluation: evaluate basis functions in U and V independently.
|
|
431
431
|
|
|
432
|
-
#### `normalAt(u: number, v: number): Vec3` — Evaluate the surface normal at (u, v)
|
|
432
|
+
#### `normalAt(u: number, v: number): Vec3` — Evaluate the surface unit normal at (u, v) from analytic first derivatives.
|
|
433
|
+
|
|
434
|
+
Uses Algorithm A2.3 basis-function derivatives with the rational quotient rule, so the normal is exact (no finite-difference epsilon, no error near the boundary). Constant chain-rule factors from the parameter remap scale Su and Sv positively and cancel under normalization, so they are omitted.
|
|
435
|
+
|
|
436
|
+
#### `derivativesAt(u: number, v: number): { S: Vec3; Su: Vec3; Sv: Vec3; }` — Analytic first partial derivatives S_u, S_v (rational quotient rule).
|
|
433
437
|
|
|
434
438
|
#### `tessellate(resU?: number, resV?: number): { positions: Vec3[]; normals: Vec3[]; indices: number[]; }` — Tessellate the surface into a triangle mesh. Returns positions, normals, and triangle indices.
|
|
435
439
|
|
|
@@ -1169,16 +1173,19 @@ Members (full entries under [Curves & Surfacing](#curves-surfacing)): `Curve.Ble
|
|
|
1169
1173
|
- `Trim(shape: Shape, tool: Shape | SurfacePlaneOp): Shape`
|
|
1170
1174
|
- `Split(shape: Shape, tool: Shape | SurfacePlaneOp): [ Shape, Shape ]`
|
|
1171
1175
|
- `Match(shape: Shape, options: { edge: "u0" | "u1" | "v0" | "v1"; target: EdgeRef; continuity?: SurfaceContinuity; }): Shape`
|
|
1176
|
+
- `Net(): CurveNet` — Begin a curve-network (Gordon) surface — the class-A keystone. Chain `.lengthwise(...)/.crosswise(...)` (or `.alongRails(a,b).sections(...)`, or `.cage(grid)`), then `.thicken(wall)` to get a solid Shape. Returns a fluent [`Sheet`](/docs/core#sheet) builder with analytic point/normal/curvature queries and named edges.
|
|
1172
1177
|
|
|
1173
1178
|
### `Blend`
|
|
1174
1179
|
|
|
1175
1180
|
- `Edge(options: BlendEdgeOptions): Shape`
|
|
1176
1181
|
- `Surface(options: BlendSurfaceOptions): Shape`
|
|
1182
|
+
- `Bridge(edgeA: SheetEdge, edgeB: SheetEdge): BridgeBuilder` — Build a transition strip between two `Surface.Net` sheet edges. Chain `.bulge(a, b)` then `.g0()/.g1()/.g2()` for the continuity order. Returns a [`Sheet`](/docs/core#sheet); verify the seam with `Analysis.EdgeMatch`.
|
|
1177
1183
|
|
|
1178
1184
|
### `Analysis`
|
|
1179
1185
|
|
|
1180
1186
|
- `EdgeContinuity(shape: Shape, options?: EdgeContinuityThresholds): EdgeContinuityReport`
|
|
1181
1187
|
- `SurfaceContinuity(shape: Shape, options?: EdgeContinuityThresholds): EdgeContinuityReport`
|
|
1188
|
+
- `EdgeMatch(edgeA: SheetEdge, edgeB: SheetEdge, options?: { samples?: number; }): ContinuityReport` — Measure G0/G1/G2 agreement between two `Surface.Net` sheet edges: worst position gap, cross-boundary tangent angle (0 = G1), and normal-curvature mismatch (0 = G2). The reflection/fairness check for matched panel seams.
|
|
1182
1189
|
- `CurvatureComb(input: NurbsCurve3D | EdgeRef, options?: { samples?: number; }): CurvatureSample[]`
|
|
1183
1190
|
- `SurfaceHealth(shape: Shape, options?: { tinyEdgeThreshold?: number; sliverThreshold?: number; }): SurfaceHealthReport`
|
|
1184
1191
|
- `BRepValidity(shape: Shape, options?: BRepValidityOptions): BRepValidityReport` — Validate B-rep/shell/solid structure and return closedness, manifoldness, orientation, and issue diagnostics.
|
|
@@ -58,70 +58,6 @@ bom(tubeLen, "rectangular steel tube", {
|
|
|
58
58
|
| `notes?` | `string` | Free-form notes |
|
|
59
59
|
| `grain?` | `string` | Wood grain direction, e.g. "long", "cross" |
|
|
60
60
|
|
|
61
|
-
#### `robotExport(options: RobotExportOptions): CollectedRobotExport` — Compatibility shim for SDF/URDF robot package metadata.
|
|
62
|
-
|
|
63
|
-
Prefer returning `assembly(...).withSimulation(...)` with `Sim.body(...)`, `Sim.drive.*(...)`, and `Sim.controller.*(...)` metadata. The CLI commands `forgecad export sdf` and `forgecad export urdf` now read that assembly simulation contract directly.
|
|
64
|
-
|
|
65
|
-
`robotExport()` remains available for one compatibility window. It converts the legacy descriptor into the same internal simulation model used by source-authored `Sim` metadata and produces a robot package with:
|
|
66
|
-
|
|
67
|
-
- Mesh-based inertia tensors (full 6-component, not bounding-box approximations)
|
|
68
|
-
- Separate collision meshes
|
|
69
|
-
- Joint limits, effort/velocity/damping/friction metadata from assembly joints
|
|
70
|
-
|
|
71
|
-
**Collision mesh modes** (set per-link via `links["PartName"].collision`):
|
|
72
|
-
|
|
73
|
-
| Mode | Description | Default |
|
|
74
|
-
|------|-------------|---------|
|
|
75
|
-
| `'convex'` | Convex hull (separate `_collision.stl`) | Yes |
|
|
76
|
-
| `'box'` | AABB primitive — fastest physics | |
|
|
77
|
-
| `'visual'` | Same mesh as visual — exact but slow | |
|
|
78
|
-
| `'none'` | No collision geometry | |
|
|
79
|
-
|
|
80
|
-
**Unit conventions:**
|
|
81
|
-
|
|
82
|
-
- Revolute `velocity` is in degrees/second in Forge; exporters convert to rad/s.
|
|
83
|
-
- Prismatic distances are in mm in Forge; exported in meters.
|
|
84
|
-
- `massKg` is preferred; `densityKgM3` is used when mass is unknown.
|
|
85
|
-
- Compatibility coupling metadata, when present, maps only the primary term (largest ratio) to `<mimic>` — SDF/URDF support single-leader mimic only. Dropped terms emit a warning.
|
|
86
|
-
|
|
87
|
-
**Legacy example**
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
robotExport({
|
|
91
|
-
assembly: rover, // assembly() with parts + revolute wheel joints
|
|
92
|
-
modelName: "Scout",
|
|
93
|
-
links: { Chassis: { massKg: 10 }, "Left Wheel": { massKg: 0.8 } },
|
|
94
|
-
plugins: {
|
|
95
|
-
diffDrive: {
|
|
96
|
-
leftJoints: ["leftWheel"], rightJoints: ["rightWheel"],
|
|
97
|
-
wheelSeparationMm: 280, wheelRadiusMm: 60,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
world: { generateDemoWorld: true },
|
|
101
|
-
});
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**Preferred CLI usage**
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
forgecad export sdf model.forge.js # SDF package (Gazebo/Ignition)
|
|
108
|
-
forgecad export urdf model.forge.js # URDF package (ROS/PyBullet/MuJoCo)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**`RobotExportOptions`**: `assembly: Assembly`, `modelName?: string`, `state?: JointState`, `static?: boolean`, `selfCollide?: boolean`, `allowAutoDisable?: boolean`, `links?: Record<string, RobotLinkExportOptions>`, `joints?: Record<string, RobotJointExportOptions>`, `plugins?: { diffDrive?: RobotDiffDrivePluginOptions; jointStatePublisher?: RobotJointStatePublisherOptions; }`, `world?: RobotWorldOptions`
|
|
112
|
-
|
|
113
|
-
`RobotLinkExportOptions`: `{ massKg?: number, densityKgM3?: number, collision?: "visual" | "convex" | "box" | "none" }`
|
|
114
|
-
|
|
115
|
-
`RobotJointExportOptions`: `{ effort?: number, velocity?: number, damping?: number, friction?: number }`
|
|
116
|
-
|
|
117
|
-
**`RobotDiffDrivePluginOptions`**: `leftJoints: string[]`, `rightJoints: string[]`, `wheelSeparationMm: number`, `wheelRadiusMm: number`, `topic?: string`, `odomTopic?: string`, `tfTopic?: string`, `frameId?: string`, `odomFrameId?: string`, `maxLinearVelocity?: number`, `maxAngularVelocity?: number`, `linearAcceleration?: number`, `angularAcceleration?: number`
|
|
118
|
-
|
|
119
|
-
`RobotJointStatePublisherOptions`: `{ enabled?: boolean, joints?: string[], topic?: string, updateRate?: number }`
|
|
120
|
-
|
|
121
|
-
`RobotWorldOptions`: `{ name?: string, generateDemoWorld?: boolean, spawnPose?: RobotPose6, keyboardTeleop?: RobotWorldKeyboardTeleopOptions }`
|
|
122
|
-
|
|
123
|
-
`RobotWorldKeyboardTeleopOptions`: `{ enabled?: boolean, linearStep?: number, angularStep?: number }`
|
|
124
|
-
|
|
125
61
|
#### `dim()` — Add a dimension annotation between two points, or along an entity.
|
|
126
62
|
|
|
127
63
|
Overloads:
|
|
@@ -24,12 +24,12 @@ lib, Line2D, linearPattern, linearPattern2d, loadFont, loft, Loft, mirrorCopy
|
|
|
24
24
|
mock, ngon, NurbsCurve3D, NurbsSurface, offsetSolid, param, Param, path
|
|
25
25
|
Point2D, Points, polygon, polygonVertices, port, Product, ProductPanelBuilder, ProductRibbonBuilder
|
|
26
26
|
ProductSkin, ProductSkinBuilder, ProductStationBuilder, ProductSurfaceBuilder, ProductSurfaceRef, projectToPlane, queueMicrotask, rect
|
|
27
|
-
Rectangle2D,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
Rectangle2D, roundedRect, Route3D, scene, Sculpt, sdf, SdfShape, selectEdge
|
|
28
|
+
selectEdges, self, setActiveBackend, setImmediate, setInterval, setTimeout, Shape, ShapeGroup
|
|
29
|
+
sheetMetal, SheetMetalPart, sheetStock, Sim, Sketch, sketchToDxf, sketchToSvg, slot
|
|
30
|
+
SolvedAssembly, spec, sphere, spline2d, stroke, Surface, SurfaceBody, SurfaceMembers
|
|
31
|
+
sweep, text2d, textWidth, torus, toShape, Transform, union, union2d
|
|
32
|
+
variableSweep, verify, Viewport, window, Wood
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
<!-- forgecad-skill:exclude-start symbol="compatibility runtime names" reason="Compatibility-only renamed runtime globals." -->
|
|
@@ -79,7 +79,7 @@ return b;
|
|
|
79
79
|
|
|
80
80
|
#### `scene(options: SceneOptions): void` — Configure the scene environment for the current script execution.
|
|
81
81
|
|
|
82
|
-
Controls camera, named render views, guided journeys, lighting, background, fog, environment maps,
|
|
82
|
+
Controls camera, named render views, guided journeys, lighting, background, fog, environment maps, capture defaults, and the joint-control helper overlay (`jointOverlay` — axis arrows and arc indicators, renderer-only). Multiple `scene()` calls merge per-key — later values win — so configuration can be split across calls.
|
|
83
83
|
|
|
84
84
|
Two behavioral cliffs:
|
|
85
85
|
|
|
@@ -90,7 +90,7 @@ Named views are repeatable cameras checked in with the model code. Canonical sha
|
|
|
90
90
|
|
|
91
91
|
Journeys are ordered `steps`, each focusing a returned object by name/tree path with an optional caption and camera. In the viewer they are opt-in (an Explore control; the camera does not move until started). Inspect resolved targets with `forgecad run --journeys`.
|
|
92
92
|
|
|
93
|
-
Post-processing
|
|
93
|
+
Post-processing is disabled for now while the browser EffectComposer flicker path is being rebuilt. Existing scripts that pass `postProcessing` continue running, but the option is not part of the active scene API.
|
|
94
94
|
|
|
95
95
|
All numeric values accept `param()` expressions.
|
|
96
96
|
|
|
@@ -109,7 +109,6 @@ scene({
|
|
|
109
109
|
{ type: 'directional', position: [50, -30, 200], color: '#ffd60a', intensity: 1.2 },
|
|
110
110
|
],
|
|
111
111
|
fog: { color: '#000814', near: 100, far: 450 },
|
|
112
|
-
postProcessing: { bloom: { intensity: param('bloom', 1.5, 0, 4) } },
|
|
113
112
|
jointOverlay: { axisColor: '#13dfff', arcColor: '#ff7a1a' },
|
|
114
113
|
});
|
|
115
114
|
```
|
|
@@ -120,7 +119,7 @@ scene({
|
|
|
120
119
|
|--------|------|-------------|
|
|
121
120
|
| `capture?` | `SceneCaptureConfig` | Default capture parameters for `forgecad capture` — CLI flags override these. |
|
|
122
121
|
|
|
123
|
-
Also: `background?: string | SceneBackgroundGradient`, `camera?: SceneCameraConfig`, `views?: Record<string, SceneViewInputConfig>`, `journeys?: Record<string, SceneJourneyConfig>`, `lights?: SceneLightConfig[]`, `environment?: SceneEnvironmentConfig`, `fog?: SceneFogConfig`, `
|
|
122
|
+
Also: `background?: string | SceneBackgroundGradient`, `camera?: SceneCameraConfig`, `views?: Record<string, SceneViewInputConfig>`, `journeys?: Record<string, SceneJourneyConfig>`, `lights?: SceneLightConfig[]`, `environment?: SceneEnvironmentConfig`, `fog?: SceneFogConfig`, `ground?: SceneGroundConfig`.
|
|
124
123
|
|
|
125
124
|
`SceneBackgroundGradient`: `{ top: string, bottom: string }`
|
|
126
125
|
|
|
@@ -174,14 +173,6 @@ Also: `type: SceneLightType`, `color?: string`, `intensity?: number`, `position?
|
|
|
174
173
|
- `density?: number` — Exponential fog density (if set, uses FogExp2 instead of linear Fog)
|
|
175
174
|
- Also: `color?: string`.
|
|
176
175
|
|
|
177
|
-
`ScenePostProcessingConfig`: `{ bloom?: SceneBloomConfig, vignette?: SceneVignetteConfig, grain?: SceneGrainConfig, toneMappingExposure?: number }`
|
|
178
|
-
|
|
179
|
-
`SceneBloomConfig`: `{ intensity?: number, threshold?: number, radius?: number }`
|
|
180
|
-
|
|
181
|
-
`SceneVignetteConfig`: `{ darkness?: number, offset?: number }`
|
|
182
|
-
|
|
183
|
-
`SceneGrainConfig`: `{ intensity?: number }`
|
|
184
|
-
|
|
185
176
|
**`SceneGroundConfig`**
|
|
186
177
|
|
|
187
178
|
| Option | Type | Description |
|
|
@@ -5,7 +5,7 @@ skill-order: 2
|
|
|
5
5
|
|
|
6
6
|
# Inspection Bundles — Evidence Contract
|
|
7
7
|
|
|
8
|
-
`forgecad inspect <family> <mode>` writes a deterministic bundle: evidence PNGs under `evidence/<type>/` plus a root `manifest.json`. **The manifest is the authoritative contract** — take file paths, encodings, per-view ranges, thresholds, tolerances, and identity maps from it; never hard-code bundle layout or infer object identity from object order. The PNGs are a visual index for locating findings, not standalone artifacts. Command tree, flags, and `--focus`/`--hide` filtering live in `docs/
|
|
8
|
+
`forgecad inspect <family> <mode>` writes a deterministic bundle: evidence PNGs under `evidence/<type>/` plus a root `manifest.json`. **The manifest is the authoritative contract** — take file paths, encodings, per-view ranges, thresholds, tolerances, and identity maps from it; never hard-code bundle layout or infer object identity from object order. The PNGs are a visual index for locating findings, not standalone artifacts. Command tree, flags, and `--focus`/`--hide` filtering live in `docs/skill/CLI.md` and `forgecad inspect evidence`; the inspection workflow lives in the `forgecad-render-inspect` skill. Model-authored `scene()` background, lights, fog, and exposure are ignored for inspection captures so evidence stays stable; named scene views remain available via `--view`.
|
|
9
9
|
|
|
10
10
|
Manifest evidence keys are evidence-oriented and stable for bundle readers: e.g. `fit interference` writes `manifest.evidence.collisions`, `physical components` writes `manifest.evidence.connectivity`.
|
|
11
11
|
|
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
ForgeCAD should make a robot or simulated asset runnable without making the CAD API own the control algorithm.
|
|
4
4
|
|
|
5
|
+
## Native Analysis: The Closed Feedback Loop
|
|
6
|
+
|
|
7
|
+
Some analyses need no external simulator at all — they are computed directly from the model geometry and return a machine-readable feedback report an AI agent (or you) can act on. This is the simulation feedback cycle in its simplest, fastest form: **edit the `.forge.js` → run the analysis → read the metrics → change a parameter → re-run.**
|
|
8
|
+
|
|
9
|
+
Every native analysis emits the same `forgecad.feedback/v1` contract: name-keyed `metrics` each with a `pass`/`warn`/`fail` status, `findings` that carry an actionable `suggest`, and a `trust` block recording the assumptions behind the numbers.
|
|
10
|
+
|
|
11
|
+
### Mass properties
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node dist-cli/forgecad.js sim mass model.forge.js --density 2700 --json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Reports volume, mass, surface area, bounding box, center of mass, the full inertia tensor about the center of mass, principal moments and axes, and a per-object breakdown. Volume, center of mass, and principal axes are exact regardless of material; pass `--density <kg/m3>` (e.g. `2700` aluminium, `7850` steel, `1240` ABS) for accurate mass and inertia magnitude — otherwise it defaults to water and says so.
|
|
18
|
+
|
|
19
|
+
### Static stability (tip-over)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node dist-cli/forgecad.js check stability model.forge.js --min-margin-mm 5 --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Computes the center of mass, derives the support footprint as the convex hull of the lowest geometry, and reports the **signed tip-over margin** (distance from the CoM projection to the footprint edge — negative means it tips), the tilt angle at which it tips, the critical edge, and the **center-of-mass shift needed** to reach the required margin. Exits non-zero when the margin is below `--min-margin-mm`. Use `--up x|y|z` to set the up axis.
|
|
26
|
+
|
|
27
|
+
A worked closed loop ships in `examples/analysis/tipping-tripod.forge.js`: at the default base the rig tips by about 3 mm, the report points the fix in −X, and `--param BaseSpreadMm=90` recovers a comfortable positive margin.
|
|
28
|
+
|
|
29
|
+
### Tolerance / GD&T stack-up
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
node dist-cli/forgecad.js sim tolerance model.forge.js --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Treats the model's continuous parameters as the varying manufacturing inputs and its numeric `verify.*` results as the measured responses — so ordinary `param(...)` and `verify.inRange(...)` calls already declare the stack-up, with no special API. It builds a finite-difference Jacobian, runs a deterministic Monte Carlo over the linearized surrogate, and reports per-response mean/sigma, Cp/Cpk, yield % and DPMO, worst-case and RSS envelopes, a ranked variance-contribution list (**which dimension to tighten**), and a tolerance-allocation recommendation to reach the target Cpk. A nonlinearity guard errors (pointing you to `--method full-rebuild`) rather than silently reporting a wrong yield; exits non-zero when any response's Cpk is below `--target-cpk` (default 1.33).
|
|
36
|
+
|
|
37
|
+
A worked closed loop ships in `examples/analysis/clearance-fit.forge.js`: the default (loose) bores hold the clearance spec at only ~84% yield, the report names the dominant dimension, and `--tol BoreDia=±0.05 --tol ShaftDia=±0.05` lifts Cpk above 1.33.
|
|
38
|
+
|
|
39
|
+
### Mechanism budget (DOF + static-hold torque)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node dist-cli/forgecad.js sim mechanism model.forge.js --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The deterministic budget tier of rigid-body dynamics, computed straight from the assembly joint graph — no external solver, no time-stepping. It reports the actuated degrees of freedom (with a spatial Grübler mobility diagnostic for closed loops) and, for each actuated joint, the gravity-hold torque (revolute) or force (prismatic) it must supply at the current pose, derived from the mass of everything distal to it. When a joint carries a `Sim.drive` effort, the report includes the budget margin and flags over-budget joints. Use `--joint Name=Value` to evaluate a specific pose. The dynamic/contact tier (RL, collisions) is the external Pinocchio/MuJoCo export.
|
|
46
|
+
|
|
47
|
+
A worked closed loop ships in `examples/analysis/lever-arm-actuator.forge.js`: a 1 kg arm at 0.15 m needs 1.47 N·m (= m·g·r) and holds with ~63% margin against its 4 N·m motor; `--param ArmLength=900` pushes it to 4.4 N·m and trips `MECHANISM.HOLD.OVER_BUDGET`.
|
|
48
|
+
|
|
49
|
+
### Rigid-body dynamics export (Pinocchio)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
node dist-cli/forgecad.js export pinocchio model.forge.js --output out/robot_pinocchio
|
|
53
|
+
cd out/robot_pinocchio && uv run --python 3.11 --with pin --with numpy python scripts/run_pinocchio.py
|
|
54
|
+
node dist-cli/forgecad.js sim dynamics out/robot_pinocchio
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The dynamic tier. `export pinocchio` reuses the URDF package (per-link inertials computed from the solid) and adds a runnable Pinocchio harness. `run_pinocchio.py` builds the model with `pin.buildModelFromUrdf`, sweeps each joint, computes the gravity-hold torque with `pin.computeGeneralizedGravity`, and writes `feedback.json` in the same `forgecad.feedback/v1` contract; `sim dynamics` reads it back. Pinocchio (BSD-2-Clause) and Coal (BSD-3-Clause) are user-installed — `pip install pin coal` on Linux/macOS, conda-forge on Windows — never bundled.
|
|
58
|
+
|
|
59
|
+
This closes the same loop as `sim mechanism` and cross-checks it: on the lever-arm example, Pinocchio reports the same 1.47 N·m shoulder hold torque the native tier computes analytically.
|
|
60
|
+
|
|
61
|
+
See [docs/internal/simulation-feedback-cycle.md](./simulation-feedback-cycle.md) for the full strategy across all simulation categories.
|
|
62
|
+
|
|
5
63
|
The source `.forge.js` model owns geometry, assembly structure, physical metadata, joints, drive intent, contact hints, and the neutral simulation contract. Exported packages then generate an editable simulator lab with all names and wiring connected. Rewards, policies, perturbation tests, curriculum, and RL libraries stay in simulator-side code.
|
|
6
64
|
|
|
7
65
|
## Current Path: ForgeCAD To MuJoCo
|
|
@@ -18,7 +18,7 @@ A blockout is a spatial planning artifact: 3-7 simple masses that answer where p
|
|
|
18
18
|
| Need | Skill |
|
|
19
19
|
|------|-------|
|
|
20
20
|
| High-level 3D idea using simple masses | `forgecad-blockout-model` |
|
|
21
|
-
| Written concept or architecture before CAD | `forgecad-
|
|
21
|
+
| Written concept or architecture before CAD | `forgecad-spec-by-walking-through-it` |
|
|
22
22
|
| Accurate, detailed, parametric ForgeCAD model | `forgecad-make-a-model` |
|
|
23
23
|
|
|
24
24
|
### Method
|
|
@@ -18,7 +18,7 @@ The reference image is evidence, not the deliverable. The deliverable is a real
|
|
|
18
18
|
### Companion Skills
|
|
19
19
|
|
|
20
20
|
- `forgecad` — API docs, model authoring, renderer behavior.
|
|
21
|
-
- `forgecad-
|
|
21
|
+
- `forgecad-spec-by-walking-through-it` — when the images underdetermine artifact family, process posture, scale, operating story, or validation boundary.
|
|
22
22
|
- `forgecad-make-a-model` — file placement, project structure, decomposition, definition of done.
|
|
23
23
|
- `forgecad-render-inspect` — pre-delivery inspection for multi-part, internal, mechanical, thin-wall, or fit-sensitive objects.
|
|
24
24
|
|
|
@@ -30,7 +30,7 @@ Infer the real object before matching any camera — identity, manufacture, scal
|
|
|
30
30
|
|
|
31
31
|
1. Stage references in `/tmp/<slug>-replicate/refs`, keeping originals and adding view names where possible (`front`, `side`, `rear-iso`, `top`, `detail`).
|
|
32
32
|
2. Read each image as evidence, recording: visible facts; scale cues; camera cues; unknowns (hidden/occluded geometry); conflicts across images or stylization.
|
|
33
|
-
3. Write a Real Object Brief — a hard gate before modeling: (a) artifact identity + operating story; (b) assumed scale and units; (c) process posture + part/BOM boundary (real geometry vs purchased vs ghost vs omitted); (d) inferred hidden-side geometry + expected canonical front/back/left/right/top/bottom forms; (e) validation views and inspection evidence. Use `forgecad-
|
|
33
|
+
3. Write a Real Object Brief — a hard gate before modeling: (a) artifact identity + operating story; (b) assumed scale and units; (c) process posture + part/BOM boundary (real geometry vs purchased vs ghost vs omitted); (d) inferred hidden-side geometry + expected canonical front/back/left/right/top/bottom forms; (e) validation views and inspection evidence. Use `forgecad-spec-by-walking-through-it` when these are underdetermined.
|
|
34
34
|
4. Build a coarse 3D blockout — model the object, not the image: large volumes, axes, symmetry, side depth, rear form, underside, hidden continuations. Render canonical views before any reference-camera comparison. Follow `forgecad-make-a-model` for project structure.
|
|
35
35
|
5. Calibrate one camera per usable reference, only after the blockout makes sense from canonical views. Use the object center as `target`; estimate azimuth/elevation/distance/FOV from visible faces and perspective cues; use orthographic when parallel edges stay parallel with no perspective convergence.
|
|
36
36
|
6. Render comparison boards: render the model from each calibrated reference camera and place it next to the original. Never compare from memory.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-mujoco-verify/SKILL.md instead. -->
|
|
2
|
+
|
|
3
|
+
# forgecad-mujoco-verify
|
|
4
|
+
|
|
5
|
+
Verify ForgeCAD MJCF exports in MuJoCo with real dynamics, contacts, root behavior, controls, required joint travel, and rendered evidence before calling a model simulation-ready. Use when making a ForgeCAD assembly sim-ready, debugging MJCF contacts, checking why a body falls through the floor, validating actuator motion, or proving a mechanism moved through the intended range.
|
|
6
|
+
|
|
7
|
+
| Field | Value |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Installed by | `forgecad skill install` |
|
|
10
|
+
| Source | `agent-skill-library/forgecad-mujoco-verify/SKILL.md` |
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## ForgeCAD MuJoCo Verify
|
|
15
|
+
|
|
16
|
+
Use this when `forgecad export mjcf ...` is part of the deliverable. A model is not sim-ready just because `forgecad check simready` passes or the MJCF file loads: it must be loaded in MuJoCo, stepped under gravity, driven with the intended controls, contact pairs inspected, and rendered from useful views.
|
|
17
|
+
|
|
18
|
+
Routing: geometry-only visual inspection -> `forgecad-render-inspect`; model authoring/API questions -> `forgecad`; building a new model -> `forgecad-make-a-model`.
|
|
19
|
+
|
|
20
|
+
### Definition Of Done
|
|
21
|
+
|
|
22
|
+
1. **Export from the exact source file.**
|
|
23
|
+
```bash
|
|
24
|
+
rm -rf /tmp/forgecad-mjcf && mkdir -p /tmp/forgecad-mjcf
|
|
25
|
+
forgecad export mjcf path/to/model.forge.js --output /tmp/forgecad-mjcf
|
|
26
|
+
```
|
|
27
|
+
2. **Load the generated scene in MuJoCo.** Use `scene.xml`, not only the model XML, so the floor/camera/package context is included.
|
|
28
|
+
3. **Check the root behavior.** If the model has a free root, it needs real support/contact geometry or an explicit fixed-root export path. Do not hide a floor failure by turning the whole shell into a giant bounding box that blocks moving internals.
|
|
29
|
+
4. **Check initial poses numerically.** For mechanisms, compute the expected body/link axes from the design source and compare them to MuJoCo `xmat`/`xpos`. Joint `ref`/default and connector frames can disagree with visual intuition.
|
|
30
|
+
5. **Keep meaningful collisions.** Do not mark moving functional parts `Sim.collider.none(...)` just to make motion pass. If full visual mesh contact is unstable, use a physically defensible simplified collider or proxy and state what physical surface it represents.
|
|
31
|
+
6. **Run the intended control with numeric acceptance criteria.** Define the expected signed post-settle joint travel before running the test: e.g. "this drive should rotate the drum -0.04 to -0.06 cycles, then stop near zero velocity" or "this wheel should move at least +1 cycle and keep spinning". Use cycles for revolute/indexing mechanisms when that is easier to reason about, and radians for direct MuJoCo qpos checks. A controller that only jitters, moves the wrong direction, overshoots through a stop, or eventually jams after skipping the intended state is a failure even when the process exits 0.
|
|
32
|
+
7. **Inspect contact pairs.** Contact names should match the physical story: floor/support, card/card, wheel/ground, stop/follower, etc. Contacts against a filled-in AABB, hidden fixture, or unrelated side plate usually indicate bad collider selection.
|
|
33
|
+
8. **Render evidence.** Save initial, settled, and driven frames from views that actually show the moving parts. If the model orientation is not obvious, generate a labeled camera preview grid first, inspect it, then rerun with the azimuth/elevation that shows the functional face. Do not report GIFs/frames before visually confirming they are not from the back, underside, or an occluded side.
|
|
34
|
+
|
|
35
|
+
### Helper Script
|
|
36
|
+
|
|
37
|
+
This skill ships a MuJoCo smoke verifier:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
uv run --python 3.11 --with mujoco --with pillow \
|
|
41
|
+
python <this-skill-dir>/scripts/mujoco_verify.py /tmp/forgecad-mjcf \
|
|
42
|
+
--settle-seconds 2 \
|
|
43
|
+
--seconds 8 \
|
|
44
|
+
--actuator drum_velocity=-0.75 \
|
|
45
|
+
--watch-joint drum_joint \
|
|
46
|
+
--expect-drive-cycles drum_joint=-0.06:-0.03 \
|
|
47
|
+
--expect-final-qvel drum_joint=-0.02:0.02 \
|
|
48
|
+
--render-dir /tmp/forgecad-mjcf/verify \
|
|
49
|
+
--camera-preview-grid
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `--actuator name=value` more than once for multi-actuator models. Use `--expect-drive-cycles joint=min:max` to assert signed final-minus-settled revolute travel in cycles/turns. Use `--expect-drive-delta joint=min:max` when you want raw MuJoCo qpos units instead. Use `--expect-final-qvel joint=min:max` to assert terminal velocity when the mechanism should stop or continue at a bounded speed. The script prints JSON with root drift, initial-to-final joint delta, post-settle drive delta, derived cycle counts, final velocities, expectation ranges, and top contact pairs, then writes PNG frames if `--render-dir` is supplied.
|
|
53
|
+
|
|
54
|
+
Prefer explicit travel envelopes over loose "it moved" checks:
|
|
55
|
+
|
|
56
|
+
- Stops/latches: assert a signed drive cycle or delta range and a near-zero final velocity range.
|
|
57
|
+
- Continuous drives: assert the signed drive cycle/delta is large enough over the run and final velocity remains in the expected direction/range.
|
|
58
|
+
- Indexing mechanisms: assert the expected cycle step size, not just eventual stall. If the mechanism reaches a stop only after skipping several indices, treat that as failure.
|
|
59
|
+
- Gravity-settling mechanisms: evaluate functional travel with post-settle drive delta, not initial-to-final delta.
|
|
60
|
+
|
|
61
|
+
When rendered orientation matters, start with `--camera-preview-grid`, open `camera_preview_grid.png`, pick the azimuth that shows the mechanism face or contact interface, then rerun with `--camera-azimuth <deg>` and any needed `--camera-lookat`, `--camera-distance`, or `--camera-elevation` adjustment. For mechanism evidence, prefer front/front-quarter views for user-facing GIFs and add a side/contact view only when it explains a collision better.
|
|
62
|
+
|
|
63
|
+
### Contact Debugging Rules
|
|
64
|
+
|
|
65
|
+
- In MuJoCo UI, enable contact visualization with `Rendering` -> `Contact points` and `Contact forces`; use the right-side perturb/visualization panels if available in your build.
|
|
66
|
+
- If rotation is blocked, list contacts during the stall and sort by repeated pairs. The blocker is usually the pair that appears every step while the driven joint velocity trends to zero.
|
|
67
|
+
- If a body falls through the floor, inspect the exported geoms. Visual geoms have `contype="0" conaffinity="0"` and cannot support anything; collision geoms are usually group 3.
|
|
68
|
+
- Bounding boxes are fast but dangerous for hollow frames, windows, handles, and side plates. They collide as the filled AABB, not the visible object.
|
|
69
|
+
- Mesh collision on complex moving parts can be too exact or solver-hostile. Prefer simple physical proxies for contact-critical moving bodies, such as a slab for a flap card or cylinders for rolling contact, but keep them colliding.
|
|
70
|
+
|
|
71
|
+
### Reporting
|
|
72
|
+
|
|
73
|
+
Report the exact export command, the MuJoCo command/script, key numeric results, the most important contact pairs, and the rendered image paths. Say what was not verified. Never say "sim-ready" when only `forgecad run`, `forgecad check simready`, or a successful export was executed.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## Bundled Files
|
|
77
|
+
|
|
78
|
+
- `scripts/mujoco_verify.py`
|