forgecad 0.9.6 → 0.9.7

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.
Files changed (76) hide show
  1. package/dist/assets/{AdminPage-Da6hhpJx.js → AdminPage-DX0mpSZT.js} +1 -1
  2. package/dist/assets/{BlogPage-Bl_sKeWb.js → BlogPage-CI_P0_Pf.js} +1 -1
  3. package/dist/assets/{DocsPage-Blz3Tp4j.js → DocsPage-DLhIIZyJ.js} +3 -3
  4. package/dist/assets/{EditorApp-CuiPbtn5.js → EditorApp-BujZvuwX.js} +140 -20
  5. package/dist/assets/{EditorApp-DS0AIUrZ.css → EditorApp-DfFT2Dn8.css} +1 -0
  6. package/dist/assets/{EmbedViewer-BFG6-Ufm.js → EmbedViewer-0S0qXKog.js} +2 -2
  7. package/dist/assets/{LandingPageProofDriven-DB9fQd5P.js → LandingPageProofDriven-O_yMtAri.js} +1 -1
  8. package/dist/assets/{PricingPage-BMxYT_F0.js → PricingPage-DGkX3Ahr.js} +1 -1
  9. package/dist/assets/{SettingsPage-VVQNrCAg.js → SettingsPage-DBsqTB_y.js} +82 -22
  10. package/dist/assets/{app-Dl9ymBWC.js → app-BE2nD6Yz.js} +1056 -258
  11. package/dist/assets/cli/{render-CFtwKCCY.js → render-iP9qh475.js} +1533 -207
  12. package/dist/assets/{evalWorker-CRvbzTXm.js → evalWorker-Ds5U4xtN.js} +2178 -30
  13. package/dist/assets/inspectWorker-Dll4eVyD.js +12620 -0
  14. package/dist/assets/{manifold-DpBXFS2K.js → manifold-Bk26ViCr.js} +1 -1
  15. package/dist/assets/{manifold-DzZ4VRPs.js → manifold-DjYsd7A_.js} +2 -2
  16. package/dist/assets/{manifold-B9QSr-qP.js → manifold-sJ-axdXM.js} +1 -1
  17. package/dist/assets/{renderSceneState-BuAXF2jh.js → renderSceneState-Bngp5MrQ.js} +1 -1
  18. package/dist/assets/{reportWorker-BNWEnRg1.js → reportWorker-CU8RZ4O0.js} +2161 -30
  19. package/dist/assets/{distance-BEC2RjJi.js → sectionPlaneMath-BdTjyVfs.js} +2539 -1187
  20. package/dist/cli/render.html +1 -1
  21. package/dist/docs/index.html +1 -1
  22. package/dist/docs-raw/AI/usage.md +7 -2
  23. package/dist/docs-raw/CLI.md +82 -53
  24. package/dist/docs-raw/beta-operations.md +5 -0
  25. package/dist/docs-raw/coding.md +1 -1
  26. package/dist/docs-raw/generated/concepts.md +59 -2
  27. package/dist/docs-raw/generated/core.md +206 -1
  28. package/dist/docs-raw/generated/lib.md +17 -1
  29. package/dist/docs-raw/generated/viewport.md +1 -1
  30. package/dist/docs-raw/guides/inspection-bundles.md +36 -13
  31. package/dist/docs-raw/platform/auth.md +2 -0
  32. package/dist/docs-raw/platform/google-oauth-setup.md +4 -0
  33. package/dist/docs-raw/skills/forgecad-make-a-model.md +87 -8
  34. package/dist/docs-raw/skills/forgecad-prepare-prompt.md +14 -6
  35. package/dist/docs-raw/skills/forgecad-render-inspect.md +1 -1
  36. package/dist/docs-raw/skills/index.md +2 -2
  37. package/dist/index.html +1 -1
  38. package/dist/sitemap.xml +6 -6
  39. package/dist-cli/forgecad.js +7975 -4528
  40. package/dist-cli/forgecad.js.map +1 -1
  41. package/dist-skill/CONTEXT.md +260 -16
  42. package/dist-skill/docs/CLI.md +82 -53
  43. package/dist-skill/docs/generated/core.md +206 -1
  44. package/dist-skill/docs/generated/lib.md +17 -1
  45. package/dist-skill/docs/generated/viewport.md +1 -1
  46. package/dist-skill/docs/guides/inspection-bundles.md +36 -13
  47. package/dist-skill/docs-dev/CLI.md +82 -53
  48. package/dist-skill/docs-dev/coding.md +1 -1
  49. package/dist-skill/docs-dev/generated/core.md +206 -1
  50. package/dist-skill/docs-dev/generated/lib.md +17 -1
  51. package/dist-skill/docs-dev/generated/viewport.md +1 -1
  52. package/dist-skill/docs-dev/guides/inspection-bundles.md +36 -13
  53. package/dist-skill/library/forgecad-make-a-model/SKILL.md +87 -8
  54. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +14 -6
  55. package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +5 -3
  56. package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +7 -5
  57. package/dist-skill/library/forgecad-render-inspect/SKILL.md +1 -1
  58. package/examples/api/bolted-service-cover.forge.js +17 -0
  59. package/examples/api/cable-gland-anchor.forge.js +14 -0
  60. package/examples/api/captured-cartridge-guide.forge.js +14 -0
  61. package/examples/api/captured-linear-slide.forge.js +13 -0
  62. package/examples/api/clevis-pin-joint.forge.js +13 -0
  63. package/examples/api/datum-enclosure.forge.js +16 -0
  64. package/examples/api/hose-barb-port.forge.js +14 -0
  65. package/examples/api/intentional-overlap-overmold.forge.js +16 -0
  66. package/examples/api/knuckled-hinge-assembly.forge.js +15 -0
  67. package/examples/api/living-hinge-cover.forge.js +14 -0
  68. package/examples/api/pcb-terminal-block.forge.js +22 -0
  69. package/examples/api/pinned-lever-pivot-stack.forge.js +14 -0
  70. package/examples/api/retained-shaft-knob-stack.forge.js +15 -0
  71. package/examples/api/routed-tube-clip.forge.js +15 -0
  72. package/examples/api/seated-bearing-stack.forge.js +30 -0
  73. package/examples/api/snap-latch-cover.forge.js +14 -0
  74. package/examples/api/static-assembly-connectors.forge.js +14 -16
  75. package/examples/api/thumb-screw-clamp.forge.js +15 -0
  76. package/package.json +1 -1
@@ -172,9 +172,10 @@ Only add details after the proportions and assembly relationships are correct.
172
172
 
173
173
  Do not accept a model just because it renders. CAD quality comes from command evidence:
174
174
 
175
- - `forgecad run` confirms the script executes and reports geometry diagnostics.
175
+ - `forgecad run` confirms the script executes and reports the fast inner-loop build summary.
176
176
  - `forgecad render 3d` gives visual views from deterministic cameras.
177
177
  - `forgecad render inspect` checks object masks, collisions, thickness, sections, depth, normals, and connectivity.
178
+ - `forgecad inspect mechanical-integrity` checks assembly-level verification intent and optional collision evidence.
178
179
  - `forgecad check params` catches broken parameter ranges.
179
180
  - `forgecad export ...` verifies the actual manufacturing or interchange output.
180
181
 
@@ -184,12 +185,15 @@ The CLI is not just a launcher. It gives the agent a measurable feedback loop.
184
185
 
185
186
  | Need | Command | What it gives the agent |
186
187
  |---|---|---|
187
- | Execute and validate a model | `forgecad run model.forge.js` | Object summaries, volumes, bounds, construction history, parameters, verification results, collisions, spatial relationships, and solver diagnostics. |
188
+ | Execute and validate a model | `forgecad run model.forge.js` | Fast red/green execution feedback: returned object names, parameters, verification results, script logs, and timing. |
189
+ | Inspect run details | `forgecad run model.forge.js --details --history --features` | Per-object volumes and bounds, construction history, and feature tallies when those details are worth the extra work. |
188
190
  | Debug imports | `forgecad run model.forge.js --debug-imports` | Import resolution and module-loading diagnostics for multi-file projects. |
189
191
  | Compare geometry backends | `forgecad run model.forge.js --backend occt` | Runs against a specific backend when exact geometry or backend parity matters. |
190
192
  | Test physical connectivity | `forgecad run model.forge.js --connectivity` | Connected-component reporting for assemblies and printable parts. |
193
+ | Check spatial relationships | `forgecad run model.forge.js --spatial bounded` | Opt-in directional relationships and bounded collision intersections during a run. |
191
194
  | Override parameters | `forgecad run model.forge.js -p "Width=120"` | Checks a model at a specific parameter value without editing source. |
192
195
  | Sweep parameter ranges | `forgecad check params model.forge.js --samples 12` | Finds parameter values that crash, collapse geometry, or introduce new collisions. |
196
+ | Inspect mechanical integrity | `forgecad inspect mechanical-integrity model.forge.js --collisions` | Assembly-level verification, expected component counts, and collision evidence for acceptance gates. |
193
197
  | Produce visual evidence | `forgecad render 3d model.forge.js --camera iso` | PNG viewport renders from deterministic camera angles. |
194
198
  | Inspect geometry channels | `forgecad render inspect model.forge.js --channels rgb,mask,collisions,thickness --force` | A bundle with manifest plus RGB, mask, collision, wall-thickness, depth, normal, connectivity, distance, and section channels. |
195
199
  | Export manufacturing files | `forgecad export stl model.forge.js` and `forgecad export 3mf model.forge.js` | Mesh exports for 3D printing. |
@@ -262,6 +266,7 @@ For mechanisms, dense assemblies, printable parts, or anything safety-adjacent:
262
266
 
263
267
  ```bash
264
268
  forgecad run model.forge.js --connectivity
269
+ forgecad inspect mechanical-integrity model.forge.js --collisions
265
270
  forgecad render inspect model.forge.js --channels rgb,mask,collisions,thickness,section --force
266
271
  forgecad check params model.forge.js --samples 12
267
272
  ```
@@ -67,50 +67,63 @@ Execute scripts and produce images headless — no browser window. Renders use C
67
67
 
68
68
  ### `forgecad run`
69
69
 
70
- Execute a Forge script and print full geometry diagnostics — object summary, collision detection, spatial analysis, verification results, and solver profiling.
70
+ Execute a Forge script quickly and print the inner-loop build summary: returned objects, verification results, parameters, and timing.
71
71
 
72
- The primary validation command. Runs your script with the real geometry kernel (no browser needed) and prints a comprehensive report:
72
+ The fast validation command. Runs your script with the real geometry kernel (no browser needed) and reports whether it built, which objects came back, any `verify.*` results, parameter values, script logs, and elapsed script time. This is the command agents should run frequently while editing a model.
73
73
 
74
- **Object summary** — lists every named shape with its volume, bounding box, and body count. For constrained sketches, shows solver status (FULLY / UNDER / OVER constrained), DOF, and error residuals. Problematic constraints (conflicting, redundant, or high-residual) are flagged individually.
74
+ **Fast by default** — a bare `forgecad run model.forge.js` does not compute per-object volumes, bounding boxes, construction history, feature tallies, spatial relationships, collision intersections, or solver profiles. Those diagnostics are useful, but they are no longer part of the hot path.
75
75
 
76
- **Construction history** — shows the build sequence for each shape (primitives, operations, modifications) so you can verify the modeling intent.
76
+ **Opt-in diagnostics** — use `--details` for volume/bounding-box/object geometry summaries, `--history` for the construction tree, `--features` for feature tallies, `--solver-profile` for constraint solver timing, or `--full` for the legacy rich report. Use `--spatial bounded|exact` only when you want directional relationships and collision intersections from the run command itself.
77
77
 
78
- **Feature summary** — tallies geometry features across all objects (e.g. `3 extrude, 2 fillet, 1 chamfer`).
78
+ **Verification results** — runs any `verify.*` checks in the script and reports pass/fail with expected vs actual values. Verification failures remain non-fatal so the model can still render and be inspected.
79
79
 
80
- **Verification results** — runs any `verify.*` checks in the script and reports pass/fail with expected vs actual values.
80
+ **Physical connectivity** — pass `--connectivity` to list physically connected components across visible objects. Overlapping bbox candidates are checked with exact geometry by default, while bbox-only contact is treated as evidence rather than proof of one connected component. This helps answer whether the model is one continuous assembly or several separate islands.
81
81
 
82
- **Automatic collision detection** — performs an all-pairs collision check on every named shape. For each pair whose bounding boxes overlap, computes the boolean intersection and reports overlap above 0.1 mm³:
83
-
84
- ```
85
- ⚠ COLLISION: bolt ∩ base (shared vol: 42.3mm³)
86
- ```
87
-
88
- Intra-group pairs (same assembly group) and mock-to-mock pairs are skipped. If a part passes through a boolean-subtracted hole, no collision is reported — the material is gone.
82
+ **Quality preset** — pass `--quality live|default|high` to select the same geometry quality profile used by the editor and export tools. `live` is the fastest preset for large audit models.
89
83
 
90
- **Spatial analysis** reports directional relationships and gap distances between nearby objects (e.g. `bracket is ABOVE base (gap: 5mm)`). Exact pairwise collision intersections run by default only for bounded scenes; use `--spatial exact` for exhaustive collision checks or `--spatial off` to skip this section.
84
+ For deeper confidence gates, prefer `forgecad inspect mechanical-integrity`, `forgecad check print`, `forgecad check params`, or `forgecad render inspect` instead of turning `run` back into a catch-all audit command.
91
85
 
92
- **Physical connectivity** — pass `--connectivity` to list physically connected components across visible objects. Overlapping or touching bboxes are joined within `--connectivity-tolerance` (default `0.05` model units); use collision inspection for exact positive-volume overlaps. This helps answer whether the model is one continuous assembly or several separate islands.
86
+ ```bash
87
+ forgecad run examples/api/static-assembly-connectors.forge.js
88
+ forgecad run examples/api/static-assembly-connectors.forge.js --focus
89
+ forgecad run examples/api/static-assembly-connectors.forge.js --focus "Bench.Slat*"
90
+ forgecad run examples/api/static-assembly-connectors.forge.js --hide "Bench.Slat0,Bench.Slat1"
91
+ forgecad run examples/api/static-assembly-connectors.forge.js --details --history
92
+ forgecad run examples/api/static-assembly-connectors.forge.js --spatial bounded
93
+ forgecad run examples/api/static-assembly-connectors.forge.js --full
94
+ forgecad run examples/products/cup.forge.js --connectivity
95
+ forgecad run examples/products/cup.forge.js --journeys
96
+ forgecad run examples/products/cup.forge.js --backend occt
97
+ forgecad run examples/products/cup.forge.js --backend truck --quality live
98
+ forgecad run examples/products/cup.forge.js --debug-imports
99
+ forgecad run examples/products/cup.forge.js -p "Wall Thickness=3" -p "Body Height=200"
100
+ forgecad run examples/constraints/06-complex-spectrogram.forge.js --solver-debug-out tmp/spectrogram-debug
101
+ ```
93
102
 
94
- **Quality preset** pass `--quality live|default|high` to select the same geometry quality profile used by the editor and export tools. `live` is the fastest preset for large audit models.
103
+ ### Object Filtering: `--focus` and `--hide`
95
104
 
96
- **Parameters** lists all declared parameters with their current values. Overridden values are marked with `*`.
105
+ Several CLI commands can filter the visible object set without changing model code: `run`, `render 3d`, `render wireframe`, `render inspect`, `capture`, and `check print`.
97
106
 
98
- **Solver profiling** when constraint solving occurs, shows timing breakdown (clone, solve, redundancy detection, surface building) and solver internals.
107
+ Use `forgecad run model.forge.js --quality live` to list returned object names quickly, then pass those names to `--focus` or `--hide`.
99
108
 
100
109
  ```bash
101
- forgecad run examples/cup.forge.js
102
- forgecad run examples/cup.forge.js --focus
103
- forgecad run examples/cup.forge.js --focus bracket,hinge
104
- forgecad run examples/cup.forge.js --hide "wall,bolt"
105
- forgecad run examples/cup.forge.js --connectivity
106
- forgecad run examples/cup.forge.js --journeys
107
- forgecad run examples/cup.forge.js --backend occt
108
- forgecad run examples/cup.forge.js --backend truck --quality live
109
- forgecad run examples/cup.forge.js --debug-imports
110
- forgecad run examples/cup.forge.js -p "Wall Thickness=3" -p "Body Height=200"
111
- forgecad run examples/constraints/06-complex-spectrogram.forge.js --solver-debug-out tmp/spectrogram-debug
110
+ forgecad run examples/api/static-assembly-connectors.forge.js --quality live
111
+ forgecad render 3d examples/api/static-assembly-connectors.forge.js bench.png --focus "Bench.*"
112
+ forgecad render 3d examples/api/static-assembly-connectors.forge.js slats.png --focus "Bench.Slat*"
113
+ forgecad render inspect examples/api/static-assembly-connectors.forge.js out/bench-inspect --channels rgb,mask --hide "Bench.Slat0,Bench.Slat1" --force
112
114
  ```
113
115
 
116
+ Rules:
117
+
118
+ - A bare `--focus` hides mock objects and keeps real objects.
119
+ - `--focus name1,name2` renders only matching objects.
120
+ - `--hide name1,name2` removes matching objects from the visible scene.
121
+ - Matching is case-insensitive and supports `*` / `?` globs.
122
+ - `--focus` and `--hide` are mutually exclusive.
123
+ - Filtering happens after the script runs; it does not avoid evaluating the full model.
124
+ - Filtering works on returned object names. For grouped children, use concrete child names or globs like `Bench.*`.
125
+ - If a model unions many parts into one returned shape, the original parts cannot be isolated by CLI filtering.
126
+
114
127
  ### `forgecad render`
115
128
 
116
129
  Render a Forge scene. Use a subcommand — `3d`, `inspect`, `views`, `section`, `wireframe`, `sketch`, or `hq`.
@@ -127,13 +140,13 @@ Render a Forge scene. Use a subcommand — `3d`, `inspect`, `views`, `section`,
127
140
  - `render hq` — path-traced via Blender Cycles, for documentation and marketing shots
128
141
 
129
142
  ```bash
130
- forgecad render 3d examples/cup.forge.js
143
+ forgecad render 3d examples/products/cup.forge.js
131
144
  forgecad render inspect examples/api/static-assembly-connectors.forge.js --channels rgb,mask
132
145
  forgecad render inspect channels
133
- forgecad render views examples/cup.forge.js
134
- forgecad render wireframe examples/cup.forge.js
146
+ forgecad render views examples/products/cup.forge.js
147
+ forgecad render wireframe examples/products/cup.forge.js
135
148
  forgecad render section examples/furniture/01-table.forge.js --plane XZ
136
- forgecad render hq examples/cup.forge.js --preset dramatic
149
+ forgecad render hq examples/products/cup.forge.js --preset dramatic
137
150
  ```
138
151
 
139
152
  ### `forgecad render 3d`
@@ -149,10 +162,10 @@ Use `--edges=<off|thin|bold>` to control the edge overlay. For a pure wireframe
149
162
  This is the standard way to visually verify geometry from the CLI or in agent workflows. For higher quality (path-traced, materials, HDRI lighting), use `render hq` instead.
150
163
 
151
164
  ```bash
152
- forgecad render 3d examples/cup.forge.js
153
- forgecad render 3d examples/cup.forge.js --focus
154
- forgecad render 3d examples/cup.forge.js --focus bracket
155
- forgecad render 3d examples/cup.forge.js --hide "wall,bolt"
165
+ forgecad render 3d examples/products/cup.forge.js
166
+ forgecad render 3d examples/api/static-assembly-connectors.forge.js --focus
167
+ forgecad render 3d examples/api/static-assembly-connectors.forge.js --focus "Bench.Slat*"
168
+ forgecad render 3d examples/api/static-assembly-connectors.forge.js --hide "Bench.Slat0,Bench.Slat1"
156
169
  forgecad render 3d model.forge.js --view hero
157
170
  forgecad render 3d model.forge.js --camera 45:30
158
171
  forgecad render 3d model.forge.js --camera "proj=perspective;pos=200,-160,120;target=0,0,20;up=0,0,1;fov=38"
@@ -186,7 +199,7 @@ For bundle layout, channel encodings, and manifest semantics, see [Inspection Bu
186
199
 
187
200
  ```bash
188
201
  forgecad render inspect examples/api/static-assembly-connectors.forge.js --channels rgb,mask
189
- forgecad render inspect examples/api/static-assembly-connectors.forge.js out/bench-inspect --channels collisions --focus Bench
202
+ forgecad render inspect examples/api/static-assembly-connectors.forge.js out/bench-inspect --channels collisions --focus "Bench.*"
190
203
  forgecad render inspect examples/api/static-assembly-connectors.forge.js --channels rgb,mask,collisions --hide "Bench.Slat0" --force
191
204
  ```
192
205
 
@@ -206,8 +219,8 @@ Render a Forge scene as a wireframe (edges only, no shading).
206
219
  Same as `render 3d` but renders only the edge geometry — no shaded surfaces. Useful for construction-style documentation or highlighting structural features without material detail.
207
220
 
208
221
  ```bash
209
- forgecad render wireframe examples/cup.forge.js
210
- forgecad render wireframe examples/cup.forge.js --camera iso
222
+ forgecad render wireframe examples/products/cup.forge.js
223
+ forgecad render wireframe examples/products/cup.forge.js --camera iso
211
224
  ```
212
225
 
213
226
  ### `forgecad render hq` **\[Pro\]**
@@ -221,12 +234,12 @@ Choose a `--preset` for the look: `studio` (neutral product shot), `dramatic` (h
221
234
  Output defaults to `<script-name>-hq.png`. Great for documentation, marketing renders, and social media.
222
235
 
223
236
  ```bash
224
- forgecad render hq examples/cup.forge.js
225
- forgecad render hq examples/cup.forge.js hero.png --preset dramatic --samples 1024
226
- forgecad render hq examples/cup.forge.js hero.png --view hero
227
- forgecad render hq examples/cup.forge.js hero.png --camera-json camera.json
228
- forgecad render hq examples/cup.forge.js --preset clay --size 2048
229
- forgecad render hq examples/cup.forge.js --transparent --preset glass
237
+ forgecad render hq examples/products/cup.forge.js
238
+ forgecad render hq examples/products/cup.forge.js hero.png --preset dramatic --samples 1024
239
+ forgecad render hq examples/products/cup.forge.js hero.png --view hero
240
+ forgecad render hq examples/products/cup.forge.js hero.png --camera-json camera.json
241
+ forgecad render hq examples/products/cup.forge.js --preset clay --size 2048
242
+ forgecad render hq examples/products/cup.forge.js --transparent --preset glass
230
243
  ```
231
244
 
232
245
  ### `forgecad capture gif|mp4` **\[Pro\]**
@@ -236,13 +249,13 @@ Animated orbit or joint playback.
236
249
  Renders an animated sequence by either orbiting the camera around the model or playing back a `jointsView` animation. Use `--capture orbit` (default) for a turntable rotation, `--capture animation --animation <name>` to play a named joints clip, or `--capture section-sweep` to move a clipping plane through the model. Supports `--cut-plane` to animate with a static cross-section visible. Use `--view`, `--camera`, `--camera-json`, or `--scene <file>` to choose the orbit base camera or the fixed camera for animations and section sweeps.
237
250
 
238
251
  ```bash
239
- forgecad capture gif examples/cup.forge.js
252
+ forgecad capture gif examples/products/cup.forge.js
240
253
  forgecad capture gif examples/3d-printer.forge.js out/section.gif --cut-plane "Front Section"
241
254
  forgecad capture gif model.forge.js out/raw.gif --param "Output=raw-sdf"
242
255
  forgecad capture gif model.forge.js out/front.gif --camera front
243
256
  forgecad capture gif model.forge.js out/hero.gif --view hero
244
257
  forgecad capture gif examples/3d-printer.forge.js out/sweep.gif --capture section-sweep --sweep-plane YZ
245
- forgecad capture mp4 examples/cup.forge.js
258
+ forgecad capture mp4 examples/products/cup.forge.js
246
259
  forgecad capture mp4 examples/api/runtime-joints-view.forge.js out/step.mp4 --capture animation --animation Step
247
260
  forgecad capture mp4 model.forge.js out/raw.mp4 --param "Output=raw-sdf"
248
261
  forgecad capture mp4 model.forge.js out/front.mp4 --camera front
@@ -276,8 +289,8 @@ forgecad render section examples/furniture/01-table.forge.js out/bold.svg --edge
276
289
 
277
290
  | Option | Description |
278
291
  |--------|-------------|
279
- | `--focus <names>` | Focus: no arg hides mocks; comma-separated names shows only those |
280
- | `--hide <names>` | Hide comma-separated object names |
292
+ | `--focus <names>` | Focus: no arg hides mocks; comma-separated names/globs show only those |
293
+ | `--hide <names>` | Hide comma-separated object names/globs |
281
294
  | `--camera <front\|back\|side\|right\|top\|iso\|az:el\|az:el:dist\|spec>` | Camera preset, spherical (az:el), or full spec such as `proj=perspective;pos=x,y,z;target=x,y,z;up=x,y,z;fov=45`. Repeatable. |
282
295
  | `--camera-json <file>` | Exact viewport camera JSON file |
283
296
  | `--view <name>` | Named camera view declared by the model with scene({ views }) |
@@ -299,7 +312,8 @@ forgecad render section examples/furniture/01-table.forge.js out/bold.svg --edge
299
312
  | `--min-thickness <mm>` | Critical thickness threshold in model units |
300
313
  | `--warn-thickness <mm>` | Warning thickness threshold in model units |
301
314
  | `--max-thickness <mm>` | Thick/blue heatmap threshold in model units |
302
- | `--thickness-samples <n>` | Maximum sampled triangles per object |
315
+ | `--thickness-samples <n>` | Maximum thickness point samples per object |
316
+ | `--roughness-samples <n>` | Maximum roughness point samples per object |
303
317
  | `--preset <name>` | Material/lighting preset |
304
318
  | `--width <px>` | Output width in pixels |
305
319
  | `--height <px>` | Output height in pixels |
@@ -530,7 +544,7 @@ forgecad skill one-file ~/Desktop/forgecad-context.md
530
544
  forgecad skill flattened-files ~/Desktop/forgecad-skills
531
545
  ```
532
546
 
533
- > **Workflow:** Agent writes the model -> `forgecad run` validates it -> `forgecad check print` catches printability risks -> `forgecad render inspect` produces visual evidence -> `forgecad check params` sweeps parameter robustness -> export ships the result. All in the terminal.
547
+ > **Workflow:** Agent writes the model -> `forgecad run` validates it -> `forgecad inspect mechanical-integrity` catches disconnected AI-slop patterns -> `forgecad check print` catches printability risks -> `forgecad render inspect` produces visual evidence -> `forgecad check params` sweeps parameter robustness -> export ships the result. All in the terminal.
534
548
 
535
549
  ## Validation
536
550
 
@@ -551,6 +565,20 @@ forgecad check print model.forge.js --min-wall 1.2 --warn-wall 2
551
565
  forgecad check print model.forge.js --expect-components 1 -p "Wall Thickness=3"
552
566
  ```
553
567
 
568
+ ### `forgecad inspect mechanical-integrity`
569
+
570
+ Inspect generated ForgeCAD models for mechanical integrity failures.
571
+
572
+ Scans a Forge script or a folder of generated projects and runs a mechanical integrity inspection. The inspection flags timeouts, runtime errors, missing `verify.*` checks, missing executed mechanical-interface checks, fragmented named groups, uncontracted manual assemblies, optional positive-volume object collisions, and excessive physical component counts when requested. Markdown details include suggested repair patterns such as connector-authored mates, bolted service covers, pinned levers, captured slides, hinges, clevis joints, retained shafts, and seated bearings. When `--collisions` is enabled, the Markdown details list the largest overlapping object pairs by volume so agents can repair the highest-risk interfaces first. Exact collision checks use a default 40-pair bbox-overlap budget and 30s exact-check time budget; exhausting either budget fails the file instead of silently passing a partial check.
573
+
574
+ ```bash
575
+ forgecad inspect mechanical-integrity path/to/generated-models
576
+ forgecad inspect mechanical-integrity path/to/model/main.forge.js --min-verifications 2
577
+ forgecad inspect mechanical-integrity path/to/model/main.forge.js --collisions
578
+ forgecad inspect mechanical-integrity path/to/generated-models --collisions --collision-pair-limit 250
579
+ forgecad inspect mechanical-integrity path/to/generated-models --json --timeout-ms 40000 --jobs 4
580
+ ```
581
+
554
582
  ### `forgecad check params`
555
583
 
556
584
  Sweep parameter ranges and report runtime failures, degeneracy, and new collisions.
@@ -574,6 +602,7 @@ forgecad check params path/to/model.forge.js --samples 12
574
602
  | Command | Description |
575
603
  |---------|-------------|
576
604
  | `check suite` | Run the repo invariant suite, with smoke and full profiles for the fast merge lane vs the broader regression sweep. |
605
+ | `inspect mechanical-integrity` | Inspect generated ForgeCAD models for mechanical integrity failures. |
577
606
  | `check runtime-globals` | Ensure the script sandbox does not add new lowercase injected globals. |
578
607
  | `check transforms` | Run transform and assembly invariants. |
579
608
  | `check dimensions` | Run dimension propagation invariants. |
@@ -617,7 +646,7 @@ The CLI is free for core workflows and exports. Production outputs are free to r
617
646
 
618
647
  | Free | Production outputs | Pro |
619
648
  |------|--------------------|-----|
620
- | `run`, `dev`, `studio`, `render 3d`, `export stl`, `export 3mf`, `export svg`, `check print`, `check params`, `check suite` | `cut-list`, `export sketch-pdf`, `export step`, `export brep`, `export gcode`, `export sdf`, `export urdf`, `export report`, `export cutting-layout` are free to run; Pro covers commercial use. | `render hq`, `capture gif`, `capture mp4` |
649
+ | `run`, `dev`, `studio`, `render 3d`, `export stl`, `export 3mf`, `export svg`, `check print`, `check params`, `inspect mechanical-integrity`, `check suite` | `cut-list`, `export sketch-pdf`, `export step`, `export brep`, `export gcode`, `export sdf`, `export urdf`, `export report`, `export cutting-layout` are free to run; Pro covers commercial use. | `render hq`, `capture gif`, `capture mp4` |
621
650
 
622
651
  ```bash
623
652
  forgecad license # Check signed-in account status
@@ -246,6 +246,11 @@ for the isolation win.
246
246
  callback to the prod app.
247
247
  2. Create a **new** Google OAuth client (OAuth 2.0 client ID, web app).
248
248
  Authorised redirect URI `https://beta.forgecad.io/auth/callback/google`.
249
+
250
+ Use Google Auth Platform → Clients in the Google Cloud Console for this.
251
+ Do not use `gcloud iam oauth-clients`; that command creates IAM/IAP OAuth
252
+ application resources, not the normal Google Sign-In web client that
253
+ ForgeCAD's `/auth/callback/google` flow expects.
249
254
  3. Add the four secrets to `.kamal/secrets.beta`:
250
255
 
251
256
  ```bash
@@ -19,7 +19,7 @@ npm run preview # Preview production build
19
19
  ### CLI Tools
20
20
  ```bash
21
21
  forgecad export svg examples/constraints/01-fully-constrained-rect.forge.js # Export sketch to SVG
22
- forgecad render 3d examples/cup.forge.js # Render to PNG (Puppeteer + Chrome)
22
+ forgecad render 3d examples/products/cup.forge.js # Render to PNG (Puppeteer + Chrome)
23
23
  ```
24
24
 
25
25
  See [CLI.md](../CLI.md) for full CLI documentation.
@@ -17,7 +17,7 @@ Every public API function belongs to one of 16 fundamental concepts. This docume
17
17
  - **[C11: Parameterization & UI](#c11-parameterization-ui)** — Declare user-facing controls that drive model geometry. *(7 functions)*
18
18
  - **[C12: Dimensional Demotion](#c12-dimensional-demotion)** — Extract 2D geometry from a 3D solid (section, projection). *(3 functions)*
19
19
  - **[C13: Export & Output](#c13-export-output)** — Convert geometry to external formats (STL, 3MF, SVG, DXF, G-code, PDF). *(5 functions)*
20
- - **[C14: Visual & Debugging](#c14-visual-debugging)** — Control viewport appearance and debugging aids. *(31 functions)*
20
+ - **[C14: Visual & Debugging](#c14-visual-debugging)** — Control viewport appearance and debugging aids. *(35 functions)*
21
21
  - **[C15: Import & Composition](#c15-import-composition)** — Bring external geometry or other ForgeCAD modules into the current script. *(1 functions)*
22
22
  - **[C16: Part Library](#c16-part-library)** — Pre-built parametric parts accessible via `lib.*`. *(4 functions)*
23
23
 
@@ -2868,6 +2868,46 @@ verify.centersCoincide(label: string, a: ShapeLike, b: ShapeLike, tolerance?: nu
2868
2868
 
2869
2869
  `ShapeLike`: `{ min: number[], max: number[] }`
2870
2870
 
2871
+ #### `verify.connectorDistance()` — Check the distance between two named connectors on a shape or group.
2872
+
2873
+ Use this when connectors + `matchTo()` define a static assembly interface. It proves the mate at runtime, unlike a plain source-level connector declaration. The common case is `expected = 0`, meaning the two connector origins should coincide after placement.
2874
+
2875
+ ```ts
2876
+ verify.connectorDistance("leg is seated", bench, "Rail.leg_0", "Leg0.head", 0, 0.01);
2877
+ ```
2878
+
2879
+ ```ts
2880
+ verify.connectorDistance(label: string, target: ConnectorDistanceLike, connectorA: string, connectorB: string, expected?: number, tolerance?: number): void
2881
+ ```
2882
+
2883
+ #### `verify.physicalComponentCount()` — Declare the expected physical connectivity component count for the returned visible model.
2884
+
2885
+ Use this for generated mechanical models that should have a clear component graph: one connected fixture, a purchased part plus a removable cartridge, a root assembly plus named intentional ghosts, and so on. `forgecad inspect mechanical-integrity` resolves the returned visible objects with the same physical-connectivity analysis used in the quality gate and fails if the actual component count differs.
2886
+
2887
+ This catches the common generated-CAD failure where a script returns a visually plausible artifact but the handle, screw, washer, cover, or terminal block is actually a separate island.
2888
+
2889
+ ```ts
2890
+ verify.physicalComponentCount("vise is one connected installed assembly", 1);
2891
+ ```
2892
+
2893
+ ```ts
2894
+ verify.physicalComponentCount(label: string, expected: number): void
2895
+ ```
2896
+
2897
+ #### `verify.intentionalOverlap()` — Declare that two visible objects intentionally overlap because the overlap is real manufacturing intent.
2898
+
2899
+ Use this only for overlaps that a mechanical reviewer would accept as actual matter sharing volume: welded/fused regions, overmolded inserts, potted electronics, cast-in hardware, or deliberately bonded laminations. This is not a shortcut for screws without holes, shafts without bores, covers without pockets, or parts placed with collision as a positioning hack.
2900
+
2901
+ `forgecad inspect mechanical-integrity --collisions` only honors this declaration when both shapes are returned as visible objects and the exact collision report finds that same object pair. Unused or non-visible declarations fail the quality gate so annotations cannot hide unrelated collisions.
2902
+
2903
+ ```ts
2904
+ verify.intentionalOverlap("rubber grip is overmolded on handle", rubberGrip, handleCore, "overmolded insert");
2905
+ ```
2906
+
2907
+ ```ts
2908
+ verify.intentionalOverlap(label: string, a: ShapeLike, b: ShapeLike, reason: string): void
2909
+ ```
2910
+
2871
2911
  #### `verify.notColliding()` — Check that two shapes do not collide (minGap > 0).
2872
2912
 
2873
2913
  ```ts
@@ -2880,6 +2920,23 @@ verify.notColliding(label: string, a: ShapeLike, b: ShapeLike, searchLength?: nu
2880
2920
  verify.minClearance(label: string, a: ShapeLike, b: ShapeLike, minGap: number, searchLength?: number): void
2881
2921
  ```
2882
2922
 
2923
+ #### `verify.clearanceBetween()` — Check that the clearance gap between two shapes is inside an allowed range.
2924
+
2925
+ Use this for seated and retained interfaces where a part must be close enough to be mechanically accountable, but must not collide beyond the allowed minimum. It catches both failure modes that make generated CAD look fake: parts floating away from their receiver, and parts intersecting their receiver because the pocket, bore, or running clearance was not modeled.
2926
+
2927
+ For contact, use a narrow range such as `[-0.01, 0.05]` to tolerate tiny numerical noise. For a running fit, use the intended clearance band.
2928
+
2929
+ Manifold-backed shapes use exact min-gap distance. Other backends use a mesh-derived min-gap check and say so in the verification message; keep `forgecad inspect mechanical-integrity --collisions` in the acceptance gate for positive-volume interference.
2930
+
2931
+ ```ts
2932
+ verify.clearanceBetween("cover is seated on gasket", cover, gasket, -0.01, 0.05);
2933
+ verify.clearanceBetween("carriage runs inside rail", carriage, rail, 0.2, 0.5);
2934
+ ```
2935
+
2936
+ ```ts
2937
+ verify.clearanceBetween(label: string, a: ShapeLike, b: ShapeLike, minGap: number, maxGap: number, searchLength?: number): void
2938
+ ```
2939
+
2883
2940
  #### `verify.parallel()` — Check that two face normals are parallel (within toleranceDeg degrees).
2884
2941
 
2885
2942
  ```ts
@@ -3034,7 +3091,7 @@ Mock objects appear in the viewport and spatial analysis when you run a file dir
3034
3091
 
3035
3092
  The shape is returned unchanged, so you can reference it for alignment, dimensioning, and `verify` checks.
3036
3093
 
3037
- Mock objects participate in `forgecad run` collision detection and spatial analysis. Their names appear with a `(mock)` suffix in reports.
3094
+ Mock objects participate in `forgecad run --spatial bounded|exact` collision detection and spatial analysis. Their names appear with a `(mock)` suffix in reports.
3038
3095
 
3039
3096
  In the viewport, mock objects render at reduced opacity so they are visually distinct from real geometry.
3040
3097