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
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-image-prompt/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-image-prompt
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Write builder-honest AI image prompts from a concrete ForgeCAD model, build brief, HLD, or LLD without hiding how the artifact is built.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-image-prompt/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Image Prompt
|
|
15
15
|
|
|
16
16
|
### Scope
|
|
17
17
|
|
|
18
|
-
Only for artifacts already concrete enough to visualize (a specific `.forge.js` model, build brief, or HLD); route vague briefs to `forgecad-
|
|
18
|
+
Only for artifacts already concrete enough to visualize (a specific `.forge.js` model, build brief, or HLD); route vague briefs to `forgecad-design-spec` first. Read minimum context — entry `.forge.js`, one key helper if it delegates geometry, brief/HLD — and capture what must survive the image model: artifact type and scale, major subassemblies, actuation style, visible mechanisms, material and color cues.
|
|
19
19
|
|
|
20
20
|
### Core Rule
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Image prompts, not concept art: show the final artifact clearly, preserve build and subsystem truth, and keep visible the seams, modules, hardware, and mechanical hierarchy that matter.
|
|
23
23
|
|
|
24
24
|
Negatives (the only negatives list — reuse it, never restate variants):
|
|
25
25
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-inspect-model/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-inspect-model
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Select, run, and interpret ForgeCAD inspection evidence for collisions, sections, wall thickness, components, masks, depth, normals, surface continuity, and fit.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-inspect-model/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Inspect Model
|
|
15
15
|
|
|
16
16
|
Use `forgecad inspect ...` when a shaded render is too ambiguous and you need structured evidence: a bundle directory with evidence PNGs plus a root `manifest.json` (or, for `inspect section`, a probe directory with `result.json`, `section.svg`, `section.png`). Inspection is not a substitute artifact: look inside with sections, masks, `--focus`/`--hide`, and transparency — never edit the model into a cutaway or exploded default to make inspecting easier. Output dirs: let `inspect` allocate its timestamped directory by default (repeated probes never collide); use `/tmp/<model>-inspect` for throwaway bundles, a project directory only for persistent artifacts.
|
|
17
17
|
|
|
18
|
-
Routing: authoring/API questions → `forgecad` skill; creating a new model → `forgecad-
|
|
18
|
+
Routing: authoring/API questions → `forgecad` skill; creating a new model → `forgecad-build-model`.
|
|
19
19
|
|
|
20
20
|
### Workflow
|
|
21
21
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-project/SKILL.md instead. -->
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-project-sync/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-project
|
|
3
|
+
# forgecad-project-sync
|
|
4
4
|
|
|
5
|
-
ForgeCAD project
|
|
5
|
+
Manage hosted ForgeCAD project sync from the CLI: init, clone, pull, push, file operations, members, publishing, and shares.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-project/SKILL.md` |
|
|
10
|
+
| Source | `agent-skill-library/forgecad-project-sync/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Project Sync
|
|
15
15
|
|
|
16
16
|
forgecad.io is the hosted ForgeCAD platform; a project is a local folder linked to the server by `forgecad.json`. The full command inventory (project, file, member, share, token commands and flags) lives in `forgecad project --help` and the forgecad skill's `docs/CLI.md` — do not relearn it here.
|
|
17
17
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-reconstruct-cad-file/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-reconstruct-cad-file
|
|
4
4
|
|
|
5
|
-
Reconstruct a parametric ForgeCAD model from an existing
|
|
5
|
+
Reconstruct a readable parametric ForgeCAD model from an existing CAD or mesh file such as STL, OBJ, 3MF, STEP, or STP.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-reconstruct-cad-file/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Reconstruct CAD File
|
|
15
15
|
|
|
16
16
|
The reference asset is evidence, not the deliverable. The deliverable is a readable, parametric `.forge.js` model that runs, renders, and scores well against the source. Never return `Import.mesh()`/`Import.step()` of the source as the final model unless the user explicitly asks for an import wrapper — imports are for measurement, rendering, and scoring only.
|
|
17
17
|
|
|
18
|
-
Routing: user wants to KEEP the file as a live component and design around it (bracket, enclosure, mating assembly) → `forgecad-
|
|
18
|
+
Routing: user wants to KEEP the file as a live component and design around it (bracket, enclosure, mating assembly) → `forgecad-build-model` (Imported Parts section), not this skill; prepared benchmark/RL episodes → use the task-local benchmark instructions, not the public skill library; inspection-bundle interpretation → `forgecad-inspect-model`; independent grading after reconstruction → `forgecad-grade-model`; API and command reference → `forgecad` skill + CLI.md.
|
|
19
19
|
|
|
20
20
|
### Workflow
|
|
21
21
|
|
|
@@ -50,7 +50,7 @@ Faceted sources: decide whether tessellation itself is evidence. Matching low-po
|
|
|
50
50
|
|
|
51
51
|
### Done Criteria
|
|
52
52
|
|
|
53
|
-
The final model must run, render, re-compare at `--samples 5000`, and pass an `inspect compare overlay`. Add targeted inspects (`forgecad-
|
|
53
|
+
The final model must run, render, re-compare at `--samples 5000`, and pass an `inspect compare overlay`. Add targeted inspects (`forgecad-inspect-model`) when the object is multi-part, hollow, thin-walled, or surface-sensitive. Report: source and candidate paths, score JSON path, final metrics, and every known mismatch classified as intentional simplification or remaining work.
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
## Bundled Files
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-reconstruct-from-images/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-reconstruct-from-images
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Reconstruct a real parametric ForgeCAD object from reference images by using images as evidence, not as a one-view facade.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-reconstruct-from-images/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Reconstruct From Images
|
|
15
15
|
|
|
16
16
|
The reference image is evidence, not the deliverable. The deliverable is a real parametric object that holds up from front, back, side, top, bottom, and reference camera views — a model that matches one image but falls apart from other angles has failed, even if the comparison board looks close. Cutaway, sectioned, exploded, or transparent references are evidence about the complete object: build the closed artifact and recreate explanatory views with viewer/inspection tools (the main `forgecad` skill's closed-artifact rule applies).
|
|
17
17
|
|
|
18
18
|
### Companion Skills
|
|
19
19
|
|
|
20
20
|
- `forgecad` — API docs, model authoring, renderer behavior.
|
|
21
|
-
- `forgecad-
|
|
22
|
-
- `forgecad-
|
|
23
|
-
- `forgecad-
|
|
21
|
+
- `forgecad-design-spec` — when the images underdetermine artifact family, process posture, scale, operating story, or validation boundary.
|
|
22
|
+
- `forgecad-build-model` — file placement, project structure, decomposition, definition of done.
|
|
23
|
+
- `forgecad-inspect-model` — pre-delivery inspection for multi-part, internal, mechanical, thin-wall, or fit-sensitive objects.
|
|
24
24
|
|
|
25
25
|
### Core Rule
|
|
26
26
|
|
|
@@ -30,19 +30,19 @@ 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-
|
|
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-
|
|
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-design-spec` when these are underdetermined.
|
|
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-build-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.
|
|
37
37
|
7. Iterate one class of change at a time, in order: object hypothesis → major proportions → canonical geometry → camera → details → presentation. If improving one reference view makes another view or a canonical render worse, the object hypothesis is wrong — fix the model, not the camera illusion.
|
|
38
38
|
8. Use every image as a constraint. Never pick one target image and ignore the rest: assign each image a camera, evidence list, and confidence; optimize one shared geometry against the whole set; state how distorted or decorative images were weighted.
|
|
39
|
-
9. Validate the final object: `forgecad run`, reference comparison boards, canonical renders, and targeted inspections via `forgecad-
|
|
39
|
+
9. Validate the final object: `forgecad run`, reference comparison boards, canonical renders, and targeted inspections via `forgecad-inspect-model`.
|
|
40
40
|
|
|
41
41
|
### Comparison Boards
|
|
42
42
|
|
|
43
43
|
Render with exact `--camera` specs (see the forgecad CLI doc for supported forms). If exact full camera specs do not render, fix the renderer before continuing — never substitute guesses from default `iso` renders.
|
|
44
44
|
|
|
45
|
-
Build side-by-side boards with the bundled self-contained `uv` helper (installs Pillow on demand). Resolve `scripts/compare_images.py` relative to the installed `forgecad-
|
|
45
|
+
Build side-by-side boards with the bundled self-contained `uv` helper (installs Pillow on demand). Resolve `scripts/compare_images.py` relative to the installed `forgecad-reconstruct-from-images` skill directory:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
uv run <skill-dir>/scripts/compare_images.py refs/front.png render-front.png compare-front.png
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-verify-mujoco/SKILL.md instead. -->
|
|
2
|
+
|
|
3
|
+
# forgecad-verify-mujoco
|
|
4
|
+
|
|
5
|
+
Verify a ForgeCAD MJCF export in MuJoCo with dynamics, contacts, controls, joint travel, and rendered evidence before calling it simulation-ready.
|
|
6
|
+
|
|
7
|
+
| Field | Value |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Installed by | `forgecad skill install` |
|
|
10
|
+
| Source | `agent-skill-library/forgecad-verify-mujoco/SKILL.md` |
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Verify MuJoCo
|
|
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-inspect-model`; model authoring/API questions -> `forgecad`; building a new model -> `forgecad-build-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`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit docs/
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit docs/skill/ instead. -->
|
|
2
2
|
|
|
3
3
|
# forgecad
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ ForgeCAD model authoring, editing, debugging, and execution guidance for .forge.
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | Generated from `docs/
|
|
10
|
+
| Source | Generated from `docs/skill/` by `scripts/build-forgecad-skill.mjs` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -18,9 +18,9 @@ Author or modify ForgeCAD models, sketches, assemblies, and CLI workflows. Prefe
|
|
|
18
18
|
### Workflow
|
|
19
19
|
|
|
20
20
|
1. Identify the artifact: `.forge.js`, SVG asset, or CLI/export task.
|
|
21
|
-
2. **If the model has any moving parts, load the `assembly` group and `docs/
|
|
21
|
+
2. **If the model has any moving parts, load the `assembly` group and `docs/skill/guides/joint-design.md` upfront** — do not defer the kinematic structure to a refactor pass.
|
|
22
22
|
3. Load only the docs the task needs (see Source Map below). Start from the top group, add others as needed, and prefer these docs and recipes over ad-hoc repo examples.
|
|
23
|
-
4. If any two parts are intended to touch or mate in the final model, load `docs/
|
|
23
|
+
4. If any two parts are intended to touch or mate in the final model, load `docs/skill/guides/positioning.md` immediately and default to connectors + `matchTo()`.
|
|
24
24
|
5. Default to a concrete first pass — easy iteration beats speculative design review.
|
|
25
25
|
6. If an existing model is broken, replace the weak structure rather than preserving bad architecture.
|
|
26
26
|
7. Validate with `forgecad run <file>` (add `--debug-imports` for import chain issues; pass `--backend manifold|occt|truck` when the backend matters).
|
|
@@ -46,77 +46,77 @@ Load groups top-to-bottom, stopping when you have what the task needs.
|
|
|
46
46
|
|
|
47
47
|
Execution model, colors, coordinate system, primitives, booleans, patterns, imports, parameters, topology, edge queries.
|
|
48
48
|
|
|
49
|
-
- `docs/
|
|
50
|
-
- `docs/
|
|
51
|
-
- `docs/
|
|
49
|
+
- `docs/skill/API/core/concepts.md`
|
|
50
|
+
- `docs/skill/generated/runtime-names.md`
|
|
51
|
+
- `docs/skill/generated/core.md`
|
|
52
52
|
|
|
53
53
|
#### 2. Static Assembly and Positioning (for any multi-part model)
|
|
54
54
|
|
|
55
55
|
Axis conventions, winding rules, and placement strategy. If parts should touch in the final model, read this group before writing placement code. Connectors + `matchTo()` are the default for mating interfaces; raw `translate()` and `rotate()` are for free offsets, not assembly contracts.
|
|
56
56
|
|
|
57
|
-
- `docs/
|
|
58
|
-
- `docs/
|
|
57
|
+
- `docs/skill/guides/coordinate-system.md`
|
|
58
|
+
- `docs/skill/guides/positioning.md`
|
|
59
59
|
|
|
60
60
|
#### 3. Sketch APIs
|
|
61
61
|
|
|
62
62
|
2D construction, transforms, booleans, paths, on-face sketching, extrusion, anchors, text, regions.
|
|
63
63
|
|
|
64
|
-
- `docs/
|
|
64
|
+
- `docs/skill/generated/sketch.md`
|
|
65
65
|
|
|
66
66
|
#### 4. Curves and Surfacing (for lofts, sweeps, splines)
|
|
67
67
|
|
|
68
68
|
Smooth curves, Hermite splines, lofted and swept solids. For straps, inlays, guards, brace members, vents, or physical bands that live on a carrier surface, use `Carrier` + `SurfaceBody` surface-member primitives before reaching for `variableSweep`, SDF sculpting, or manual boolean overlap recipes.
|
|
69
69
|
|
|
70
|
-
- `docs/
|
|
71
|
-
- `docs/
|
|
70
|
+
- `docs/skill/guides/surface-members.md`
|
|
71
|
+
- `docs/skill/generated/curves.md`
|
|
72
72
|
|
|
73
73
|
#### 5. Assemblies and Mechanisms (for joints or kinematics)
|
|
74
74
|
|
|
75
|
-
Assembly graph, joint types, couplings, validation,
|
|
75
|
+
Assembly graph, joint types, couplings, validation, and simulation export.
|
|
76
76
|
|
|
77
|
-
- `docs/
|
|
77
|
+
- `docs/skill/generated/assembly.md`
|
|
78
78
|
|
|
79
79
|
#### 6. Sheet Metal (for bent parts, K-factor, flat patterns)
|
|
80
80
|
|
|
81
81
|
Bend operations, flat pattern unfolding, K-factor configuration.
|
|
82
82
|
|
|
83
|
-
- `docs/
|
|
83
|
+
- `docs/skill/generated/sheet-metal.md`
|
|
84
84
|
|
|
85
85
|
#### 7. Output and Export (for STL/3MF/STEP, BOM, dimensions)
|
|
86
86
|
|
|
87
87
|
Mesh export, exact geometry export, bill of materials, dimension annotations.
|
|
88
88
|
|
|
89
|
-
- `docs/
|
|
89
|
+
- `docs/skill/generated/output.md`
|
|
90
90
|
|
|
91
91
|
#### 8. Toolbox (fasteners and standard parts)
|
|
92
92
|
|
|
93
93
|
Parametric bolts, nuts, washers, standard hardware, gears, pipes, and structural profiles.
|
|
94
94
|
|
|
95
|
-
- `docs/
|
|
96
|
-
- `docs/
|
|
95
|
+
- `docs/skill/generated/lib.md`
|
|
96
|
+
- `docs/skill/generated/wood.md`
|
|
97
97
|
|
|
98
98
|
#### 9. Runtime Viewport APIs (for cut planes, exploded views, hiding, and animation playback)
|
|
99
99
|
|
|
100
100
|
Viewer-only APIs such as cutPlane, explodeView, render labels, comparison references, and runtime display behavior.
|
|
101
101
|
|
|
102
|
-
- `docs/
|
|
102
|
+
- `docs/skill/generated/viewport.md`
|
|
103
103
|
|
|
104
104
|
#### 10. Recipes and Debugging (for patterns and troubleshooting)
|
|
105
105
|
|
|
106
106
|
Modeling patterns, debugging tactics, copyable snippets.
|
|
107
107
|
|
|
108
|
-
- `docs/
|
|
109
|
-
- `docs/
|
|
108
|
+
- `docs/skill/guides/scene-presentation.md`
|
|
109
|
+
- `docs/skill/guides/joint-design.md`
|
|
110
110
|
|
|
111
111
|
#### 11. CLI (for validation/render/export tasks)
|
|
112
112
|
|
|
113
113
|
Test-run, export pipelines, debug flags.
|
|
114
114
|
|
|
115
|
-
- `docs/
|
|
116
|
-
- `docs/
|
|
115
|
+
- `docs/skill/CLI.md`
|
|
116
|
+
- `docs/skill/guides/inspection-bundles.md`
|
|
117
117
|
|
|
118
118
|
#### SDF Modeling (smooth booleans, TPMS, deformations, fromFunction)
|
|
119
119
|
|
|
120
120
|
Primitives, smooth booleans, TPMS lattices, twist/bend/displace, morph, custom functions, gotchas. The doc preamble's precision caution applies to every SDF workflow.
|
|
121
121
|
|
|
122
|
-
- `docs/
|
|
122
|
+
- `docs/skill/generated/sdf.md`
|
|
@@ -11,16 +11,12 @@ forgecad skill install
|
|
|
11
11
|
| Skill | Installed by | Purpose |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| [forgecad](/docs/skills/forgecad) | `forgecad skill install` | ForgeCAD model authoring, editing, debugging, and execution guidance for .forge.js, SVG-import, assembly, and CLI workflows. Use when building or modifying ForgeCAD geometry, structuring multi-file projects, validating scripts, or using ForgeCAD export/render tooling. |
|
|
14
|
-
| [forgecad-
|
|
15
|
-
| [forgecad-
|
|
16
|
-
| [forgecad-
|
|
17
|
-
| [forgecad-
|
|
18
|
-
| [forgecad-
|
|
19
|
-
| [forgecad-
|
|
20
|
-
| [forgecad-
|
|
21
|
-
| [forgecad-
|
|
22
|
-
| [forgecad-
|
|
23
|
-
| [forgecad-project](/docs/skills/forgecad-project) | `forgecad skill install` | ForgeCAD project CLI workflow — creating, managing, syncing projects and files on forgecad.io. Covers init, push, pull, file operations, member management, publishing, and sharing. |
|
|
24
|
-
| [forgecad-reconstruction-benchmark](/docs/skills/forgecad-reconstruction-benchmark) | `forgecad skill install` | Solve ForgeCAD CAD reconstruction benchmark or RL episodes in a prepared workspace by rebuilding a visible reference asset as readable parametric ForgeCAD in the fixed submission path, using visual and geometric self-checks while respecting sandbox limits. |
|
|
25
|
-
| [forgecad-render-inspect](/docs/skills/forgecad-render-inspect) | `forgecad skill install` | Run and interpret ForgeCAD inspection bundles for model verification. Use when asked to inspect a ForgeCAD model, analyze an inspection bundle, validate collisions, wall thickness, connectivity, floating bodies, sections, masks, depth, normals, or Zebra stripes. |
|
|
26
|
-
| [forgecad-visual-spec](/docs/skills/forgecad-visual-spec) | `forgecad skill install` | Turn a concrete ForgeCAD artifact, build brief, HLD, or existing model into builder-honest image prompts for AI image models. Use when the user wants visual-spec renders that show the final product while keeping mechanisms, seams, hardware, and build cues visible instead of drifting into concept art. |
|
|
14
|
+
| [forgecad-build-model](/docs/skills/forgecad-build-model) | `forgecad skill install` | Build or edit a manufacture-realistic `.forge.js` model in a project, then validate it with run, render, inspect, and export evidence. |
|
|
15
|
+
| [forgecad-design-spec](/docs/skills/forgecad-design-spec) | `forgecad skill install` | Create a ForgeCAD design brief, HLD, or LLD before coding by walking through use, assembly, interfaces, decisions, and verification. |
|
|
16
|
+
| [forgecad-grade-model](/docs/skills/forgecad-grade-model) | `forgecad skill install` | Grade a ForgeCAD or CAD-as-code model against a requirement, brief, prompt, reference, or acceptance criteria with evidence and a 0-10 score. |
|
|
17
|
+
| [forgecad-image-prompt](/docs/skills/forgecad-image-prompt) | `forgecad skill install` | Write builder-honest AI image prompts from a concrete ForgeCAD model, build brief, HLD, or LLD without hiding how the artifact is built. |
|
|
18
|
+
| [forgecad-inspect-model](/docs/skills/forgecad-inspect-model) | `forgecad skill install` | Select, run, and interpret ForgeCAD inspection evidence for collisions, sections, wall thickness, components, masks, depth, normals, surface continuity, and fit. |
|
|
19
|
+
| [forgecad-project-sync](/docs/skills/forgecad-project-sync) | `forgecad skill install` | Manage hosted ForgeCAD project sync from the CLI: init, clone, pull, push, file operations, members, publishing, and shares. |
|
|
20
|
+
| [forgecad-reconstruct-cad-file](/docs/skills/forgecad-reconstruct-cad-file) | `forgecad skill install` | Reconstruct a readable parametric ForgeCAD model from an existing CAD or mesh file such as STL, OBJ, 3MF, STEP, or STP. |
|
|
21
|
+
| [forgecad-reconstruct-from-images](/docs/skills/forgecad-reconstruct-from-images) | `forgecad skill install` | Reconstruct a real parametric ForgeCAD object from reference images by using images as evidence, not as a one-view facade. |
|
|
22
|
+
| [forgecad-verify-mujoco](/docs/skills/forgecad-verify-mujoco) | `forgecad skill install` | Verify a ForgeCAD MJCF export in MuJoCo with dynamics, contacts, controls, joint travel, and rendered evidence before calling it simulation-ready. |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shaft-in-bushing clearance fit — a tolerance stack-up closed-loop demo.
|
|
3
|
+
*
|
|
4
|
+
* The diametral clearance must land in [0.10, 0.50] mm. With the default
|
|
5
|
+
* (loose) manufacturing ranges the clearance varies too much to hold that spec,
|
|
6
|
+
* so the stack-up reports a low Cpk and names the dominant dimension:
|
|
7
|
+
*
|
|
8
|
+
* 1. forgecad sim tolerance examples/analysis/clearance-fit.forge.js --json
|
|
9
|
+
* → Cpk(Clearance) well below 1.33, yield ~84%, contributions split
|
|
10
|
+
* between BoreDia and ShaftDia.
|
|
11
|
+
* 2. Act on the feedback — tighten both bores:
|
|
12
|
+
* forgecad sim tolerance examples/analysis/clearance-fit.forge.js \
|
|
13
|
+
* --tol BoreDia=±0.05 --tol ShaftDia=±0.05 --json
|
|
14
|
+
* → Cpk comfortably above 1.33, exit 0.
|
|
15
|
+
*
|
|
16
|
+
* The response is an ordinary verify.inRange call and the inputs are ordinary
|
|
17
|
+
* params — no special tolerance API is needed.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const BoreDia = Param.number('BoreDia', 10.0, { min: 9.7, max: 10.3, unit: 'mm' });
|
|
21
|
+
const ShaftDia = Param.number('ShaftDia', 9.7, { min: 9.4, max: 10.0, unit: 'mm' });
|
|
22
|
+
|
|
23
|
+
// Diametral clearance is the measured response; its spec limits come from this call.
|
|
24
|
+
const clearance = BoreDia - ShaftDia;
|
|
25
|
+
verify.inRange('Clearance', clearance, 0.1, 0.5);
|
|
26
|
+
|
|
27
|
+
const length = 20;
|
|
28
|
+
const bushing = difference(cylinder(length, BoreDia / 2 + 3), cylinder(length, BoreDia / 2));
|
|
29
|
+
const shaft = cylinder(length + 5, ShaftDia / 2).translate(0, 0, -2.5);
|
|
30
|
+
|
|
31
|
+
return union(bushing, shaft);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lever-arm actuator — a mechanism torque-budget closed-loop demo.
|
|
3
|
+
*
|
|
4
|
+
* A 1 kg arm extends horizontally from a revolute shoulder driven by a motor
|
|
5
|
+
* rated at 4 N·m. The gravity-hold torque is m·g·r, so a longer arm needs more
|
|
6
|
+
* torque to simply hold position:
|
|
7
|
+
*
|
|
8
|
+
* 1. forgecad sim mechanism examples/analysis/lever-arm-actuator.forge.js --json
|
|
9
|
+
* → holdTorqueNm.shoulder ≈ 1.47 N·m (1 kg · g · 0.15 m), ~63% budget margin.
|
|
10
|
+
* 2. Stretch the arm past the motor's reach:
|
|
11
|
+
* forgecad sim mechanism examples/analysis/lever-arm-actuator.forge.js \
|
|
12
|
+
* --param ArmLength=900 --json
|
|
13
|
+
* → ≈ 4.41 N·m needed, MECHANISM.HOLD.OVER_BUDGET — the 4 N·m motor can't hold it.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const ArmLength = Param.number('ArmLength', 300, { min: 100, max: 1000, unit: 'mm' });
|
|
17
|
+
|
|
18
|
+
const base = box(40, 40, 30)
|
|
19
|
+
.translate(0, 0, 15)
|
|
20
|
+
.withConnectors({
|
|
21
|
+
pivot: connector({ origin: [0, 0, 30], axis: [0, 1, 0], up: [1, 0, 0], kind: 'revolute' }),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// A horizontal bar from the pivot (x=0) out to +X; its center of mass sits at ArmLength/2.
|
|
25
|
+
const arm = box(ArmLength, 20, 20)
|
|
26
|
+
.translate(ArmLength / 2, 0, 0)
|
|
27
|
+
.withConnectors({
|
|
28
|
+
pivot: connector({ origin: [0, 0, 0], axis: [0, 1, 0], up: [1, 0, 0], kind: 'revolute' }),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const mechanism = assembly('Lever Arm Actuator')
|
|
32
|
+
.addPart('Base', base, { sim: Sim.body({ massKg: 2.0, collider: Sim.collider.boundingBox() }) })
|
|
33
|
+
.addPart('Arm', arm, { sim: Sim.body({ massKg: 1.0, collider: Sim.collider.boundingBox() }) })
|
|
34
|
+
.connect('Base.pivot', 'Arm.pivot', {
|
|
35
|
+
as: 'shoulder',
|
|
36
|
+
type: 'revolute',
|
|
37
|
+
min: -90,
|
|
38
|
+
max: 90,
|
|
39
|
+
drive: Sim.drive.velocity({ maxTorqueNm: 4, maxSpeedRpm: 30 }),
|
|
40
|
+
})
|
|
41
|
+
.withSimulation({ rootPart: 'Base', profile: Sim.profile.robotBodyRunnable() });
|
|
42
|
+
|
|
43
|
+
return mechanism;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipping tripod head — a closed-loop stability demo.
|
|
3
|
+
*
|
|
4
|
+
* A heavy camera head sits on a mast, offset in +X over a square base. With the
|
|
5
|
+
* default base the center of mass projects just outside the support footprint,
|
|
6
|
+
* so the rig tips over. This is the model→simulate→feedback→optimize loop:
|
|
7
|
+
*
|
|
8
|
+
* 1. forgecad check stability examples/analysis/tipping-tripod.forge.js --json
|
|
9
|
+
* → STABILITY.TIPS_OVER, tipOverMarginMm ≈ -3, and a comShiftToTargetMm
|
|
10
|
+
* hint pointing in −X (move mass inboard / widen the base).
|
|
11
|
+
* 2. Act on the feedback — widen the base:
|
|
12
|
+
* forgecad check stability examples/analysis/tipping-tripod.forge.js \
|
|
13
|
+
* --param BaseSpreadMm=90 --json
|
|
14
|
+
* → stable, positive margin.
|
|
15
|
+
*
|
|
16
|
+
* forgecad sim mass on the same model reports volume, mass, center of mass, and
|
|
17
|
+
* the inertia tensor (pass --density for a real material).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const BaseSpreadMm = Param.number('BaseSpreadMm', 50, { min: 20, max: 200, unit: 'mm' });
|
|
21
|
+
const HeadOffsetMm = Param.number('HeadOffsetMm', 70, { min: 0, max: 150, unit: 'mm' });
|
|
22
|
+
|
|
23
|
+
const baseThickness = 10;
|
|
24
|
+
const mastHeight = 140;
|
|
25
|
+
|
|
26
|
+
// Square base, footprint ±BaseSpreadMm in X and Y, resting on Z=0.
|
|
27
|
+
const base = box(BaseSpreadMm * 2, BaseSpreadMm * 2, baseThickness);
|
|
28
|
+
|
|
29
|
+
// Slim mast carrying the head, offset in +X.
|
|
30
|
+
const mast = cylinder(mastHeight, 8).translate(HeadOffsetMm, 0, baseThickness);
|
|
31
|
+
|
|
32
|
+
// Heavy camera head high up and offset — this dominates the center of mass.
|
|
33
|
+
const head = box(80, 60, 60).translate(HeadOffsetMm, 0, baseThickness + mastHeight);
|
|
34
|
+
|
|
35
|
+
return union(base, mast, head);
|