forgecad 0.10.5 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdminPage-raksfnNA.js → AdminPage-B1nIvqLS.js} +1 -1
- package/dist/assets/{BenchmarkPage-DP3RxhPs.js → BenchmarkPage-YZJbw5nd.js} +1 -1
- package/dist/assets/{BlogPage-D7Dos-vl.js → BlogPage-DIWRApKS.js} +1 -1
- package/dist/assets/{DocsPage-DO1kvBns.js → DocsPage-ClL6X1hR.js} +2 -22
- package/dist/assets/{EditorApp-DQJmcmRT.js → EditorApp-CYBDvSyT.js} +575 -119
- package/dist/assets/{EmbedViewer-DFDUhOma.js → EmbedViewer-Dmfu_LIw.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-DbE_tp8-.js → LandingPageProofDriven-XYTiYxfM.js} +1 -1
- package/dist/assets/{LegalPage-CominSso.js → LegalPage-D5Z3CscF.js} +1 -1
- package/dist/assets/{PricingPage-CcVIN9yj.js → PricingPage-BP4lIGio.js} +1 -1
- package/dist/assets/{SettingsPage-DLWcP289.js → SettingsPage-D3bcPBsC.js} +1 -1
- package/dist/assets/{app-xW3hOdq9.js → app-BKjogwIZ.js} +2192 -231
- package/dist/assets/{backendInit-mDHk97u7.js → backendInit-6a9-ilom.js} +76448 -75066
- package/dist/assets/cli/{render--SIU27W_.js → render-CMNudGb0.js} +3 -3
- package/dist/assets/{constructionHistoryWorker-uEe_Q7Kg.js → constructionHistoryWorker-BuZgc606.js} +6985 -6706
- package/dist/assets/{evalWorker-BqyDHDcI.js → evalWorker-DQ82ueGu.js} +40862 -39497
- package/dist/assets/{inspectWorker-UXMxlcR8.js → inspectWorker-Cuby2qfT.js} +2078 -478
- package/dist/assets/{jointPose-bYMlwU3v.js → jointPose-CFql5I-u.js} +1 -1
- package/dist/assets/{manifold-CyOV5B9S.js → manifold-02pmr7O7.js} +2 -2
- package/dist/assets/{manifold-BR7UYI4P.js → manifold-C6KU0oII.js} +1 -1
- package/dist/assets/{manifold-D4d5NQst.js → manifold-P1yF3GKn.js} +1 -1
- package/dist/assets/{reportWorker-DsaICZsn.js → reportWorker-kg065BVL.js} +85183 -78309
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/usage.md +6 -8
- package/dist/docs-raw/CLI.md +10 -10
- package/dist/docs-raw/component-model.md +28 -9
- package/dist/docs-raw/generated/concepts.md +13 -4
- package/dist/docs-raw/generated/core.md +244 -56
- package/dist/docs-raw/generated/curves.md +13 -0
- package/dist/docs-raw/generated/runtime-names.md +2 -2
- package/dist/docs-raw/guides/inspection-bundles.md +1 -1
- package/dist/docs-raw/guides/structural-fea.md +11 -0
- package/dist/docs-raw/skills/forgecad-build-model.md +70 -147
- package/dist/docs-raw/skills/forgecad-image-prompt.md +1 -1
- package/dist/docs-raw/skills/forgecad-project-sync.md +3 -3
- package/dist/docs-raw/skills/forgecad-reconstruct-cad-file.md +2 -2
- package/dist/docs-raw/skills/forgecad-reconstruct-from-images.md +4 -5
- package/dist/docs-raw/skills/forgecad.md +3 -1
- package/dist/docs-raw/skills/index.md +1 -5
- package/dist/docs-raw/welcome.md +3 -4
- package/dist/index.html +1 -1
- package/dist/llms.txt +1 -2
- package/dist/sitemap.xml +15 -15
- package/dist-cli/{check-compiler-7YAHVXYM.js → check-compiler-UJWUEIDC.js} +1 -1
- package/dist-cli/{check-query-propagation-ZRR6IOJW.js → check-query-propagation-O2EPDJSY.js} +1 -1
- package/dist-cli/{chunk-VNM67DIV.js → chunk-MNDROM7T.js} +77145 -75767
- package/dist-cli/forgecad.js +1145 -441
- package/dist-skill/CONTEXT.md +429 -64
- package/dist-skill/SKILL.md +3 -1
- package/dist-skill/docs/API/core/concepts.md +31 -4
- package/dist-skill/docs/CLI.md +10 -10
- package/dist-skill/docs/generated/core.md +240 -57
- package/dist-skill/docs/generated/curves.md +13 -0
- package/dist-skill/docs/generated/runtime-names.md +2 -2
- package/dist-skill/docs/guides/inspection-bundles.md +1 -1
- package/dist-skill/docs/guides/manual-parameters.md +130 -0
- package/dist-skill/docs/guides/structural-fea.md +11 -0
- package/dist-skill/library/README.md +0 -4
- package/dist-skill/library/forgecad-build-model/SKILL.md +57 -150
- package/dist-skill/library/forgecad-build-model/references/inspection-feedback.md +58 -0
- package/dist-skill/library/forgecad-build-model/references/module-contracts.md +53 -0
- package/dist-skill/library/forgecad-build-model/references/parameter-controls.md +22 -0
- package/dist-skill/library/forgecad-build-model/references/readiness-review.md +43 -0
- package/dist-skill/library/forgecad-build-model/references/simulation-feedback.md +49 -0
- package/dist-skill/library/forgecad-build-model/references/stage-1-design-intent.md +21 -0
- package/dist-skill/library/forgecad-build-model/references/stage-2-architecture-plan.md +23 -0
- package/dist-skill/library/forgecad-build-model/references/stage-3-build-slices.md +39 -0
- package/dist-skill/library/forgecad-build-model/references/stage-4-feedback-iteration.md +24 -0
- package/dist-skill/library/forgecad-build-model/references/stage-5-readiness-package.md +34 -0
- package/dist-skill/library/forgecad-image-prompt/SKILL.md +1 -1
- package/dist-skill/library/forgecad-project-sync/SKILL.md +3 -3
- package/dist-skill/library/forgecad-reconstruct-cad-file/SKILL.md +2 -2
- package/dist-skill/library/forgecad-reconstruct-from-images/SKILL.md +4 -5
- package/dist-skill/website/skills/forgecad-build-model.md +70 -147
- package/dist-skill/website/skills/forgecad-image-prompt.md +1 -1
- package/dist-skill/website/skills/forgecad-project-sync.md +3 -3
- package/dist-skill/website/skills/forgecad-reconstruct-cad-file.md +2 -2
- package/dist-skill/website/skills/forgecad-reconstruct-from-images.md +4 -5
- package/dist-skill/website/skills/forgecad.md +3 -1
- package/dist-skill/website/skills/index.md +1 -5
- package/examples/api/param-path2d.forge.js +65 -0
- package/examples/api/param-placement2d.forge.js +80 -0
- package/examples/api/param-spline2d-g-continuity.forge.js +57 -0
- package/examples/api/spoon-full-tang-handle.forge.js +57 -17
- package/examples/api/surface-variable-thickness-panel.forge.js +62 -0
- package/examples/mechanical/airplane-propeller.forge.js +81 -28
- package/package.json +2 -2
- package/dist/docs-raw/skills/forgecad-design-spec.md +0 -145
- package/dist/docs-raw/skills/forgecad-grade-model.md +0 -84
- package/dist/docs-raw/skills/forgecad-inspect-model.md +0 -80
- package/dist/docs-raw/skills/forgecad-verify-mujoco.md +0 -78
- package/dist-skill/library/forgecad-design-spec/SKILL.md +0 -132
- package/dist-skill/library/forgecad-design-spec/references/default-profiles.md +0 -99
- package/dist-skill/library/forgecad-design-spec/references/master-prompt.md +0 -73
- package/dist-skill/library/forgecad-grade-model/SKILL.md +0 -72
- package/dist-skill/library/forgecad-grade-model/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-inspect-model/SKILL.md +0 -68
- package/dist-skill/library/forgecad-verify-mujoco/SKILL.md +0 -66
- package/dist-skill/website/skills/forgecad-design-spec.md +0 -145
- package/dist-skill/website/skills/forgecad-grade-model.md +0 -84
- package/dist-skill/website/skills/forgecad-inspect-model.md +0 -80
- package/dist-skill/website/skills/forgecad-verify-mujoco.md +0 -78
- /package/dist-skill/library/{forgecad-verify-mujoco → forgecad-build-model}/scripts/mujoco_verify.py +0 -0
- /package/dist-skill/library/{forgecad-inspect-model → forgecad-build-model/scripts}/summarize_manifest.py +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
skill-group: core
|
|
3
|
+
skill-order: 6
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manual Parameter Sheets
|
|
7
|
+
|
|
8
|
+
Manual parameters are constrained design data: the script owns the structure and
|
|
9
|
+
the user edits only the declared values. They are for cases where a numeric
|
|
10
|
+
slider is the wrong shape of input.
|
|
11
|
+
|
|
12
|
+
## Contents
|
|
13
|
+
|
|
14
|
+
- Decision Ladder
|
|
15
|
+
- Path2D
|
|
16
|
+
- Spline2D
|
|
17
|
+
- Placement2D
|
|
18
|
+
- Spatial Anchors
|
|
19
|
+
- Saving
|
|
20
|
+
|
|
21
|
+
## Decision Ladder
|
|
22
|
+
|
|
23
|
+
Use the smallest parameter type that matches the design intent:
|
|
24
|
+
|
|
25
|
+
| Intent | Use |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| One scalar dimension, count, angle, or toggle | `Param.number()`, `Param.bool()`, `Param.choice()` |
|
|
28
|
+
| A repeated table of named scalar fields | `Param.list()` |
|
|
29
|
+
| A hand-shaped polygon, section outline, or open centerline | `Param.path2d()` |
|
|
30
|
+
| A smooth hand-shaped curve with tangent/curvature intent | `Param.spline2d()` |
|
|
31
|
+
| Named semantic blocks arranged in zones | `Param.placement2d()` |
|
|
32
|
+
|
|
33
|
+
Do not use `path2d` or `spline2d` as a generic table. Use them when dragging
|
|
34
|
+
points is meaningfully better than editing numbers.
|
|
35
|
+
|
|
36
|
+
## Path2D
|
|
37
|
+
|
|
38
|
+
`Param.path2d(name, points, opts)` returns a `Path2DParamValue`.
|
|
39
|
+
|
|
40
|
+
- Closed paths are filled profile intent: call `.toSketch()`.
|
|
41
|
+
- Open paths are centerline intent: call `.toStroke(width)`.
|
|
42
|
+
- `x` and `y` ranges define the initial editor frame, not hard movement limits.
|
|
43
|
+
- Override keys are `Name[0].x`, `Name[0].y`, and `Name.__count__`.
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
const outline = Param.path2d('Outline', [[-30, -15], [30, -15], [24, 18], [-28, 16]], {
|
|
47
|
+
closed: true,
|
|
48
|
+
minPoints: 3,
|
|
49
|
+
maxPoints: 12,
|
|
50
|
+
unit: 'mm',
|
|
51
|
+
anchor: Param.anchor.sheetOnXY([0, 0, 8], { label: 'Top outline' }),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return outline.toSketch().extrude(4);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Spline2D
|
|
58
|
+
|
|
59
|
+
`Param.spline2d(name, points, opts)` returns a `Spline2DParamValue`.
|
|
60
|
+
|
|
61
|
+
- Each point has `g`: `G0` for a hard break, `G1` for tangent smooth, `G2` for
|
|
62
|
+
curvature smooth.
|
|
63
|
+
- Use `.toCurveOnXY()`, `.toCurveOnXZ()`, or `.toCurveOnYZ()` for sweeps and
|
|
64
|
+
curve consumers.
|
|
65
|
+
- Use `.toPathOnXY()`, `.toPathOnXZ()`, or `.toPathOnYZ()` when an API expects
|
|
66
|
+
sampled points.
|
|
67
|
+
- Override keys are `Name[0].x`, `Name[0].y`, `Name[0].g`, and `Name.__count__`.
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
const sideProfile = Param.spline2d('Side Profile', [
|
|
71
|
+
{ x: 0, y: 0, g: 'G2' },
|
|
72
|
+
{ x: 35, y: 8, g: 'G2' },
|
|
73
|
+
{ x: 70, y: 3, g: 'G1' },
|
|
74
|
+
], {
|
|
75
|
+
unit: 'mm',
|
|
76
|
+
anchor: Param.anchor.sheetOnXZ([0, -20, 0], { label: 'Side profile' }),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const rail = sideProfile.toCurveOnXZ();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Placement2D
|
|
83
|
+
|
|
84
|
+
`Param.placement2d(name, spec)` returns a `Placement2DParamValue`.
|
|
85
|
+
|
|
86
|
+
- The script declares stable item IDs, footprints, optional zones, and rules.
|
|
87
|
+
- The user moves named items; the model decides what each item creates.
|
|
88
|
+
- Use `.item(id)` for one placement or `.positions()` for keyed lookup.
|
|
89
|
+
- Override keys are item based: `Layout.battery.x`, `Layout.battery.y`,
|
|
90
|
+
`Layout.battery.angle`, and `Layout.battery.zone`.
|
|
91
|
+
|
|
92
|
+
```javascript
|
|
93
|
+
const layout = Param.placement2d('Internal Layout', {
|
|
94
|
+
frame: { size: [120, 80] },
|
|
95
|
+
zones: [{ id: 'electronics', size: [70, 70], center: [-20, 0] }],
|
|
96
|
+
items: [
|
|
97
|
+
{ id: 'battery', footprint: { type: 'rect', size: [42, 24] }, zone: 'electronics', at: [-25, 0] },
|
|
98
|
+
{ id: 'speaker', footprint: { type: 'circle', radius: 12 }, at: [32, 8] },
|
|
99
|
+
],
|
|
100
|
+
rules: { bounds: 'prevent', collisions: 'warn', snap: 1 },
|
|
101
|
+
anchor: Param.anchor.sheetOnXY([0, 0, 12], { label: 'Internal layout' }),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const battery = layout.item('battery');
|
|
105
|
+
const batteryBlock = box(42, 24, 6).translate(battery.x, battery.y, 3);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Spatial Anchors
|
|
109
|
+
|
|
110
|
+
Every parameter type can carry optional viewport metadata through `anchor`.
|
|
111
|
+
Anchors do not change geometry.
|
|
112
|
+
|
|
113
|
+
- `Param.anchor.point([x, y, z])` creates a clickable pin for scalar, string,
|
|
114
|
+
list, boolean, or choice parameters.
|
|
115
|
+
- `Param.anchor.sheetOnXY([x, y, z])` places a 2D sheet in the XY plane at
|
|
116
|
+
fixed Z.
|
|
117
|
+
- `Param.anchor.sheetOnXZ([x, y, z])` places a 2D sheet in the XZ plane at
|
|
118
|
+
fixed Y.
|
|
119
|
+
- `Param.anchor.sheetOnYZ([x, y, z])` places a 2D sheet in the YZ plane at
|
|
120
|
+
fixed X.
|
|
121
|
+
|
|
122
|
+
The parameter still appears in the parameter panel when `anchor` is omitted; it
|
|
123
|
+
just has no 3D pin or spatial sheet.
|
|
124
|
+
|
|
125
|
+
## Saving
|
|
126
|
+
|
|
127
|
+
Dragging a manual sheet writes parameter overrides first. The source model keeps
|
|
128
|
+
the declared defaults until those overrides are intentionally folded back into
|
|
129
|
+
code. Use snapshots for named parameter states, and use the parameter panel's
|
|
130
|
+
AI handoff for manual canvas edits when the desired result should become source.
|
|
@@ -14,6 +14,17 @@ Use structural FEA when you want a ForgeCAD model to answer a load-case question
|
|
|
14
14
|
|
|
15
15
|
ForgeCAD owns the authoring contract, solver orchestration, result feedback, and inspection report. The numerical solve is done out of process with Gmsh and CalculiX. Users author a study in the model, run `forgecad fea run`, and inspect a result bundle.
|
|
16
16
|
|
|
17
|
+
## Contents
|
|
18
|
+
|
|
19
|
+
- What You Get
|
|
20
|
+
- What You Need Installed
|
|
21
|
+
- Author The Study
|
|
22
|
+
- Choose Stable Regions
|
|
23
|
+
- Run The Flow
|
|
24
|
+
- Read The Results
|
|
25
|
+
- Current Scope
|
|
26
|
+
- Troubleshooting
|
|
27
|
+
|
|
17
28
|
## What You Get
|
|
18
29
|
|
|
19
30
|
A solved FEA result bundle can produce:
|
|
@@ -9,11 +9,7 @@ forgecad skill install
|
|
|
9
9
|
The installed skill names are namespaced to avoid collisions with a user's existing generic skills.
|
|
10
10
|
|
|
11
11
|
- `forgecad-build-model`
|
|
12
|
-
- `forgecad-design-spec`
|
|
13
|
-
- `forgecad-grade-model`
|
|
14
12
|
- `forgecad-image-prompt`
|
|
15
|
-
- `forgecad-inspect-model`
|
|
16
13
|
- `forgecad-project-sync`
|
|
17
14
|
- `forgecad-reconstruct-cad-file`
|
|
18
15
|
- `forgecad-reconstruct-from-images`
|
|
19
|
-
- `forgecad-verify-mujoco`
|
|
@@ -1,189 +1,96 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: forgecad-build-model
|
|
3
|
-
description: Build or edit
|
|
3
|
+
description: Build or edit `.forge.js` real product models through design, automatic/manual feedback gathering, inspection/simulation/FEA evidence, and iteration until ready.
|
|
4
4
|
forgecad-public: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Build Model
|
|
8
8
|
|
|
9
|
-
Create
|
|
9
|
+
Create or edit ForgeCAD models through the loop that matters: design intent -> automatic or manual feedback gathering -> interpretation -> iteration -> readiness. Use the core `forgecad` skill as the source of truth for ForgeCAD API docs, generated API pages, CLI syntax, scene setup, assembly contracts, inspection bundles, FEA, simulation metadata, and examples. This skill defines the product-modeling workflow.
|
|
10
10
|
|
|
11
11
|
## Default Output Standard
|
|
12
12
|
|
|
13
|
-
Unless the user asks otherwise,
|
|
13
|
+
Unless the user asks otherwise, build a **real product model**: an editable parametric CAD model of the actual physical product, machine, robot, fixture, part, assembly, or simulation asset the user asked for. The model should be closed, assembled, sourced, dimensioned, inspected, tested, and ready for the next real engineering loop.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- Modifiers shift the standard: `blockout` → rough massing; `production-realistic` → DFM and production-intent materials; `printable` → make the selected printed parts honest; `visual-CAD` → clearly visual, not pretending build-ready.
|
|
17
|
-
- Zero unexpected final collisions is part of the definition of done (see Collision Policy).
|
|
15
|
+
Real product features are not optional polish. For every physical function the artifact needs, model the corresponding product evidence: wall thickness, fastener stacks, bosses, ribs, flanges, seats, gaskets, cable exits, service access, toleranced clearances, purchased parts, BOM entries, critical dimensions, simulation artifacts when behavior evidence matters, export artifacts when requested or process-dependent, and process-appropriate materials. If evidence is still missing, keep building or name the exact missing validation loop and residual risk; do not quietly lower the target quality.
|
|
18
16
|
|
|
19
17
|
## File Placement
|
|
20
18
|
|
|
21
|
-
New `.forge.js` files go under date-based directories
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
YYYY/MM/DD/file.forge.js
|
|
25
|
-
YYYY/MM/DD/folder/main.forge.js
|
|
26
|
-
YYYY/MM/DD/folder/
|
|
27
|
-
YYYY/MM/DD/folder/
|
|
19
|
+
New `.forge.js` files go under date-based directories in the user's current ForgeCAD project or a clearly named local folder:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
YYYY/MM/DD/file.forge.js # tiny single-file model only
|
|
23
|
+
YYYY/MM/DD/folder/main.forge.js # central entry point for every multi-file build
|
|
24
|
+
YYYY/MM/DD/folder/NOTES.md # live build notes: learnings, API friction, surprises, follow-ups
|
|
25
|
+
YYYY/MM/DD/folder/docs/PRFAQ.md # product/user story and decision FAQ
|
|
26
|
+
YYYY/MM/DD/folder/docs/HLD.md # high-level design
|
|
27
|
+
YYYY/MM/DD/folder/docs/LLD-*.md # lower-level design docs as needed
|
|
28
|
+
YYYY/MM/DD/folder/docs/modules/*.md # submodule or complex-part design notes
|
|
29
|
+
YYYY/MM/DD/folder/modules/<domain>/*.forge.js # unified nested module tree: leaf modules to system modules
|
|
30
|
+
YYYY/MM/DD/folder/lib/*.js # pure helpers/constants, no geometry
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
+
- Use kebab-case descriptive names.
|
|
34
|
+
- Use `main.forge.js` as the central entry point. It should import high-level modules, not every leaf file in a huge build.
|
|
35
|
+
- Prefer one nested `modules/` tree, like software. Compose upward from leaf modules to larger modules to the system. Keep files small enough to understand and verify.
|
|
36
|
+
- Reusable `.forge.js` modules should return builder functions or module interfaces. Direct-run previews belong inside `if (require.main === module)`, like Python's `if __name__ == "__main__"`.
|
|
37
|
+
- Each module file must run standalone where practical and import via `require('./path/file.forge.js')`.
|
|
38
|
+
- Use plain `.js` only for constants, tables, and pure helpers. Do not put geometry in helper-only files.
|
|
39
|
+
- Keep `NOTES.md` current for non-trivial builds. Capture learnings, API frustrations, non-obvious modeling choices, inspection surprises, cleanup notes, and follow-up product/API ideas. Do not hide requirements or formal design decisions there; those belong in PRFAQ/HLD/LLD docs.
|
|
40
|
+
- Write as many markdown design files as the project needs. Complex parts and submodules deserve their own design notes; small edits may need only a short local note.
|
|
33
41
|
|
|
34
42
|
## Workflow
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
2. `mkdir -p YYYY/MM/DD/[folder]`.
|
|
38
|
-
3. Moving parts: prove the rig first (Kinematics-First below).
|
|
39
|
-
4. Write the model — `param()`/`Param.bool()` for tunable dimensions; pick the manufacturing process before styling; build real internals; follow the contracts below.
|
|
40
|
-
5. Validate — `forgecad run <file>` (`main.forge.js` for multi-file).
|
|
41
|
-
6. Run the Final Acceptance Gate and Manufacturing Outputs checks below on `main.forge.js`.
|
|
42
|
-
7. Iterate — convert every render/inspect finding into a model edit and rerun the same targeted evidence until reality matches the intended component graph.
|
|
43
|
-
|
|
44
|
-
## Process, Style, and Variants
|
|
45
|
-
|
|
46
|
-
**Manufacturing process is a choice, not an assumption.** Never treat every model as printable. Pick process cues from the load path and operating story: machined, bent sheet, tube-and-plate, wood/composite, molded-look, printed, or hybrid purchased-hardware construction (rideables: metal/composite structure + purchased wheels/bearings; furniture: real joinery). Print-specific features (slicer clearances, heat-set inserts, layer-oriented ribs) only when the process includes printed parts.
|
|
47
|
-
|
|
48
|
-
**Visual style: expensive and credible, not generically colorful.** Restrained material-driven palette (ivory, charcoal, satin black, brushed aluminum, brass, muted burgundy/green/navy, smoked polymer, natural wood); match color to material/process so metal, polymer, rubber, PCB, and wood read differently. Bright color only as small accents (controls, seals, indicators). Keep seams, fasteners, gaskets, and purchased parts legible.
|
|
49
|
-
|
|
50
|
-
**Form is part of credibility.** Real products carry deliberate edge treatment — chamfered or rounded profiles where hands, seals, or tooling meet the part, draft on molded faces, consistent proportions and design language across parts. A knife-sharp box reads as a blockout, not a product. Get the rounding from profile-level geometry (rounded sketch corners, chamfered profiles) per the fillet caveat below.
|
|
51
|
-
|
|
52
|
-
**Variants are parameter-selected.** Sizes/styles/revisions go behind one choice parameter (`Variant`, `Preset`); return only the selected variant. Comparison lineups only behind an explicit debug parameter so they can never pollute collision findings.
|
|
53
|
-
|
|
54
|
-
## Physical Artifact, Not Teaching Diagram
|
|
55
|
-
|
|
56
|
-
Deliver the real closed artifact — covers installed, parts in assembled positions. The `forgecad` skill carries the no-labels/no-cutaway rule (no explanatory labels, arrows, or legends in production geometry; never a cutaway, sectioned, or exploded default); it binds here. Markings only when the real artifact has them (serial plates, gauge ticks, molded icons) — sparse, process-appropriate. Explain roles via named return objects and `verify.*`; review annotations go in `Viewport.label()` or a debug mode, never exported geometry.
|
|
57
|
-
|
|
58
|
-
**Internal geometry is part of the model.** If the real artifact has internals, model them as real geometry even when hidden: cavities, ribs, bosses, screw holes, bearing seats, electronics/battery volumes, wire channels, mechanism clearances and stops. Verify hidden structure with exploration tools — alternate views, `inspect sections`, `--hide`, transparent shells, named ghosts — never by mutilating the returned model.
|
|
59
|
-
|
|
60
|
-
## Kinematics-First for Moving Parts
|
|
61
|
-
|
|
62
|
-
For any mechanism (linkage, hinge, slider, suspension, gripper, drawer), the rig is the source of truth: build and prove the motion structure first, then attach geometry — never retrofit motion onto finished shells.
|
|
63
|
-
|
|
64
|
-
- Pick the rig shape before geometry: point-link graphs for closed-loop skeletons with distance/angle constraints; frames and connector joints when part orientation matters (API roster in the assembly docs).
|
|
65
|
-
- Name every degree of freedom; encode limits/defaults at rig level. Mirrored revolute axes need an explicit sign mapping — equal joint values do not automatically mirror poses.
|
|
66
|
-
- Attach proxy geometry only (pivot markers, bars, slider blocks, wheel discs). Run the rig at rest, mid-travel, both limits, and mirrored/coupled poses until the solver, controls, connector alignment, and `verify.*` checks all pass:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
forgecad run model.forge.js --joint "theta=45"
|
|
70
|
-
forgecad render 3d model.forge.js /tmp/theta-45.png --joint "theta=45" --camera iso
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Use real joint names; repeat `--joint` per control. A pose that fails to solve, clamps unexpectedly, breaks a connector check, or adds a collision means the rig is not ready for final geometry.
|
|
74
|
-
- Only then attach manufacture-real geometry to the solved links, frames, and connectors — never via a final `rotate()` that makes one pose look assembled.
|
|
75
|
-
- Return the unsolved `Assembly` so Motion controls re-run the real solve. Never bake a posed `SolvedAssembly` to make one pose look right.
|
|
76
|
-
- Encode pose checks in-script with `verify.*`: convergence, connector origins coinciding, link lengths holding, end effectors reaching targets, running clearances positive.
|
|
77
|
-
|
|
78
|
-
## Mechanical Assembly Contract
|
|
79
|
-
|
|
80
|
-
A mechanical script is not done when it merely looks assembled. Every visible piece needs a physical reason to be where it is: fused material, contact faces, a screw stack, a pin in a bore, a tab in a slot, a gasket on a land, a bearing in a seat, a cable in a channel, or a named intentional ghost.
|
|
81
|
-
|
|
82
|
-
For multi-part assemblies, the component model is mandatory:
|
|
83
|
-
|
|
84
|
-
- Parts build at origin in their own local coordinates. They do not know final assembly-space offsets, sibling dimensions, or world placement.
|
|
85
|
-
- A part's public interface is `shape` plus connectors and metadata, e.g. `return { shape, boltPattern, pinionZ }`. Declare mating faces with `.withConnectors({})`; axes point outward, with prismatic slide axes as the explicit exception.
|
|
86
|
-
- The parent assembly chooses the root and positions every structural part through connectors, `connect()`, `match()`, or `matchTo()`. Final `translate()` calls are not assembly contracts.
|
|
87
|
-
- Data flows down through `require('./part.forge.js', params)` overrides and up through returned metadata. Siblings never import each other; the parent routes shared decisions and measured outputs.
|
|
88
|
-
- Default to one file for a project-specific assembly. Split only for cross-project reuse, independent subassemblies, or when a file grows past roughly 300 lines. Never create `shared-dims.js` just to coordinate siblings.
|
|
89
|
-
|
|
90
|
-
Reject these shortcuts on sight: sibling `require()`, assembly-space coordinates inside a part, `translate()` used to position a structural assembly member, `console.log` + `if` validation instead of `verify.*`, and bare `connector.neutral()` outside a reusable component library with compatibility checks.
|
|
91
|
-
|
|
92
|
-
- Bespoke fixed assemblies: build each part in local coordinates, pick one root, place every touching part with `matchTo()`, verify each mate with `verify.connectorDistance`.
|
|
93
|
-
- Manual joint frames (`addFixed`/`addRevolute`/`addPrismatic` with a hand-built `frame:`) are scaffolding, not contracts. Before delivery, convert mating interfaces to connectors with `connect()`/`match()`, or prove the manual joint with `forgecad debug assembly --fail-on warning` and documented geometry.
|
|
94
|
-
- A named part must not contain unintentional disconnected bodies: boolean-join manufactured features, model fasteners/seals as separate named parts, or add the receiving holes/lands that explain the separation.
|
|
95
|
-
- Screws are not decoration: clearance/counterbore in the cover, receiving boss or through stack in the parent, material around both, axes aligned from one shared bolt pattern.
|
|
96
|
-
- Handles and levers need a load path: hub-to-arm neck, pivot pin/bore, thrust shoulders, stops/detents, and the connected follower. A handle tangent to a hub is a failed mechanism.
|
|
97
|
-
- Covers, doors, cartridges, service panels need seats: ledges, gasket grooves, bosses, snap hooks, tabs, or hinge barrels — plus a visible retention story.
|
|
98
|
-
- Cables, wires, tubes need receiving geometry: gland, grommet, clamp, socket, ferrule, routed channel, or hose barb. Never let a cylinder end in open space.
|
|
99
|
-
- Purchased loose parts may stay separate bodies — name them as purchased hardware/consumables and seat them in believable sockets, bores, races, or fastener stacks.
|
|
100
|
-
- Encode interface intent with `verify.*`, not comments: `verify.clearanceBetween` for seated fits and clearance bands, `verify.minClearance`/`verify.notColliding` for keep-out and running gaps, `verify.connectorDistance` for connector mates. Part counts and generic dimensions never prove an interface.
|
|
101
|
-
- No canned finished-object helpers for project-specific assemblies. Reusable vocabulary is primitives, cutters, patterns, and mechanical contracts (`lib.fastenerSet()`, `lib.boltPattern()`, real bores and pockets, connectors + `matchTo()`) — not finished backplates, brackets, or hinge leaves.
|
|
102
|
-
|
|
103
|
-
Treat `fillet()`/`chamfer()` as experimental (Manifold can be incorrect, OCCT slow); prefer profile-level rounding and inspect before relying on the result.
|
|
104
|
-
|
|
105
|
-
## Imported Parts (User-Supplied 3D Files)
|
|
106
|
-
|
|
107
|
-
When the user supplies mesh or CAD files to design around (a motor, an off-the-shelf housing, a scanned part), the import IS a component of the assembly — keep it, don't rebuild it parametrically (rebuilding is `forgecad-reconstruct-cad-file`, a different request).
|
|
108
|
-
|
|
109
|
-
- Wrap each import in its own part file: `Import.mesh()` for STL/OBJ/3MF, `Import.step()` for STEP (OCCT backend), normalize scale and orientation, recenter to a sane local origin, then treat it exactly like a purchased part — connectors at its real mating features, positioned by the assembly via `matchTo()`.
|
|
110
|
-
- Never trust units. Verify against a known dimension before mating anything: bbox via `forgecad run --details`, or `inspect section --ray` across a bore or face pair. For 3MF, account for every build item printed by `forgecad run` before flattening.
|
|
111
|
-
- Derive mating geometry by measurement, not eyeball: pull bore positions, diameters, and face offsets from sections, then hold them with `verify.clearanceBetween`/`verify.connectorDistance` against the import like any other body. Collision Policy applies to imports too.
|
|
112
|
-
- The import is a purchased/fixed line item; the manufactured deliverables are the ForgeCAD-authored parts around it. Remodel an imported feature only where a boolean against the mesh is unreliable — and say so.
|
|
113
|
-
|
|
114
|
-
## Collision Policy
|
|
115
|
-
|
|
116
|
-
Each returned part is real matter. Expected final collision count: **zero**.
|
|
44
|
+
Keep the workflow current in the project docs. Do not advance a stage until its acceptance criteria pass, and expect to revisit earlier stages when feedback changes the design.
|
|
117
45
|
|
|
118
|
-
|
|
119
|
-
- Never use interpenetration as a placement shortcut. Model contact honestly: pins in holes, shafts in seats, tabs in slots, hinges with knuckle clearance, nested parts with wall offsets, moving parts with travel envelopes.
|
|
120
|
-
- Temporary construction overlaps (oversized cutters before `difference()`, primitives before `union()`, exploratory layouts) must be consumed, hidden, named as ghosts, or isolated with `--focus`/`--hide` so final findings stay meaningful.
|
|
121
|
-
- Collision removal is part of the modeling pass, not optional polish.
|
|
46
|
+
### Stage 1: Design Intent
|
|
122
47
|
|
|
123
|
-
|
|
48
|
+
Read `references/stage-1-design-intent.md`.
|
|
124
49
|
|
|
125
|
-
|
|
50
|
+
Accepted when the project has a product/user story, PR/FAQ or equivalent design-intent doc, output standard, process assumptions, explicit success criteria, and a first feedback plan.
|
|
126
51
|
|
|
127
|
-
|
|
128
|
-
- Scripts using `assembly()`: `forgecad debug assembly model.forge.js --fail-on warning`. Fix warnings (multiple roots, manual joint contracts, disconnected bodies, unused connectors, collisions); a truly intentional one gets a visible reason in code.
|
|
129
|
-
- Generated mechanical work: `forgecad inspect mechanical-integrity . --collisions` is the shareability gate — it fails on missing `verify.*` interface checks, fragmented named groups, uncontracted manual assemblies, positive-volume collisions, timeouts, runtime failures. Do not share while red unless the user asked for a blockout.
|
|
130
|
-
- Include at least one verification that proves a mechanical interface (clearance band, keep-out, connector mate), not just object counts.
|
|
131
|
-
- Moving assemblies: incomplete until poses cover rest, mid-travel, both limits, coupled and mirrored states via `--joint` and/or in-script `solve(state)` checks, with convergence, attachment, and clearances holding at every pose.
|
|
132
|
-
2. **Collision evidence**: run `forgecad inspect fit interference`; read the manifest collision count AND the evidence PNGs. Zero unexpected findings per Collision Policy; visually confirm where any findings appear.
|
|
133
|
-
3. **Risk-specific views, not just a hero shot.** Delivery renders use the model's `scene()` rig (Scene Presentation below) — default flat lighting in a final render is a finding. One whole-model context view plus views chosen from this object's failure modes — opposing, underside, interior-facing, or grazing angles that catch internals showing through openings, covers that don't close, bad boolean cuts. Per meaningful interface: one contextual and one focused/isolated view. Risk prompts:
|
|
134
|
-
- long products, rails, handles, tools: views along and across the dominant length (bends, sag, end attachments)
|
|
135
|
-
- enclosures/shells with internals: exterior plus hidden-cover views (fit, concealment, service access)
|
|
136
|
-
- sockets, underside joins, stands, brackets: look directly into the mating face or underside; `inspect sections` for hidden geometry
|
|
137
|
-
- cables, strings, belts, tubes: both endpoints, route clearance, sag, termination hardware
|
|
138
|
-
- surface details on curved ProductSkin bodies: grazing and contextual views proving details conform or embed
|
|
139
|
-
4. **Visual attachment audit.** For every detail that should be connected, ask "where does this physically enter, seat, wrap, terminate, or fasten?" and check that view directly. Known failures to fix before delivery:
|
|
140
|
-
- a flat rail or bed sitting on a curved shell instead of being recessed, saddled, socketed, or blended in
|
|
141
|
-
- strings/cables passing through space without knots, hooks, holes, posts, ferrules, pulleys, or anchors
|
|
142
|
-
- trim lines floating above the body instead of following the surface or being inset/raised strips with real thickness
|
|
143
|
-
- handles/grips touching only by a tangent instead of having a neck, bridge, socket, screws, or overmolded landing
|
|
144
|
-
- small hardware/gems that are bbox-connected but visually levitate; give them flush/inset seats or explicit brackets
|
|
145
|
-
5. **ProductSkin honesty.** Boolean-test warnings from sampled-loft boundary edges are not real collisions. Deliver only if the collision count is clean, connectivity is correct, and the attachment audit passes; mention the residual warning in the final response.
|
|
146
|
-
6. **Name the evidence** in the final response: commands run, views checked, joint values tested, focus/hide filters, component count, collision count, residual warnings or intentional exceptions. Never just say "validated."
|
|
52
|
+
### Stage 2: Architecture Plan
|
|
147
53
|
|
|
148
|
-
|
|
54
|
+
Read `references/stage-2-architecture-plan.md`.
|
|
149
55
|
|
|
150
|
-
|
|
56
|
+
Accepted when the HLD and needed LLD/module docs define the component graph, nested file structure, interfaces, parameters, build order, and evidence gates.
|
|
151
57
|
|
|
152
|
-
|
|
153
|
-
- Put `dim()` annotations on the dimensions a builder must hit: overall envelope, critical interfaces, mating bores and bolt patterns.
|
|
154
|
-
- Prove the process-appropriate export runs cleanly and name the output path in the final response: `export stl`/`export 3mf` for printed parts; `export step` for machined parts and CAD interchange; sheet-metal parts must unfold to a valid flat pattern (`export cutting-layout` for sheet goods). `step`, `report`, and `cutting-layout` need a Production license — if unavailable, run the free exports and name the gated commands that complete the package instead of failing.
|
|
155
|
-
- An export failure (non-manifold body, open shell, fused multi-part blob where one fabricated part was expected) is a model bug, not an export problem.
|
|
58
|
+
### Stage 3: Build Slices
|
|
156
59
|
|
|
157
|
-
|
|
60
|
+
Read `references/stage-3-build-slices.md`.
|
|
158
61
|
|
|
159
|
-
|
|
62
|
+
Accepted when each slice or module runs in isolation, exposes clean connectors/metadata, has targeted render/inspect evidence, and updates the design docs with findings.
|
|
160
63
|
|
|
161
|
-
|
|
64
|
+
### Stage 4: Feedback And Iteration
|
|
162
65
|
|
|
163
|
-
|
|
66
|
+
Read `references/stage-4-feedback-iteration.md`. Also read `references/inspection-feedback.md` for inspection bundles and `references/simulation-feedback.md` for MuJoCo, FEA, or other behavior checks.
|
|
164
67
|
|
|
165
|
-
|
|
68
|
+
Accepted only after automatic and manual evidence has been gathered, interpreted, and converted into model/design edits until the model behaves the way the user expects at the relevant module and system levels.
|
|
166
69
|
|
|
167
|
-
|
|
70
|
+
### Stage 5: Readiness Package
|
|
168
71
|
|
|
169
|
-
|
|
72
|
+
Read `references/stage-5-readiness-package.md`.
|
|
170
73
|
|
|
171
|
-
|
|
74
|
+
Accepted when the final post-iteration model passes run/render/inspect evidence, plus simulation or export evidence only when requested or process-critical, carries BOM and critical dimensions, and can be reported with evidence reviewed, residual risks, and the next validation loop if anything remains unproven.
|
|
172
75
|
|
|
173
|
-
|
|
174
|
-
2. **Solve one piece** in isolation: own variables, own return, no connection logic yet.
|
|
175
|
-
3. **Verify it**: `forgecad run`, then render and read the PNG. Fix while the scope is tiny.
|
|
176
|
-
4. **Compose one layer at a time**, verifying at each level so a break is always at the newest seam.
|
|
76
|
+
## Reference Routing
|
|
177
77
|
|
|
178
|
-
|
|
78
|
+
Read only what the current stage needs:
|
|
179
79
|
|
|
180
|
-
|
|
80
|
+
- Stage references — the workflow acceptance gates.
|
|
81
|
+
- `references/parameter-controls.md` — deciding which user-facing `param()` controls to expose, where they live, and how to validate ranges.
|
|
82
|
+
- `references/module-contracts.md` — builder-first returns, preview guards, connector/data-flow rules, and assembly anti-patterns.
|
|
83
|
+
- `references/inspection-feedback.md` — choosing, running, and interpreting `forgecad inspect` evidence.
|
|
84
|
+
- `references/simulation-feedback.md` — MJCF/MuJoCo verification, FEA readiness, dynamic/contact checks, and behavior evidence.
|
|
85
|
+
- `references/readiness-review.md` — requirement checklist, evidence caps, and final readiness reporting.
|
|
86
|
+
- Core `forgecad` skill docs — API calls, CLI command syntax, generated assembly/viewport/scene/export docs, inspection bundle contracts, structural FEA, and examples.
|
|
181
87
|
|
|
182
|
-
|
|
88
|
+
## Non-Negotiable Gates
|
|
183
89
|
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
90
|
+
- Build the physical artifact, not a teaching diagram: no labels, callouts, cutaways, or explanatory slabs unless explicitly requested.
|
|
91
|
+
- Do not treat every model as printable; choose the process stack from load path, use, scale, and operating story.
|
|
92
|
+
- Use the component model for assemblies: parts build at origin, connectors position them, and data flows through the parent.
|
|
93
|
+
- Prove mechanisms with motion skeletons and pose checks before attaching final geometry.
|
|
94
|
+
- Use `verify.*` for dimensions, clearances, connector mates, collisions, and acceptance checks.
|
|
95
|
+
- Expected final collision count is zero unless an exact intentional overlap is declared and verified.
|
|
96
|
+
- Treat every failed run, render, inspect, required simulation, requested/process-critical export, or manual review finding as an iteration input. Fix the model or revise the design, then gather the same evidence again.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Inspection Feedback
|
|
2
|
+
|
|
3
|
+
Use `forgecad inspect ...` when a shaded render is too ambiguous and you need structured evidence: collision bundles, sections, wall thickness, physical components, masks, depth, normals, surface continuity, fit, or comparison overlays. Inspection is feedback for the design loop; unexpected findings are model bugs or design gaps to fix and reinspect.
|
|
4
|
+
|
|
5
|
+
## Workflow
|
|
6
|
+
|
|
7
|
+
1. Identify the failure question: overlap, thin walls, hidden cavity failure, disconnected or fused bodies, floating parts, wrong identity, orientation artifacts, or surface continuity.
|
|
8
|
+
2. Confirm the model executes. In this repo use `node dist-cli/forgecad.js run model.forge.js`; use `--debug-imports` for suspect imports.
|
|
9
|
+
3. Pick one targeted evidence command. Use `forgecad inspect evidence` and the core `forgecad` skill's CLI docs for exact syntax. For exploratory checks, pass `--output /tmp/forgecad-inspect-<slug>` when supported so default `outputs/inspect` bundles do not clutter the model folder.
|
|
10
|
+
4. Summarize the manifest first, then use `jq` for targeted follow-up:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
python <forgecad-build-model-skill-dir>/scripts/summarize_manifest.py /tmp/model-inspect
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
5. Inspect the PNGs, not only JSON. Read identity/context images first, then risk evidence, then orthogonal cameras or sections when iso hides the issue.
|
|
17
|
+
6. Isolate intentional overlaps with `--focus "A,B"` or `--hide "C"` so the remaining report stays meaningful.
|
|
18
|
+
7. Convert findings into edits, design-doc changes, or explicit residual risks, then rerun the same command.
|
|
19
|
+
8. After findings are summarized and no bundle needs to be preserved, delete transient inspection output directories created inside the model/project folder. Keep only user-requested deliverables or explicitly curated evidence.
|
|
20
|
+
|
|
21
|
+
## Evidence Selection
|
|
22
|
+
|
|
23
|
+
| Question | Evidence command |
|
|
24
|
+
|----------|------------------|
|
|
25
|
+
| Quick visual sanity | `inspect visual image` |
|
|
26
|
+
| Kinematic rig, joints, axes, and links | `inspect visual rig` |
|
|
27
|
+
| Object naming and identity | `inspect visual objects` |
|
|
28
|
+
| Exact local section measurement, bore widths, rib thickness through a chosen line | `inspect section --ray ...` |
|
|
29
|
+
| Hidden internals, cavities, pockets, screw paths, captured components | `inspect sections at\|stack\|sample` |
|
|
30
|
+
| Multi-part interference, fit checks, ghost parts, moving clearances | `inspect fit interference` |
|
|
31
|
+
| Printability, shell walls, ribs, bosses, snaps, slots | `inspect manufacture thickness` plus sections |
|
|
32
|
+
| Parts without a mesh-contact path to the ground | `inspect physical floating` |
|
|
33
|
+
| Accidental fusion, connected solids | `inspect physical components` |
|
|
34
|
+
| Air gaps between physical components | `inspect physical gaps` |
|
|
35
|
+
| Surface orientation, occlusion, faceting, strange protrusions | `inspect visual depth` or `inspect visual normals` |
|
|
36
|
+
| Loft, fillet, skin, and sweep surface continuity | `inspect surface zebra` or `inspect visual normals` |
|
|
37
|
+
| Reference-vs-candidate reconstruction comparison | `inspect compare overlay --with reference.3mf` |
|
|
38
|
+
|
|
39
|
+
## Section Probe And Replay
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node dist-cli/forgecad.js inspect section model.forge.js --plane yz --ray bore:-20,0:20,0 --output /tmp/forgecad-inspect-bore
|
|
43
|
+
node dist-cli/forgecad.js inspect replay /tmp/forgecad-inspect-bore/result.json --source candidate.forge.js
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The probe contract lives in the core `forgecad` skill's inspection-bundles guide.
|
|
47
|
+
|
|
48
|
+
## Misread Traps
|
|
49
|
+
|
|
50
|
+
- Face-touching is not a collision; collision findings are positive-volume overlaps.
|
|
51
|
+
- Gray/unresolved thickness area means evidence is incomplete, not safe.
|
|
52
|
+
- Distance/gap figures are bbox-gap metrics between components, not closest-surface distances.
|
|
53
|
+
- Depth, normals, and zebra are visual aids, not exact measurements or curvature proofs.
|
|
54
|
+
- Resolve mask colors through the manifest's object list, never by object order.
|
|
55
|
+
|
|
56
|
+
## Reporting
|
|
57
|
+
|
|
58
|
+
Record exact command, manifest highlights, PNG views inspected, findings, and the model/design edit made from those findings. Record bundle paths only for retained evidence; otherwise state that transient inspection outputs were removed. Never claim geometry is verified if only `forgecad run` passed.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Module Contracts
|
|
2
|
+
|
|
3
|
+
Use this when planning or writing multi-file ForgeCAD models.
|
|
4
|
+
|
|
5
|
+
## Builder-First Modules
|
|
6
|
+
|
|
7
|
+
Reusable `.forge.js` files should return builder functions or module interfaces. Direct-run preview controls belong inside `if (require.main === module)`, like Python's `if __name__ == "__main__"`.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
function buildMount({ wall }) {
|
|
11
|
+
const shape = box(80, 40, wall);
|
|
12
|
+
return {
|
|
13
|
+
shape,
|
|
14
|
+
boltPattern: { diameter: 5.3, positions: [[-25, 0], [25, 0]] },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (require.main === module) {
|
|
19
|
+
return buildMount({ wall: param('Wall', 3) }).shape;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return { buildMount };
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The parent imports the module interface and passes ordinary values:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
const mountModule = require('./modules/mount/motor-mount.forge.js');
|
|
29
|
+
const mount = mountModule.buildMount({ wall });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Assembly Contract
|
|
33
|
+
|
|
34
|
+
- Build each physical module in local coordinates around its own origin.
|
|
35
|
+
- Expose connectors and metadata as the module's public interface.
|
|
36
|
+
- Position structural members in parent modules through connectors, `connect()`, `match()`, or `matchTo()`.
|
|
37
|
+
- Route data through the parent: props flow down, computed metadata flows up. Siblings do not import each other.
|
|
38
|
+
- Use `verify.*` for interface claims. Do not use `console.log()` plus `if` as validation.
|
|
39
|
+
|
|
40
|
+
## Rejection Signals
|
|
41
|
+
|
|
42
|
+
- `shared-dims.js` used only to coordinate siblings.
|
|
43
|
+
- Sibling `require()` for placement data.
|
|
44
|
+
- Assembly-space coordinates inside a child module.
|
|
45
|
+
- Final `translate()` used to mate a structural part that should have a connector.
|
|
46
|
+
- Bare `connector.neutral()` outside a reusable component library with compatibility checks.
|
|
47
|
+
- A module whose direct-run preview returns something materially different from the builder contract imported by parents.
|
|
48
|
+
|
|
49
|
+
Before advancing, ask:
|
|
50
|
+
|
|
51
|
+
1. Can the module be understood without reading sibling modules?
|
|
52
|
+
2. Can the module be previewed directly with `require.main === module`?
|
|
53
|
+
3. Does the parent compose modules through explicit interfaces rather than hidden coordinate math?
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Parameter Controls
|
|
2
|
+
|
|
3
|
+
Use this when deciding which dimensions or design choices should become user-facing ForgeCAD parameters. The core `forgecad` skill remains the source of truth for exact `Param.*`, `param()`, manual parameter, CLI override, and anchor syntax.
|
|
4
|
+
|
|
5
|
+
## Good Parameter Rules
|
|
6
|
+
|
|
7
|
+
- Expose design decisions the user is likely to adjust: overall envelope, fit-critical clearances, material thickness, purchased-part model, pattern counts, named layout choices, mechanism positions, and presentation/cutaway states.
|
|
8
|
+
- Do not expose every intermediate number. Derived offsets, trig results, fillet compensation, connector locations, and sibling-placement math should be computed from intentful parent values.
|
|
9
|
+
- Put cross-cutting parameters in `main.forge.js` or the parent assembly, then pass ordinary props into child builders. Child modules may define preview-only params only under `if (require.main === module)`.
|
|
10
|
+
- Use names that are stable CLI keys and readable UI labels: `Wall Thickness`, `Servo Model`, `Door Open Angle`, not `w`, `x2`, or `tweak`.
|
|
11
|
+
- Provide defensible defaults, `unit`, `min`, `max`, `step`, and `integer: true` where relevant. Ranges should cover plausible use without allowing physically impossible geometry.
|
|
12
|
+
- Prefer `Param.choice()` for named options, `Param.bool()` for real toggles, `Param.list()` for repeated structured items, and manual sheets (`path2d`, `spline2d`, `placement2d`) when dragging geometry is the natural editing action.
|
|
13
|
+
- Add spatial anchors for parameters the user should edit from the model, especially manual sheets and fit-critical dimensions.
|
|
14
|
+
- Add `verify.*` checks for parameter extremes that can break geometry, clearances, connector mates, collision assumptions, or requested export readiness.
|
|
15
|
+
|
|
16
|
+
## Rejection Signals
|
|
17
|
+
|
|
18
|
+
- A slider exists only because a magic number was not understood.
|
|
19
|
+
- A child module owns a parameter that changes sibling fit or assembly-level layout.
|
|
20
|
+
- A parameter range permits zero wall thickness, negative clearances, invalid counts, impossible angles, or unsupported purchased-part combinations.
|
|
21
|
+
- Two parameters can contradict each other without validation.
|
|
22
|
+
- The final model is parametric in code but not meaningfully adjustable by the user.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Readiness Review
|
|
2
|
+
|
|
3
|
+
Use this in Stage 5 before reporting the model ready.
|
|
4
|
+
|
|
5
|
+
## Requirement Checklist
|
|
6
|
+
|
|
7
|
+
Extract the user request, PR/FAQ, HLD, LLDs, and module docs into must-haves and nice-to-haves. Mark every item:
|
|
8
|
+
|
|
9
|
+
| Result | Meaning |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Pass | Evidence directly proves the requirement. |
|
|
12
|
+
| Partial | The requirement is present but incomplete or weakly evidenced. |
|
|
13
|
+
| Fail | The requirement is absent or contradicted by evidence. |
|
|
14
|
+
| Unknown | The current evidence cannot verify it. |
|
|
15
|
+
|
|
16
|
+
Unknowns count against readiness. Do not turn unknowns into passes because the model looks plausible.
|
|
17
|
+
|
|
18
|
+
## Evidence Caps
|
|
19
|
+
|
|
20
|
+
Use these as readiness gates, not as a standalone public grading skill:
|
|
21
|
+
|
|
22
|
+
- Model does not execute: not ready.
|
|
23
|
+
- Executes but cannot be rendered: not ready.
|
|
24
|
+
- No rendered images visually inspected: not ready.
|
|
25
|
+
- Only one flattering view inspected: not ready for real product delivery.
|
|
26
|
+
- A must-have requirement is absent: say what is missing and what blocks readiness.
|
|
27
|
+
- Visually recognizable but physically impossible for the requested use: say what physical requirement fails.
|
|
28
|
+
- Internals, fit, walls, assembly behavior, or motion central to the brief but uninspected: say what still needs inspection.
|
|
29
|
+
- Multi-part assembly violates the component model: say which interface or ownership rule is broken.
|
|
30
|
+
- Inspection finds unexpected collisions, floating bodies, critical thin walls, or wrong connectivity: report the finding and required fix.
|
|
31
|
+
- Default flat lighting, material-false coloring, or teaching-diagram styling caps the presentation until fixed.
|
|
32
|
+
|
|
33
|
+
## Report Shape
|
|
34
|
+
|
|
35
|
+
The final response should include:
|
|
36
|
+
|
|
37
|
+
- requirement checklist summary
|
|
38
|
+
- evidence reviewed: run outcome, views inspected, inspection highlights, simulation/FEA results, and requested export results if any
|
|
39
|
+
- decisive strengths and remaining defects
|
|
40
|
+
- readiness summary: what is proven, what remains unverified, and what next validation loop is needed
|
|
41
|
+
- next fixes: the 2-5 highest-leverage improvements when not build-ready
|
|
42
|
+
|
|
43
|
+
Do not return a numeric score or fixed verdict label unless the user explicitly asks for one. The normal build workflow needs evidence, not grading theater.
|