forgecad 0.10.2 → 0.10.4
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-B3L3W1Uo.js} +1 -1
- package/dist/assets/{BenchmarkPage-BcRT5iGN.js → BenchmarkPage-DXKVXMrJ.js} +2 -2
- package/dist/assets/{BlogPage-BssBbnb-.js → BlogPage-B7BWxOCg.js} +1 -1
- package/dist/assets/{DocsPage-DsvdiRNK.js → DocsPage-BPGGwht1.js} +28 -48
- package/dist/assets/{EditorApp-Bfd3jbtC.js → EditorApp-BWUGCdD5.js} +183 -21
- package/dist/assets/{EditorApp-BpjZgzk0.css → EditorApp-C5f24ZN9.css} +8 -0
- package/dist/assets/{EmbedViewer-D5t8WamV.js → EmbedViewer-DygByZS2.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-DbN7o-Be.js → LandingPageProofDriven-BoVE7JGY.js} +54 -36
- package/dist/assets/{LegalPage-DNGrrY0p.js → LegalPage-Din8wv8d.js} +2 -2
- package/dist/assets/{PricingPage-Nczr3pRz.js → PricingPage-C2PMzmDc.js} +2 -2
- package/dist/assets/{SettingsPage-DZlyu4d4.js → SettingsPage-BlJDCRe8.js} +1 -1
- package/dist/assets/{app-C9ct2hRD.js → app-BsRYSfxY.js} +2264 -6259
- package/dist/assets/{backendInit-ymjonyQp.js → backendInit-6C0DLgH0.js} +8290 -2136
- package/dist/assets/cli/{render-B_0lQwKU.js → render-XXol_ET7.js} +822 -105
- package/dist/assets/{constructionHistoryWorker-CZ42Dksy.js → constructionHistoryWorker-cTHWRJEi.js} +699 -284
- package/dist/assets/{evalWorker-C2pm8LHP.js → evalWorker-BssDYW9u.js} +2559 -1330
- 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-ymhBV4Ll.js} +6254 -671
- package/dist/assets/{jointPose-4r8ed8_5.js → jointPose-B0blBj9A.js} +1 -1
- package/dist/assets/{landing-proof-driven-ORyigZ6p.css → landing-proof-driven-Cpf-MIbI.css} +73 -13
- package/dist/assets/{manifold-5PP1eGLN.js → manifold-B_7QXpGB.js} +1 -1
- package/dist/assets/{manifold-DjBkyIc8.js → manifold-CNShmpEJ.js} +1 -1
- package/dist/assets/{manifold-C4r6B-XY.js → manifold-CYlIm-M6.js} +2 -2
- package/dist/assets/{reportWorker-CwenM7wB.js → reportWorker-Cb5eyM7D.js} +2485 -1275
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/usage.md +17 -17
- package/dist/docs-raw/CLI.md +9 -7
- package/dist/docs-raw/README.md +1 -1
- package/dist/docs-raw/component-model.md +2 -2
- package/dist/docs-raw/generated/assembly.md +1 -1
- package/dist/docs-raw/generated/concepts.md +10 -4
- package/dist/docs-raw/generated/core.md +96 -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-skill/website/skills/forgecad-make-a-model.md → dist/docs-raw/skills/forgecad-build-model.md} +18 -8
- package/dist/docs-raw/skills/forgecad-design-spec.md +145 -0
- package/dist/docs-raw/skills/{forgecad-model-grader.md → forgecad-grade-model.md} +8 -6
- package/{dist-skill/website/skills/forgecad-visual-spec.md → dist/docs-raw/skills/forgecad-image-prompt.md} +7 -7
- package/dist/docs-raw/skills/{forgecad-render-inspect.md → forgecad-inspect-model.md} +6 -6
- package/{dist-skill/website/skills/forgecad-project.md → dist/docs-raw/skills/forgecad-project-sync.md} +5 -5
- package/{dist-skill/website/skills/forgecad-3d-reconstruction.md → dist/docs-raw/skills/forgecad-reconstruct-cad-file.md} +7 -7
- package/dist/docs-raw/skills/{forgecad-image-replicator.md → forgecad-reconstruct-from-images.md} +12 -12
- package/dist/docs-raw/skills/forgecad-verify-mujoco.md +78 -0
- package/dist/docs-raw/skills/forgecad.md +24 -24
- package/dist/docs-raw/skills/index.md +9 -13
- package/dist/index.html +9 -9
- package/dist/llms.txt +7 -7
- package/dist/sitemap.xml +16 -16
- package/dist-cli/{check-compiler-SP7FAL7R.js → check-compiler-4RPB6SB5.js} +1 -1
- package/dist-cli/{check-query-propagation-BRLSHP22.js → check-query-propagation-KN3DFQTX.js} +1 -1
- package/dist-cli/{chunk-RQQ42YCP.js → chunk-UHBRMYA6.js} +30770 -29253
- package/dist-cli/forgecad.js +3277 -237
- 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 +111 -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 +96 -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 +9 -13
- package/dist-skill/library/{forgecad-make-a-model → forgecad-build-model}/SKILL.md +16 -6
- package/dist-skill/library/forgecad-design-spec/SKILL.md +132 -0
- package/dist-skill/library/{forgecad-prepare-prompt → forgecad-design-spec}/references/master-prompt.md +1 -1
- package/dist-skill/library/{forgecad-model-grader → forgecad-grade-model}/SKILL.md +6 -4
- package/dist-skill/library/forgecad-grade-model/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-visual-spec → forgecad-image-prompt}/SKILL.md +5 -5
- package/dist-skill/library/forgecad-image-prompt/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-render-inspect → forgecad-inspect-model}/SKILL.md +4 -4
- package/dist-skill/library/{forgecad-project → forgecad-project-sync}/SKILL.md +3 -3
- package/dist-skill/library/{forgecad-3d-reconstruction → forgecad-reconstruct-cad-file}/SKILL.md +5 -5
- package/dist-skill/library/forgecad-reconstruct-cad-file/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-image-replicator → forgecad-reconstruct-from-images}/SKILL.md +10 -10
- package/dist-skill/library/forgecad-reconstruct-from-images/agents/openai.yaml +4 -0
- package/dist-skill/library/forgecad-verify-mujoco/SKILL.md +66 -0
- package/dist-skill/library/forgecad-verify-mujoco/scripts/mujoco_verify.py +385 -0
- package/{dist/docs-raw/skills/forgecad-make-a-model.md → dist-skill/website/skills/forgecad-build-model.md} +18 -8
- package/dist-skill/website/skills/forgecad-design-spec.md +145 -0
- package/dist-skill/website/skills/{forgecad-model-grader.md → forgecad-grade-model.md} +8 -6
- package/{dist/docs-raw/skills/forgecad-visual-spec.md → dist-skill/website/skills/forgecad-image-prompt.md} +7 -7
- package/dist-skill/website/skills/{forgecad-render-inspect.md → forgecad-inspect-model.md} +6 -6
- package/{dist/docs-raw/skills/forgecad-project.md → dist-skill/website/skills/forgecad-project-sync.md} +5 -5
- package/{dist/docs-raw/skills/forgecad-3d-reconstruction.md → dist-skill/website/skills/forgecad-reconstruct-cad-file.md} +7 -7
- package/dist-skill/website/skills/{forgecad-image-replicator.md → forgecad-reconstruct-from-images.md} +12 -12
- package/dist-skill/website/skills/forgecad-verify-mujoco.md +78 -0
- package/dist-skill/website/skills/forgecad.md +24 -24
- package/dist-skill/website/skills/index.md +9 -13
- 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/api/texture-projection.forge.js +75 -0
- package/examples/assets/uv-grid.png +0 -0
- package/examples/products/sportscar.forge.js +77 -0
- package/package.json +1 -3
- package/dist/docs-raw/skills/forgecad-blockout-model.md +0 -49
- package/dist/docs-raw/skills/forgecad-component-model.md +0 -53
- 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/docs-raw/skills/forgecad-reconstruction-benchmark.md +0 -60
- package/dist-skill/library/forgecad-3d-reconstruction/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +0 -42
- package/dist-skill/library/forgecad-component-model/SKILL.md +0 -46
- package/dist-skill/library/forgecad-high-level-spec/SKILL.md +0 -94
- package/dist-skill/library/forgecad-image-replicator/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-lld/SKILL.md +0 -34
- package/dist-skill/library/forgecad-model-grader/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +0 -50
- package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +0 -48
- package/dist-skill/library/forgecad-reconstruction-benchmark/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-visual-spec/agents/openai.yaml +0 -4
- package/dist-skill/website/skills/forgecad-blockout-model.md +0 -49
- package/dist-skill/website/skills/forgecad-component-model.md +0 -53
- 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/website/skills/forgecad-reconstruction-benchmark.md +0 -60
- /package/dist/assets/{landing-proof-driven-DiGqdtWa.js → landing-proof-driven-BxZZh5r5.js} +0 -0
- /package/dist-skill/library/{forgecad-prepare-prompt → forgecad-design-spec}/references/default-profiles.md +0 -0
- /package/dist-skill/library/{forgecad-render-inspect → forgecad-inspect-model}/summarize_manifest.py +0 -0
- /package/dist-skill/library/{forgecad-image-replicator → forgecad-reconstruct-from-images}/scripts/compare_images.py +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-
|
|
100
|
+
You should see `forgecad` plus companion skills such as `forgecad-build-model`, `forgecad-inspect-model`, `forgecad-design-spec`, and `forgecad-project-sync`.
|
|
101
101
|
|
|
102
102
|
If you only want the core modeling skill without companion workflows:
|
|
103
103
|
|
|
@@ -130,16 +130,17 @@ push when the result is ready for the browser.
|
|
|
130
130
|
### Mechanism Or Assembly
|
|
131
131
|
|
|
132
132
|
```text
|
|
133
|
-
Use forgecad-
|
|
134
|
-
|
|
135
|
-
Validate with forgecad run, inspect physical
|
|
136
|
-
|
|
133
|
+
Use forgecad-build-model and forgecad. For multi-part assemblies, parts must
|
|
134
|
+
build at origin, expose connectors/metadata, and let the parent assembly position
|
|
135
|
+
them with connectors or matchTo(). Validate with forgecad run, inspect physical
|
|
136
|
+
components, inspect fit interference and visual objects, and run parameter
|
|
137
|
+
checks before calling it done.
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
### Image Or Product
|
|
140
|
+
### Image Or Product Reconstruction
|
|
140
141
|
|
|
141
142
|
```text
|
|
142
|
-
Use
|
|
143
|
+
Use forgecad-reconstruct-from-images. Treat the reference images as
|
|
143
144
|
evidence, infer dimensions explicitly, build real CAD geometry, and compare
|
|
144
145
|
renders against the references. Do not stop at a decorative approximation.
|
|
145
146
|
Validate with forgecad run and targeted forgecad inspect evidence before finalizing.
|
|
@@ -205,16 +206,15 @@ For the full command reference, see [ForgeCAD CLI](../CLI.md).
|
|
|
205
206
|
| Skill | Use it for |
|
|
206
207
|
|---|---|
|
|
207
208
|
| `forgecad` | Core model authoring, editing, debugging, imports, assembly, render/export commands, and CLI validation. |
|
|
208
|
-
| `forgecad-
|
|
209
|
-
| `forgecad-
|
|
210
|
-
| `forgecad-
|
|
211
|
-
| `forgecad-
|
|
212
|
-
| `forgecad-
|
|
213
|
-
| `forgecad-
|
|
214
|
-
| `forgecad-
|
|
215
|
-
| `forgecad-
|
|
216
|
-
| `forgecad-
|
|
217
|
-
| `forgecad-project` | Managing forgecad.io projects from the CLI: init, clone, pull, push, file commands, members, publish, and shares. |
|
|
209
|
+
| `forgecad-design-spec` | 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). |
|
|
210
|
+
| `forgecad-build-model` | Creating a new `.forge.js` model in the active ForgeCAD project, including multi-part assembly discipline and validation. |
|
|
211
|
+
| `forgecad-reconstruct-cad-file` | Reconstructing a readable parametric ForgeCAD model from an existing STL, OBJ, 3MF, STEP, or STP file. |
|
|
212
|
+
| `forgecad-reconstruct-from-images` | Recreating an object from reference images as real ForgeCAD geometry through camera-calibrated render/compare/iterate loops. |
|
|
213
|
+
| `forgecad-inspect-model` | Generating and interpreting `forgecad inspect <family> <mode>` bundles for fit interference, wall thickness, connectivity, masks, depth, normals, and sections. |
|
|
214
|
+
| `forgecad-grade-model` | Reviewing and scoring a model against a requirement, brief, prompt, reference, or acceptance criteria. |
|
|
215
|
+
| `forgecad-verify-mujoco` | Verifying MJCF exports in MuJoCo with dynamics, contacts, controls, joint travel, and rendered evidence. |
|
|
216
|
+
| `forgecad-image-prompt` | Producing builder-honest image prompts from a concrete model, HLD, LLD, or build brief. |
|
|
217
|
+
| `forgecad-project-sync` | Managing forgecad.io projects from the CLI: init, clone, pull, push, file commands, members, publish, and shares. |
|
|
218
218
|
|
|
219
219
|
The source prompts for CLI-shipped companion skills live in the repository under `agent-skill-library/`. Public export is controlled by `forgecad-public: true` in each skill's `SKILL.md` frontmatter. Repo-local operational skills live under `.agents/skills/` and are not shipped through the CLI. To list the current public set from a source checkout:
|
|
220
220
|
|
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
|
|
8
|
+
Long-form rationale for ForgeCAD's multi-part architecture. The public rule sheet is embedded where agents need it: `forgecad-build-model` for authoring and `forgecad-grade-model` for review caps. 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
|
|
|
@@ -44,4 +44,4 @@ One file per project-specific assembly is the default because it maximizes local
|
|
|
44
44
|
|
|
45
45
|
## Enforcement
|
|
46
46
|
|
|
47
|
-
The anti-pattern list and
|
|
47
|
+
The anti-pattern list and design gate are enforced by the public build and grading skills; every multi-part example and agent-built assembly must pass that gate.
|
|
@@ -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,8 +16,8 @@ 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). *(
|
|
20
|
-
- **[C14: Visual & Debugging](#c14-visual-debugging)** — Control viewport appearance and debugging aids. *(
|
|
19
|
+
- **[C13: Export & Output](#c13-export-output)** — Convert geometry to external formats (STL, 3MF, SVG, DXF, G-code, PDF). *(14 functions)*
|
|
20
|
+
- **[C14: Visual & Debugging](#c14-visual-debugging)** — Control viewport appearance and debugging aids. *(39 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)*
|
|
23
23
|
|
|
@@ -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)
|
|
@@ -299,6 +301,10 @@ Control viewport appearance and debugging aids.
|
|
|
299
301
|
|
|
300
302
|
- `Viewport.label(text, at, options?)` — Add a render-only viewport label at a world-space point. → [viewport](/docs/viewport#viewport-runtime)
|
|
301
303
|
- `Viewport.highlight(target, options?)` — Highlight any geometry for visual debugging in the viewport. → [viewport](/docs/viewport#viewport-runtime)
|
|
304
|
+
- `Wrap.flat(opts)` — Project the image flat onto an axis-aligned face — `onto` is one of top/bottom/front/back/left/right. → [core](/docs/core#wrap)
|
|
305
|
+
- `Wrap.aroundCylinder(opts)` — Wrap the image around a cylinder like a can label — `axis` is 'x' | 'y' | 'z'. → [core](/docs/core#wrap)
|
|
306
|
+
- `Wrap.onSphere(opts?)` — Map the image over a sphere like a globe (longitude/latitude). → [core](/docs/core#wrap)
|
|
307
|
+
- `Wrap.box(opts?)` — Cube-map the image onto a box — one copy per face. → [core](/docs/core#wrap)
|
|
302
308
|
- `verify.that(label, check, message?)` — Custom predicate check. → [core](/docs/core#verify)
|
|
303
309
|
- `verify.equal(label, actual, expected, tolerance?, message?)` — Check that two numbers are approximately equal (within tolerance). → [core](/docs/core#verify)
|
|
304
310
|
- `verify.notEqual(label, actual, unexpected, tolerance?, message?)` — Check that two numbers are NOT equal (differ by more than tolerance). → [core](/docs/core#verify)
|
|
@@ -24,12 +24,17 @@ 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)
|
|
30
34
|
- [Points](#points)
|
|
31
35
|
- [connector](#connector)
|
|
32
36
|
- [Import](#import)
|
|
37
|
+
- [Wrap](#wrap)
|
|
33
38
|
|
|
34
39
|
## Functions
|
|
35
40
|
|
|
@@ -708,7 +713,7 @@ Supports transforms (translate, rotate, scale, mirror, transform, rotateAround,
|
|
|
708
713
|
|
|
709
714
|
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
715
|
|
|
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.
|
|
716
|
+
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
717
|
|
|
713
718
|
```js
|
|
714
719
|
box(50, 50, 50).material({ metalness: 0.9, roughness: 0.1 }); // polished metal
|
|
@@ -737,6 +742,7 @@ box(100, 100, 10).color('#gold').material({ metalness: 0.95, roughness: 0.05 }).
|
|
|
737
742
|
| `specularIntensity?` | `number` | Specular highlight intensity (0–1). |
|
|
738
743
|
| `specularColor?` | `string` | Specular highlight tint. |
|
|
739
744
|
| `reflectivity?` | `number` | Reflection strength for supported renderers (0–1). |
|
|
745
|
+
| `texture?` | `{ image: string; projection: UvProjectionSpec; ...` | Projected bitmap texture set by `Shape.wrapTexture`. `image` is a self-contained `data:` URI; `projection` maps each vertex's final world position to (u,v) in the shader, so the texture survives transforms and boolean cuts. `imageWidth`/`imageHeight` are the intrinsic pixel dimensions. |
|
|
740
746
|
|
|
741
747
|
**Face Topology**
|
|
742
748
|
|
|
@@ -1085,6 +1091,22 @@ Overloads:
|
|
|
1085
1091
|
|
|
1086
1092
|
**Other**
|
|
1087
1093
|
|
|
1094
|
+
#### `wrapTexture(image: ImageHandle, projection: UvProjectionSpec): Shape` — Wrap an imported bitmap image around this shape using a projection.
|
|
1095
|
+
|
|
1096
|
+
The `image` comes from `Import.image('path.png')`; the `projection` is one of the `Wrap.*` helpers — `Wrap.flat({ onto: 'top' })` lays it flat on a face, `Wrap.aroundCylinder({ axis: 'z' })` wraps it like a can label, `Wrap.onSphere()` maps it like a globe, and `Wrap.box()` cube-maps it onto the six sides.
|
|
1097
|
+
|
|
1098
|
+
By default the image **auto-fits** the shape — one copy across the relevant extent, so no `width`/`height`/`size` is needed (pass them only to override). The (u,v) is derived from each vertex's final world position, so the image stays glued to the surface through transforms and boolean cuts with no UV layout to maintain — apply `wrapTexture` *after* positioning the shape. Returns a new Shape; the original is unchanged.
|
|
1099
|
+
|
|
1100
|
+
```js
|
|
1101
|
+
const logo = Import.image('./logo.png');
|
|
1102
|
+
box(80, 80, 10).wrapTexture(logo, Wrap.flat({ onto: 'top' })); // auto-fits the face
|
|
1103
|
+
|
|
1104
|
+
const label = Import.image('./label.jpg');
|
|
1105
|
+
cylinder(60, 20).wrapTexture(label, Wrap.aroundCylinder({ axis: 'z' })); // wraps the side
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
`ImageHandle`: `{ __forgeImage: true, dataUri: string, width: number, height: number, mimeType: string, byteLength: number }`
|
|
1109
|
+
|
|
1088
1110
|
#### `clone(): Shape` — Return a new Shape wrapper for explicit duplication in scripts.
|
|
1089
1111
|
|
|
1090
1112
|
#### `geometryInfo(): GeometryInfo` — Inspect which backend/representation produced this solid.
|
|
@@ -1333,6 +1355,71 @@ const bracket = group(
|
|
|
1333
1355
|
| `depth?` | `number` | Thread groove depth in millimeters. Default: 0.8. |
|
|
1334
1356
|
| `underScale?` | `number` | Relative height of the under-crossing thread. Default: 0.15. |
|
|
1335
1357
|
|
|
1358
|
+
### `Sheet`
|
|
1359
|
+
|
|
1360
|
+
A parametric open surface value (control grid + knots + analytic differential geometry).
|
|
1361
|
+
|
|
1362
|
+
**Properties:**
|
|
1363
|
+
|
|
1364
|
+
| Property | Type | Description |
|
|
1365
|
+
|----------|------|-------------|
|
|
1366
|
+
| `surface` | `BSplineSurface` | — |
|
|
1367
|
+
|
|
1368
|
+
**Methods:**
|
|
1369
|
+
|
|
1370
|
+
#### `get frontEdge(): SheetEdge` — Edge naming follows parameter direction (documented): front=v0, rear=v1, left=u0, right=u1.
|
|
1371
|
+
|
|
1372
|
+
#### `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).
|
|
1373
|
+
|
|
1374
|
+
#### `matchEdge(edge: SheetEdge): MatchEdgeBuilder` — Per-edge continuity match against a neighbor (returns a NEW Sheet).
|
|
1375
|
+
|
|
1376
|
+
**`SheetEdge`**
|
|
1377
|
+
- `fixed: "u" | "v"` — Which parameter is held fixed along this edge.
|
|
1378
|
+
- `value: 0 | 1` — The fixed value (0 or 1).
|
|
1379
|
+
- Also: `sheet: Sheet`.
|
|
1380
|
+
|
|
1381
|
+
- `get rearEdge(): SheetEdge`
|
|
1382
|
+
- `get leftEdge(): SheetEdge`
|
|
1383
|
+
- `get rightEdge(): SheetEdge`
|
|
1384
|
+
- `pointAt(u: number, v: number): Vec3`
|
|
1385
|
+
- `normalAt(u: number, v: number): Vec3`
|
|
1386
|
+
- `curvatureAt(u: number, v: number): SurfaceCurvature`
|
|
1387
|
+
|
|
1388
|
+
### `CurveNetBuilder`
|
|
1389
|
+
|
|
1390
|
+
#### `toSheet(): Sheet` — Build (once) and return the Sheet.
|
|
1391
|
+
|
|
1392
|
+
- `lengthwise(...curves: CurveInput[]): this`
|
|
1393
|
+
- `crosswise(...curves: CurveInput[]): this`
|
|
1394
|
+
- `alongRails(railA: CurveInput, railB: CurveInput): this`
|
|
1395
|
+
- `sections(...curves: CurveInput[]): this`
|
|
1396
|
+
- `cage(grid: Vec3[][]): this`
|
|
1397
|
+
- `degree(u: number, v: number): this`
|
|
1398
|
+
- `get frontEdge(): SheetEdge`
|
|
1399
|
+
- `get rearEdge(): SheetEdge`
|
|
1400
|
+
- `get leftEdge(): SheetEdge`
|
|
1401
|
+
- `get rightEdge(): SheetEdge`
|
|
1402
|
+
- `get surface(): BSplineSurface`
|
|
1403
|
+
- `pointAt(u: number, v: number): Vec3`
|
|
1404
|
+
- `normalAt(u: number, v: number): Vec3`
|
|
1405
|
+
- `curvatureAt(u: number, v: number): SurfaceCurvature`
|
|
1406
|
+
- `thicken(wall: number, options?: { resolution?: number; }): Shape`
|
|
1407
|
+
- `matchEdge(edge: SheetEdge): MatchEdgeBuilder`
|
|
1408
|
+
|
|
1409
|
+
### `MatchEdgeBuilder`
|
|
1410
|
+
|
|
1411
|
+
- `toG0(neighbor: SheetEdge): Sheet`
|
|
1412
|
+
- `toG1(neighbor: SheetEdge): Sheet`
|
|
1413
|
+
- `toG2(neighbor: SheetEdge): Sheet`
|
|
1414
|
+
|
|
1415
|
+
### `BridgeBuilder`
|
|
1416
|
+
|
|
1417
|
+
#### `bulge(a: number, b: number): this` — Tune the influence of each side (Rhino-style bulge).
|
|
1418
|
+
|
|
1419
|
+
- `g0(): Sheet`
|
|
1420
|
+
- `g1(): Sheet`
|
|
1421
|
+
- `g2(): Sheet`
|
|
1422
|
+
|
|
1336
1423
|
### `ShapeRef`
|
|
1337
1424
|
|
|
1338
1425
|
A first-class reference path over a shape's semantic faces and face relationships.
|
|
@@ -1425,3 +1512,11 @@ Namespaced file-format import helpers — the single vocabulary for bringing ext
|
|
|
1425
1512
|
const yUpPart = Import.mesh("./part.obj", { sourceFrame: { up: "+Y" } });
|
|
1426
1513
|
```
|
|
1427
1514
|
- `step(fileName: string, options?: StepImportOptions): Shape` — Import a STEP file (.step, .stp) as an exact OCCT-backed Shape. Preserves NURBS curves, B-spline surfaces, and exact topology. Requires running with the OCCT backend. Use `sourceFrame: { up: "+Y" }` to rotate Y-up source files into ForgeCAD's Z-up world.
|
|
1515
|
+
- `image(fileName: string): ImageHandle` — Import a bitmap image (PNG, JPEG, or WebP) as an ImageHandle for projected texturing. Reads the pixel dimensions from the file header and embeds the bytes as a data URI. Pass the result to `Shape.wrapTexture(image, projection)` with a `Wrap.*` projection.
|
|
1516
|
+
|
|
1517
|
+
### `Wrap`
|
|
1518
|
+
|
|
1519
|
+
- `flat(opts: FlatWrapOptions): UvProjectionSpec` — Project the image flat onto an axis-aligned face — `onto` is one of top/bottom/front/back/left/right. Auto-fits the face (no width/height needed).
|
|
1520
|
+
- `aroundCylinder(opts: CylinderWrapOptions): UvProjectionSpec` — Wrap the image around a cylinder like a can label — `axis` is 'x' | 'y' | 'z'. Auto-fits one wrap around and the full height.
|
|
1521
|
+
- `onSphere(opts?: SphereWrapOptions): UvProjectionSpec` — Map the image over a sphere like a globe (longitude/latitude). Auto-centers on the sphere.
|
|
1522
|
+
- `box(opts?: BoxWrapOptions): UvProjectionSpec` — Cube-map the image onto a box — one copy per face. Auto-fits the box (no size needed).
|
|
@@ -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, Wrap
|
|
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-inspect-model` 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
|
+
The internal simulation feedback cycle strategy doc carries the full cross-category roadmap.
|
|
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
|