forgecad 0.9.16 → 0.10.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.
Files changed (147) hide show
  1. package/dist/assets/{AdminPage-CXvls4-J.js → AdminPage-DwYHz72L.js} +1 -1
  2. package/dist/assets/{BenchmarkPage-B27zk8xL.js → BenchmarkPage-a9_f-1US.js} +1 -1
  3. package/dist/assets/{BlogPage-CMAVvgQL.js → BlogPage-DodHpvmf.js} +1 -1
  4. package/dist/assets/{DocsPage-knf4I4h7.js → DocsPage-B5LePEuj.js} +8 -858
  5. package/dist/assets/EditorApp-QXsAISLR.js +16307 -0
  6. package/dist/assets/{EmbedViewer-D7ZGlFjx.js → EmbedViewer-DdEHGUMU.js} +2 -2
  7. package/dist/assets/{LandingPageProofDriven-CnevhTE8.js → LandingPageProofDriven-yhhOodbf.js} +1 -1
  8. package/dist/assets/{LegalPage-BPTUmqeg.js → LegalPage-5RbKRGYK.js} +1 -1
  9. package/dist/assets/{PricingPage-B0D4goG_.js → PricingPage-E3Rma7aV.js} +1 -1
  10. package/dist/assets/{SettingsPage-CFF-UgjI.js → SettingsPage-BJZcM97j.js} +1 -1
  11. package/dist/assets/{app-T0pDcSX4.js → app-DSYrDg0V.js} +733 -205
  12. package/dist/assets/cli/{render-C5pcIISc.js → render-ZMHR9HkV.js} +19 -46
  13. package/dist/assets/{constructionHistoryWorker-Ba2Hm58b.js → constructionHistoryWorker-AwMMWSxg.js} +1103 -349
  14. package/dist/assets/{evalWorker-vkx310U2.js → evalWorker-DbNs7Dkp.js} +3798 -1622
  15. package/dist/assets/{inspectWorker-BuTJDVX6.js → inspectWorker-CZsCFtQT.js} +1163 -409
  16. package/dist/assets/{jointPose-B_Cgedn9.js → jointPose-DO6mnXn_.js} +1 -1
  17. package/dist/assets/{manifold-BWgsjmAM.js → manifold-BGlQBBH9.js} +1 -1
  18. package/dist/assets/{manifold-rZexZI0G.js → manifold-BU-tJwQh.js} +1 -1
  19. package/dist/assets/{manifold-D6IFSkhH.js → manifold-fy2MV7K1.js} +2 -2
  20. package/dist/assets/{reportWorker-0AGij1Ru.js → reportWorker-DO6hcQbh.js} +7155 -2437
  21. package/dist/assets/{scalar-sampling-budget-J5cuzxT1.js → scalar-sampling-budget-o90NSNmF.js} +3940 -1742
  22. package/dist/assets/{scanProxyWorker-Vl4Wxa1y.js → scanProxyWorker-2GtDLk-R.js} +1 -1
  23. package/dist/assets/{javascript-1kQXfVaz.js → typescript-DBQ6RN5l.js} +874 -22
  24. package/dist/cli/render.html +1 -1
  25. package/dist/docs/index.html +3 -3
  26. package/dist/docs-raw/AI/usage.md +1 -1
  27. package/dist/docs-raw/CLI.md +63 -241
  28. package/dist/docs-raw/README.md +6 -0
  29. package/dist/docs-raw/component-model.md +17 -150
  30. package/dist/docs-raw/generated/assembly.md +139 -598
  31. package/dist/docs-raw/generated/concepts.md +245 -3501
  32. package/dist/docs-raw/generated/core.md +277 -1251
  33. package/dist/docs-raw/generated/curves.md +387 -1608
  34. package/dist/docs-raw/generated/legacy.md +162 -0
  35. package/dist/docs-raw/generated/lib.md +227 -85
  36. package/dist/docs-raw/generated/output.md +38 -73
  37. package/dist/docs-raw/generated/runtime-names.md +23 -23
  38. package/dist/docs-raw/generated/sdf.md +68 -284
  39. package/dist/docs-raw/generated/sheet-metal.md +68 -335
  40. package/dist/docs-raw/generated/sketch.md +240 -1161
  41. package/dist/docs-raw/generated/viewport.md +75 -316
  42. package/dist/docs-raw/generated/wood.md +21 -49
  43. package/dist/docs-raw/guides/coordinate-system.md +4 -42
  44. package/dist/docs-raw/guides/inspection-bundles.md +44 -442
  45. package/dist/docs-raw/guides/joint-design.md +18 -79
  46. package/dist/docs-raw/guides/positioning.md +21 -143
  47. package/dist/docs-raw/guides/scene-presentation.md +89 -0
  48. package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +25 -111
  49. package/dist/docs-raw/skills/forgecad-blockout-model.md +20 -117
  50. package/dist/docs-raw/skills/forgecad-component-model.md +23 -107
  51. package/dist/docs-raw/skills/forgecad-high-level-spec.md +47 -155
  52. package/dist/docs-raw/skills/forgecad-image-replicator.md +26 -143
  53. package/dist/docs-raw/skills/forgecad-lld.md +19 -113
  54. package/dist/docs-raw/skills/forgecad-make-a-model.md +112 -532
  55. package/dist/docs-raw/skills/forgecad-model-grader.md +38 -108
  56. package/dist/docs-raw/skills/forgecad-prepare-prompt.md +24 -211
  57. package/dist/docs-raw/skills/forgecad-project.md +13 -131
  58. package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +42 -134
  59. package/dist/docs-raw/skills/forgecad-render-inspect.md +27 -174
  60. package/dist/docs-raw/skills/forgecad-visual-spec.md +32 -112
  61. package/dist/docs-raw/skills/forgecad.md +19 -18
  62. package/dist/docs-raw/skills/index.md +2 -0
  63. package/dist/docs-raw/welcome.md +2 -2
  64. package/dist/index.html +1 -1
  65. package/dist/llms.txt +1 -2
  66. package/dist/sitemap.xml +13 -13
  67. package/dist-cli/{check-compiler-SYQ2PWOB.js → check-compiler-JTVBITCR.js} +1 -1
  68. package/dist-cli/{check-query-propagation-HIAGV62W.js → check-query-propagation-3FFLSMVN.js} +1 -1
  69. package/dist-cli/{chunk-SPZE3DUY.js → chunk-OAN5T4XD.js} +4412 -2212
  70. package/dist-cli/forgecad.js +507 -179
  71. package/dist-skill/CONTEXT.md +2172 -8377
  72. package/dist-skill/SKILL.md +15 -15
  73. package/dist-skill/docs/API/core/concepts.md +27 -157
  74. package/dist-skill/docs/CLI.md +63 -241
  75. package/dist-skill/docs/generated/assembly.md +138 -549
  76. package/dist-skill/docs/generated/core.md +277 -1251
  77. package/dist-skill/docs/generated/curves.md +387 -1609
  78. package/dist-skill/docs/generated/lib.md +227 -85
  79. package/dist-skill/docs/generated/output.md +38 -73
  80. package/dist-skill/docs/generated/runtime-names.md +16 -21
  81. package/dist-skill/docs/generated/sdf.md +68 -284
  82. package/dist-skill/docs/generated/sheet-metal.md +68 -335
  83. package/dist-skill/docs/generated/sketch.md +240 -1160
  84. package/dist-skill/docs/generated/viewport.md +75 -223
  85. package/dist-skill/docs/generated/wood.md +21 -49
  86. package/dist-skill/docs/guides/coordinate-system.md +4 -42
  87. package/dist-skill/docs/guides/inspection-bundles.md +44 -442
  88. package/dist-skill/docs/guides/joint-design.md +18 -79
  89. package/dist-skill/docs/guides/positioning.md +21 -143
  90. package/dist-skill/docs/guides/scene-presentation.md +89 -0
  91. package/dist-skill/docs/guides/surface-members.md +26 -0
  92. package/dist-skill/library/forgecad-3d-reconstruction/SKILL.md +23 -111
  93. package/dist-skill/library/forgecad-blockout-model/SKILL.md +18 -117
  94. package/dist-skill/library/forgecad-component-model/SKILL.md +21 -107
  95. package/dist-skill/library/forgecad-high-level-spec/SKILL.md +45 -155
  96. package/dist-skill/library/forgecad-image-replicator/SKILL.md +24 -143
  97. package/dist-skill/library/forgecad-lld/SKILL.md +17 -113
  98. package/dist-skill/library/forgecad-make-a-model/SKILL.md +110 -532
  99. package/dist-skill/library/forgecad-model-grader/SKILL.md +36 -108
  100. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +35 -224
  101. package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +43 -271
  102. package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +30 -99
  103. package/dist-skill/library/forgecad-project/SKILL.md +13 -133
  104. package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +29 -123
  105. package/dist-skill/library/forgecad-render-inspect/SKILL.md +25 -174
  106. package/dist-skill/library/forgecad-visual-spec/SKILL.md +30 -111
  107. package/dist-skill/website/skills/forgecad-3d-reconstruction.md +58 -0
  108. package/dist-skill/website/skills/forgecad-blockout-model.md +49 -0
  109. package/dist-skill/website/skills/forgecad-component-model.md +53 -0
  110. package/dist-skill/website/skills/forgecad-high-level-spec.md +101 -0
  111. package/dist-skill/website/skills/forgecad-image-replicator.md +63 -0
  112. package/dist-skill/website/skills/forgecad-lld.md +41 -0
  113. package/dist-skill/website/skills/forgecad-make-a-model.md +186 -0
  114. package/dist-skill/website/skills/forgecad-model-grader.md +82 -0
  115. package/dist-skill/website/skills/forgecad-prepare-prompt.md +63 -0
  116. package/dist-skill/website/skills/forgecad-project.md +26 -0
  117. package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +60 -0
  118. package/dist-skill/website/skills/forgecad-render-inspect.md +80 -0
  119. package/dist-skill/website/skills/forgecad-visual-spec.md +71 -0
  120. package/dist-skill/website/skills/forgecad.md +122 -0
  121. package/dist-skill/website/skills/index.md +26 -0
  122. package/examples/api/comparison-imported-sphere-candidate.forge.js +1 -1
  123. package/examples/api/conformal-product-ribbon.forge.js +1 -1
  124. package/examples/api/exact-sheet-shell-assembly.forge.js +1 -1
  125. package/examples/api/extrude-options.forge.js +4 -2
  126. package/examples/api/field-loft-drive-tip.forge.js +40 -0
  127. package/examples/api/guided-loft-olive-oil-bottle.forge.js +1 -1
  128. package/examples/api/highlight-debug.forge.js +10 -10
  129. package/examples/api/mesh-import-slats.forge.js +1 -1
  130. package/examples/api/real-product-curves.forge.js +1 -1
  131. package/examples/api/sculpt-box-circle-booleans.forge.js +1 -1
  132. package/examples/api/sdf-shapes.forge.js +2 -5
  133. package/examples/api/sketch-rounding-strategies.forge.js +6 -6
  134. package/examples/api/surface-member-bottle-cage.forge.js +3 -3
  135. package/examples/api/surface-member-conformal-product-ribbon.forge.js +3 -3
  136. package/examples/api/surface-member-razor-inlay.forge.js +1 -1
  137. package/examples/api/variable-sweep-test.forge.js +3 -3
  138. package/examples/mechanical/airplane-propeller.forge.js +74 -39
  139. package/examples/nurbs-surface.forge.js +1 -1
  140. package/examples/products/iphone.forge.js +1 -1
  141. package/package.json +1 -1
  142. package/dist/assets/EditorApp-BHMQlJ-D.js +0 -14686
  143. package/dist/docs-raw/guides/geometry-conventions.md +0 -52
  144. package/dist/docs-raw/guides/modeling-recipes.md +0 -78
  145. package/dist-skill/docs/guides/geometry-conventions.md +0 -52
  146. package/dist-skill/docs/guides/modeling-recipes.md +0 -78
  147. package/dist-skill/library/forgecad-visual-spec/references/prompt-template.md +0 -79
@@ -10,592 +10,170 @@ Create new ForgeCAD models in the user's active ForgeCAD project.
10
10
 
11
11
  ## Default Output Standard
12
12
 
13
- Unless the user explicitly asks for a rough blockout, toy, pure visual study, mass-production release package, or specific manufacturing process, the output is a **manufacture-realistic prototype**.
13
+ Unless the user asks otherwise, the output is a **manufacture-realistic prototype**: a model someone could fabricate, buy parts for, assemble, inspect, and iterate in a real shop — not a concept sketch, not a universal 3D-printing exercise, not a claim of certified production readiness.
14
14
 
15
- That means the model should look and behave like a serious prototype someone could fabricate, buy parts for, assemble, inspect, and iterate in a real shop or product lab. It is not a casual concept sketch, not a universal 3D-printing exercise, and not a claim of certified production readiness.
16
-
17
- - Choose processes that fit the artifact: machined, sheet-metal, tube, wood/composite, laser-cut, molded-look prototype, printed, or hybrid purchased-hardware construction as appropriate.
18
- - Include prototype-real features: wall thickness, fastener stacks, bosses, ribs, flanges, bends, seats, bushings, gaskets, cable exits, service access, toleranced clearances, and believable purchased parts.
19
- - Use production cues only when they help prototype realism. Do not invent expensive production tooling details, certification claims, or safety ratings unless the user asked for that level.
20
- - If the user asks for `production-realistic`, push toward manufacturing DFM and production-intent materials. If they ask for `printable`, make the selected printed parts honest. If they ask for `visual-CAD`, keep it clearly visual rather than pretending it is build-ready.
21
- - Checking for collisions and removing unexpected overlaps is part of the normal definition of done. The expected final collision count is zero except in rare, explicit cases such as welded, fused, overmolded, cast-in, potted, or bonded matter; those exceptions must be declared with `verify.intentionalOverlap(...)` or isolated with focused inspection so the remaining collision report is meaningful.
15
+ - Include prototype-real features: wall thickness, fastener stacks, bosses, ribs, flanges, seats, gaskets, cable exits, service access, toleranced clearances, believable purchased parts. No invented tooling details, certifications, or safety ratings unless asked.
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).
22
18
 
23
19
  ## File Placement
24
20
 
25
- All new `.forge.js` files go under the date-based directory structure:
21
+ New `.forge.js` files go under date-based directories (today's date) in the user's current ForgeCAD project or a clearly named local folder:
26
22
 
27
23
  ```
28
- YYYY/MM/DD/file.forge.js — single-file model
29
- YYYY/MM/DD/folder/main.forge.js — multi-file project entry point
30
- YYYY/MM/DD/folder/parts/*.forge.js — standalone/importable model parts
31
- YYYY/MM/DD/folder/lib/*.js — pure helpers/constants only, no geometry return
24
+ YYYY/MM/DD/file.forge.js — single-file model
25
+ YYYY/MM/DD/folder/main.forge.js — multi-file entry point (always main.forge.js)
26
+ YYYY/MM/DD/folder/parts/*.forge.js — standalone/importable parts
27
+ YYYY/MM/DD/folder/lib/*.js — pure helpers/constants, no geometry
32
28
  ```
33
29
 
34
- Use today's date for the directory. Use the user's current ForgeCAD project when one is available; otherwise use a clearly named local model folder.
35
-
36
- ### Naming conventions
37
-
38
- - Use kebab-case for file and folder names: `parametric-lego.forge.js`
39
- - Use descriptive names that communicate what the model is
40
- - For any multi-file project, name the runnable ForgeCAD entry point `main.forge.js`
41
- - Put renderable/importable parts and sub-assemblies in separate `.forge.js` files when splitting is justified; each should be standalone-runnable and importable with `require('./parts/name.forge.js', params)`.
42
- - Use plain `.js` files only for pure constants, math helpers, tables, or formatting code that does not construct and return ForgeCAD geometry.
43
- - Do not create multiple `.forge.js` files merely for organization; split only for reusable parts, large self-contained components, or independent sub-assemblies.
30
+ - Kebab-case descriptive names (`parametric-lego.forge.js`). Each part file must run standalone and import via `require('./parts/name.forge.js', params)`.
31
+ - Plain `.js` only for constants, math, tables, formatting — never geometry.
32
+ - Split files only for reusable parts or independent sub-assemblies, never for organization.
44
33
 
45
34
  ## Workflow
46
35
 
47
- 1. Load the ForgeCAD skill — always invoke the `forgecad` skill first to get API docs and authoring guidance. Read at minimum the Core API reference. If the model has moving parts, load the assembly group and `docs/permanent/guides/joint-design.md` before writing geometry. If any two parts are intended to touch or mate in the final model, read the positioning guide immediately and default to connectors + `matchTo()`.
48
- 2. Create the directory — `mkdir -p YYYY/MM/DD/[folder]` as needed.
49
- 3. Prove moving-part kinematics before detailed geometry for any mechanism, robot, linkage, hinge, slider, suspension, gripper, wheel train, drawer, door, linkage toy, or articulated product:
50
- - Author the rig first: links, frames, fixed ground references, parent/child relationships, joints, couplings, limits, defaults, mirrored-side sign mapping, and named controls.
51
- - Choose the right rig primitive before modeling the skin: use link graphs (`link()`, `edgeBetweenLinks()`, `addAngleBetweenLinks()`) for point skeletons and closed loops; use frame/connector joints (`frame()`, `revoluteJoint()`, `prismaticJoint()`, `connect()`, `match()`) when part orientation matters.
52
- - Attach only simple markers, bars, or proxy parts at first. Return the `Assembly` directly and run it at rest, mid-travel, and limit joint values until the solver, controls, connector/frame alignment, and `verify.*` checks pass.
53
- - Only after the rig works should you replace proxies with manufacture-real geometry attached to the solved links, frames, and connectors. Do not bake a posed `SolvedAssembly` as the default return just to make one pose look right.
54
- 4. Write the model — create the `.forge.js` file(s) following ForgeCAD conventions:
55
- - Treat the default build profile as `manufacture-realistic prototype`; choose and encode the artifact's manufacturing/process cues before adding styling detail
56
- - Declare `param()` / `boolParam()` for all tunable dimensions
57
- - If the model is split across files, use `main.forge.js` as the primary entry point, import renderable parts from neighboring `.forge.js` files, and keep only pure helpers/constants in plain `.js` modules
58
- - When there are multiple versions of the same object, expose the version as a choice parameter and render one selected version at a time
59
- - Use clear variable names
60
- - Build any implied internal structure as real geometry, even when it will be hidden in the final view
61
- - Build the complete physical artifact first: closed shells, installed covers, real part positions, and all meaningful internal structure in place
62
- - Make final mating geometry physically plausible: parts may touch, clear each other, or be boolean-joined, but should not unintentionally pass through each other
63
- - Model the physical artifact, not an educational diagram: no explanatory arrows, floating labels, section labels, legends, or text plaques unless the user explicitly requested a presentation/teaching view
64
- - Do not make the default returned model a cutaway, sectioned shell, permanently exploded assembly, or hidden-parts teaching view. ForgeCAD gives the user viewer and inspection tools for slicing, exploding, hiding, and looking inside after the real CAD exists.
65
- - Return the final artifact (single shape, array, named objects array, or `Assembly` for moving mechanisms)
66
- - For moving assemblies, return the `Assembly` itself whenever possible so Motion controls re-run the real kinematic solve; avoid legacy viewport-only animation APIs for new work unless the user explicitly asks for them
67
- - Treat `fillet(shape, r)` and `chamfer(shape, r)` as experimental edge treatments: Manifold can produce incorrect results and OCCT can be very slow. Prefer simpler primitive profiles, lower segment counts, targeted edge selectors, and inspection before relying on the result.
68
- 5. Validate — run `forgecad run <file>` to check for errors. For multi-file projects, always validate `main.forge.js`. For moving assemblies, also run representative joint states with `--joint`, including rest/default, mid-travel, both limits, and any coupled or mirrored poses.
69
- 6. Verify geometry — render a multi-angle visual evidence set before final delivery: whole-model context plus agent-chosen orthographic, oblique, underside, or hidden-object views that expose the relevant components and interfaces. Choose camera directions from the model's shape and likely failure modes, not from a fixed recipe. Use those views to look for internals that are accidentally visible, parts that visibly do not fit, floating details, blocked access, missing seats, and unexpected interference. For moving assemblies, render at several joint values with `--joint` so clearance, range, stops, and connected followers are proven in motion, not only at rest. Run `forgecad inspect physical components` when the model has multiple returned objects or visible attachments, run `forgecad debug assembly --fail-on warning` when the script uses `assembly()`, run `forgecad inspect mechanical-integrity <project-or-file> --collisions` before sharing generated mechanical work, and run the targeted `forgecad inspect <family> <mode>` commands that match the task (see Final Acceptance Gate and Render-Verify Loop below). For multi-file projects, render and inspect `main.forge.js`. Collision findings are model work, not FYI: remove unexpected overlaps before delivery.
70
- 7. Iterate from visual and inspection feedback — treat every render and inspection bundle as model evidence, not a checkbox. Read the normal PNGs, manifest, and evidence PNGs; convert each unexpected collision, thin region, missing section detail, wrong component count, floating body, distance gap, confusing object-color result, accidentally exposed internal structure, bad fit, bad joint sweep, unconverged pose, follower drift, or visually unsupported interface into a concrete model edit; then rerun the same targeted evidence pass until the result matches the intended physical component graph.
71
-
72
- ## Manufacturing Process Is Not Assumed
73
-
74
- Do not interpret every ForgeCAD model as a printable object.
75
- Choose the manufacturing/process cues that fit the artifact unless the user explicitly asked for a specific process. A manufacture-realistic prototype can be CNC-machined, bent sheet, tube-and-plate, wood/composite, molded-look low-volume, printed, or hybrid; the right answer depends on the load path and operating story.
76
-
77
- - For rideable products such as scooters, bikes, skateboards, carts, or mobility-adjacent devices, use realistic metal/composite/wood structural members, purchased wheels/bearings/axles/brakes/grips, and standard hardware unless the user asked for a printable toy/model.
78
- - For furniture and load-bearing structures, consider wood, sheet goods, tube, metal brackets, conventional joinery, and printed parts only where they are honest secondary components.
79
- - For enclosures, choose injection-molded, sheet-metal, CNC, thermoformed, printed, or hybrid cues based on quantity, ruggedness, serviceability, and the brief.
80
- - For fixtures and tooling, choose machined, laser-cut, welded, printed, or hybrid construction based on load, repeatability, and shop realism.
81
- - Use printing-specific features such as slicer clearances, support strategy, layer-oriented ribs, and heat-set inserts only when the selected process includes printed parts.
82
-
83
- ## Physical Artifact, Not Teaching Diagram
84
-
85
- The deliverable is the object someone would build, assemble, inspect, or export. It is not an educational display model unless the user explicitly asks for one.
86
-
87
- - Do not add explanatory text labels, arrows, callouts, legends, section-title slabs, exploded labels, coordinate axes, or "this is the motor" plaques to production geometry.
88
- - Do not use in-model text to make a vague object understandable. If the geometry needs labels to be understood, make the geometry more physically specific instead.
89
- - Explain part roles through named return objects, clear variable names, comments, BOM entries, docs, and inspection results.
90
- - Product markings are allowed only when they would exist on the real artifact: serial plates, connector labels, keyboard legends, gauge ticks, warning marks, alignment marks, service arrows, scale marks, branding, or molded icons.
91
- - Keep real markings sparse and process-appropriate. Prefer simple recessed/raised marks or icons over heavy font geometry, especially on exact/OCCT workflows.
92
- - If a temporary review view needs annotations, use `Viewport.label()` or a separate debug/presentation mode, not final exported geometry.
93
-
94
- ## Visual Style Defaults
36
+ 1. **Load the `forgecad` skill** read at least the Core API reference. Moving parts: also the assembly group and joint-design guide. Mating parts: the positioning guide; default to connectors + `matchTo()`.
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.
95
43
 
96
- Unless the user explicitly asks for a vivid, playful, toy-like, brand-specific, or unusual colorway, default to a classic high-end product palette. The model should look expensive and credible in the first render, not generically colorful.
44
+ ## Process, Style, and Variants
97
45
 
98
- - Prefer restrained material-driven colors: warm ivory, bone, cream, charcoal, graphite, satin black, brushed aluminum, stainless steel, brass, bronze, muted burgundy, dark green, navy, smoked translucent polymer, frosted clear, and natural wood where appropriate.
99
- - Use bright colors sparingly as small accents for controls, seals, indicators, warnings, or brand-neutral identity lines.
100
- - Match color to material/process: anodized or powder-coated metal, molded or dyed polymer, rubber/silicone, glass/acrylic, PCB/FR4, wood grain, leather/fabric, and standard hardware should each read differently.
101
- - Avoid one-note rainbow/neon palettes, random saturated part colors, or color groups that make a serious artifact feel like a toy unless the brief asks for that.
102
- - If the object normally has user-facing markings, include only the markings that belong on the real artifact: keyboard legends, button labels, gauge ticks, icons, connector labels, alignment marks, service arrows, and scale markings. Do not leave expected production markings blank, but do not add explanatory labels just to teach the model.
103
- - Use color to clarify part boundaries and serviceability without hiding the engineering stack: seams, fasteners, gaskets, inserts, ports, and purchased components should remain legible.
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.
104
47
 
105
- ## Variants Should Be Parameter-Selected
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.
106
49
 
107
- If the model supports several sizes, styles, revisions, or option bundles of the same object, do not display all variants in the default scene. Add a `Param.choice` / choice parameter such as `Variant`, `Preset`, `Style`, or `Configuration`, and return only the selected variant's production geometry.
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.
108
51
 
109
- Comparison lineups are acceptable only as an explicit debug or presentation mode, not the default. Keep those modes behind a clearly named parameter such as `Show comparison lineup`, and keep collision inspection focused on one selected final assembly so unrelated variants cannot create false collision findings.
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.
110
53
 
111
- ## Internal Geometry Is Part of the Model
112
-
113
- If the requested object would have meaningful internal structure in the real artifact, model that structure too. Do not satisfy an enclosure, robot, tool, mechanism, vehicle, appliance, prop, or functional manufactured part with only an exterior shell unless the user explicitly asks for a facade or blockout.
114
-
115
- Build hidden features as actual geometry:
116
-
117
- - Internal cavities, wall thickness, ribs, bosses, posts, brackets, ledges, and snap/latch features
118
- - Screw holes, inserts, bearing seats, axle paths, shaft clearances, and fastener access
119
- - Electronics volumes, battery bays, servo/motor pockets, wire channels, cable exits, and connector clearances
120
- - Mechanism clearances, travel envelopes, stops, guides, rails, hinges, gear spaces, and service access
121
- - Process-specific features such as bends, tubes, sheet-metal flanges, machined bosses, cast ribs, molded draft, weld tabs, laser-cut slots, or print-oriented ribs where appropriate
54
+ ## Physical Artifact, Not Teaching Diagram
122
55
 
123
- Do not reveal hidden structure by permanently cutting away the production geometry. Keep the returned default model faithful to the real closed artifact, with covers installed and parts in their actual assembled positions.
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.
124
57
 
125
- When internals are hidden by the final exterior, verify them with exploration tools instead of changing the artifact: render underside or alternate camera views, use `forgecad inspect sections at|stack|sample`, use viewer-only cut planes or explode controls, temporarily make a shell transparent, or add named ghost objects for fit checks. Those views are diagnostic/presentation modes; they must not replace the real model unless the user explicitly asked for a cutaway teaching model.
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.
126
59
 
127
60
  ## Kinematics-First for Moving Parts
128
61
 
129
- For moving models, the mechanism rig is the source of truth. Do not start with finished housings, arms, shells, covers, or decorative surfaces and then try to retrofit motion. Build the motion structure first, prove it, and attach geometry to it.
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.
130
63
 
131
- - Decide the rig shape before geometry: point links for closed-loop skeletons and distance/angle constraints; frames and connector joints for serial rigid parts whose orientation matters.
132
- - Name every moving degree of freedom and encode its limits/defaults at the rig level. For mirrored revolute axes, make the sign mapping explicit instead of assuming equal values create mirrored poses.
133
- - Add simple proxy geometry only to expose the rig: pivot markers, bars between links, slider blocks, wheel discs, or frame axes. Use those proxies to verify the mechanism before adding real material.
134
- - Attach final geometry to solved links, frames, and connectors. A visible arm, cover, wheel, drawer, or follower should move because it is mated to the rig, not because a final `rotate()` or `translate()` happens to make one pose look assembled.
135
- - Keep the default return as the unsolved `Assembly` when possible. This lets Motion controls and CLI `--joint` overrides re-run the real solve.
136
- - Put representative pose checks in the script with `verify.*`: convergence, connector origins coinciding, link lengths holding, end effectors reaching their expected points, followers remaining attached, and required running clearances staying positive.
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:
137
67
 
138
- At minimum, run the mechanism at rest, mid-travel, both limits, and any mirrored/coupled poses:
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
+ ```
139
72
 
140
- ```bash
141
- node dist-cli/forgecad.js run model.forge.js --joint "theta=0"
142
- node dist-cli/forgecad.js run model.forge.js --joint "theta=45"
143
- node dist-cli/forgecad.js run model.forge.js --joint "theta=90"
144
- node dist-cli/forgecad.js render 3d model.forge.js /tmp/model-theta-45.png --joint "theta=45" --camera iso --size 700
145
- ```
146
-
147
- Use the real joint/control names from the assembly. For multiple controls, repeat `--joint`: `--joint "hip=20" --joint "knee=-35"`. If any pose fails to solve, clamps unexpectedly, breaks a connector check, or creates a new collision, the rig is not ready for final geometry.
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.
148
77
 
149
78
  ## Mechanical Assembly Contract
150
79
 
151
- For mechanical models, a ForgeCAD script is not done when it merely looks assembled. Every visible piece must have a believable 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.
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.
152
81
 
153
- - For bespoke fixed assemblies that do not match an existing `lib.*` helper, start from `examples/api/static-assembly-connectors.forge.js`: build each part in local coordinates, pick one root part, place every other touching part with `matchTo()`, and verify the mate with `verify.connectorDistance(...)`. Do not use final `translate()` calls as assembly contracts.
154
- - If you use `assembly().addPart()`, do not treat `addFixed()`, `addRevolute()`, or `addPrismatic()` with a manual `frame: Transform.identity().translate(...)` as a physical contract. Manual joint frames are acceptable only as a temporary scaffold. Before delivery, convert mating interfaces to connectors with `connect()` / `match()` where the interfaces physically meet, or prove the manual joint with `forgecad debug assembly --fail-on warning` and documented geometry.
155
- - A named assembly part should not contain unintentional disconnected bodies. If a "cover plate" contains floating pull tabs, loose screw heads, or a separate gasket, either boolean-join the manufactured features, model the fasteners/seals as separate named parts, or provide the receiving holes/lands that explain the separation.
156
- - Screws are not decoration. A screw needs a clearance/counterbore in the cover, a receiving threaded hole/boss or through stack in the parent, enough material around both, and aligned axes from one shared bolt pattern.
157
- - Handles and levers need a load path. Model the hub-to-arm connection, pivot pin/bore, thrust washers or shoulders, stops/detents where relevant, and the connected follower/contact surface. A handle tangent to a hub is a failed mechanism.
158
- - Covers, doors, cartridges, and service panels need seats. Model ledges, gasket grooves, bosses, snap hooks, tabs, or hinge barrels, then show how the removable part is retained.
159
- - Cables, wires, and tubes need receiving geometry. Model a gland, grommet, clamp, socket, ferrule, routed channel, or hose barb; do not let a cylinder end in open space.
160
- - Purchased loose parts may remain separate bodies, but they should be named as purchased hardware or consumables and should sit in believable sockets, bores, races, guides, or fastener stacks.
161
- - Encode interface intent with `verify.*`, not only comments. Use `verify.clearanceBetween("cover is seated on gasket", cover, gasket, -0.01, 0.05)` for contact/seated fits and clearance bands, `verify.minClearance(...)` or `verify.notColliding(...)` for keep-out/running gaps, and `verify.connectorDistance(...)` for connector-authored mates. Part counts and generic dimensions are useful supporting checks, but they do not prove an interface by themselves.
82
+ - Bespoke fixed assemblies: build each part in local coordinates, pick one root, place every touching part with `matchTo()`, verify each mate with `verify.connectorDistance`. Final `translate()` calls are not assembly contracts.
83
+ - 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.
84
+ - 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.
85
+ - 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.
86
+ - 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.
87
+ - Covers, doors, cartridges, service panels need seats: ledges, gasket grooves, bosses, snap hooks, tabs, or hinge barrels plus a visible retention story.
88
+ - Cables, wires, tubes need receiving geometry: gland, grommet, clamp, socket, ferrule, routed channel, or hose barb. Never let a cylinder end in open space.
89
+ - Purchased loose parts may stay separate bodies name them as purchased hardware/consumables and seat them in believable sockets, bores, races, or fastener stacks.
90
+ - 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.
91
+ - 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.
162
92
 
163
- Do not introduce canned finished-object helpers for project-specific assemblies. When a repeated physical pattern appears, build the project-specific interface explicitly: use `lib.fastenerSet()` or `lib.boltPattern()` for screw stacks, real bores/counterbores/pockets for purchased parts, connectors plus `matchTo()` for mating parts, and `verify.*` checks for seated contact and running clearances. Reusable library vocabulary should be primitives, cutters, patterns, and mechanical contracts, not finished thermostat backplates, clamp brackets, hinge leaves, or other canned objects.
93
+ Treat `fillet()`/`chamfer()` as experimental (Manifold can be incorrect, OCCT slow); prefer profile-level rounding and inspect before relying on the result.
164
94
 
165
- ## Final Geometry Should Be Physically Plausible
95
+ ## Imported Parts (User-Supplied 3D Files)
166
96
 
167
- Treat each returned part as real matter occupying space. In the final build, separate parts should not intersect unless the intersection is the actual manufacturing intent, such as a welded/fused region, an overmolded insert, or a boolean-unioned solid that is no longer a separate part.
97
+ 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-3d-reconstruction`, a different request).
168
98
 
169
- Do not use final interpenetration as a placement shortcut. For joints and interfaces, model the contact, clearance, or connector honestly: pins in holes, shafts in bearing seats, tabs in slots, hinges with knuckle clearance, screws through clearance holes, nested parts with wall offsets, and moving parts with their travel envelope accounted for.
99
+ - 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()`.
100
+ - 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.
101
+ - 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.
102
+ - 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.
170
103
 
171
- Temporary collisions during construction are fine when they are part of how the model is made or verified: oversized cutter solids before `difference()`, overlapping primitives before `union()`, transparent ghost parts for fit checks, or exploratory joint layouts. Those temporary bodies should be consumed, hidden, named as ghosts, or isolated with inspection filters so final collision findings stay meaningful.
104
+ ## Collision Policy
172
105
 
173
- If a final overlap is real manufacturing intent, document the exact visible object pair with `verify.intentionalOverlap("rubber grip is overmolded on handle core", rubberGrip, handleCore, "overmolded bonded grip")`. Use this only for welded, fused, overmolded, cast-in, potted, or bonded matter. The mechanical-integrity gate honors it only when the same visible object pair has a confirmed exact collision; unused or non-visible declarations still fail.
106
+ Each returned part is real matter. Expected final collision count: **zero**.
174
107
 
175
- Before delivery on any multi-part, internal, or mechanical model, run `forgecad inspect fit interference`, read the collision evidence PNGs, and check `manifest.json`. Fix unexpected overlaps; collision removal is part of the expected modeling pass, not optional polish. If a collision is intentional, declare the exact visible pair with `verify.intentionalOverlap(...)` or isolate that inspection with `--focus` / `--hide` so the remaining collision report proves the final assembly is real.
108
+ - Only exceptions: welded, fused, overmolded, cast-in, potted, or bonded matter declared with `verify.intentionalOverlap` on the exact visible object pair with the physical reason. The mechanical-integrity gate honors a declaration only when that pair has a confirmed exact collision; unused or non-visible declarations still fail.
109
+ - 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.
110
+ - 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.
111
+ - Collision removal is part of the modeling pass, not optional polish.
176
112
 
177
113
  ## Final Acceptance Gate
178
114
 
179
- Before telling the user the model is done, prove both technical validity and visual plausibility. A model can pass `forgecad run` and still be wrong because a rail, cable, trim line, handle, or fastener is merely hovering over a curved surface. Use this gate for any model with multiple bodies, surface-mounted details, cables/strings, rails/tracks, handles, product skins, visible hardware, or hidden mating geometry.
180
-
181
- 1. State the intended physical component graph. Decide whether the final artifact should be one connected component, several intentionally separate components, or a selected assembly plus named ghosts. Then run:
182
-
183
- ```bash
184
- forgecad inspect physical components model.forge.js --camera iso
185
- ```
186
-
187
- The reported component count must match the design intent. Treat unexpected islands, accidental fusion, or bbox-only "touching" that does not make physical sense as model bugs.
188
-
189
- If the script uses `assembly()`, also run:
190
-
191
- ```bash
192
- forgecad debug assembly model.forge.js --fail-on warning
193
- ```
194
-
195
- Fix warnings about multiple roots, manual joint contracts, disconnected bodies inside parts, unused connectors, solve warnings, and collisions before delivery. If a warning is truly intentional, rename the part or add a short code comment so a reviewer can see the physical reason.
196
-
197
- For generated mechanical projects or batches, also run:
198
-
199
- ```bash
200
- forgecad inspect mechanical-integrity . --collisions
201
- ```
202
-
203
- This is the shareability gate. It fails on missing `verify.*` checks, missing mechanical-interface verification, fragmented named groups, uncontracted manual assemblies, positive-volume object collisions, timeouts, and runtime failures. Do not share a generated mechanical model while this gate is red unless the user explicitly asked for a rough concept/blockout.
204
-
205
- The model should include at least one verification that proves a mechanical interface, not just object count. Prefer checks such as `verify.clearanceBetween("bearing is seated in pocket", bearing, housing, -0.01, 0.1)`, `verify.minClearance("carriage clears rail", carriage, rail, 0.15)`, `verify.notColliding("cover screw clears parent hole", screw, parent)`, or `verify.connectorDistance("leg connector is seated", bench, "Rail.leg_0", "Leg0.head", 0, 0.01)`.
206
-
207
- For moving assemblies, this gate is incomplete until the rig has been run through representative control states. Use `--joint` overrides and/or in-script `solve(state)` verification to cover rest/default, mid-travel, physical limits, coupled states, and mirrored-side poses. Each tested pose should keep the solver converged, attached geometry following the rig, and clearances/collisions within the intended mechanical contract.
208
-
209
- 2. Run collision evidence and read both the manifest and images:
210
-
211
- ```bash
212
- forgecad inspect fit interference model.forge.js /tmp/model-collisions-inspect --camera <collision-evidence-camera> --force --size 700
213
- jq '.evidence.collisions | {collisionCount, collisions, warnings}' /tmp/model-collisions-inspect/manifest.json
214
- ```
215
-
216
- `collisionCount` should be zero unless an overlap is deliberately manufactured, fused, welded, overmolded, or isolated with `--focus` / `--hide`. Do not ignore the evidence PNGs; visually inspect where the findings or warnings appear.
217
-
218
- 3. Render risk-specific views, not only a hero shot. Build a small visual evidence set that answers the model's physical questions from more than one direction:
219
-
220
- - Render one whole-model hero/context view plus the agent-chosen orthographic or oblique views that expose likely failure modes for this specific object.
221
- - Use opposing, underside, interior-facing, or grazing views when they are the views most likely to catch internals accidentally showing through openings, transparent shells, thin walls, bad boolean cuts, or covers that do not actually close.
222
- - Render focused views for important components or subsystems with `--focus`, especially mounts, covers, hinges, cartridges, electronics, routed cables, fastener stacks, moving links, and purchased parts.
223
- - Render hidden-object views with `--hide` when an exterior shell, cover, fixture, or decorative layer blocks the interface being checked. This is for evidence only; do not turn the default returned model into a cutaway or exploded teaching scene.
224
- - For each meaningful interface, capture at least one contextual view with neighboring parts present and one isolated/focused view that makes the interface easy to inspect.
225
-
226
- Use these risk prompts when deciding where to look:
227
-
228
- - long products, rails, handles, and tools: choose views along and across the dominant length so bends, sag, and end attachments are visible
229
- - enclosures, shells, covers, and products with internals: choose exterior and hidden-cover views that reveal whether internal structures fit, stay hidden when they should, and leave service access
230
- - sockets, underside joins, stands, brackets, and handles: choose views that look directly into the mating face or underside; use `inspect sections at|stack|sample` when hidden geometry must be checked
231
- - cables, strings, belts, tubes, and hoses: choose views that show both endpoints, route clearance, sag, and termination hardware
232
- - surface details on curved ProductSkin bodies: choose grazing and contextual views that prove details conform or are embedded as intended
233
-
234
- 4. Do a visual attachment audit. For every detail that should be connected, ask: "Where does this physically enter, seat, wrap, terminate, or fasten?" Check that view directly. Common failures to fix before delivery:
235
-
236
- - a flat rail or arrow bed sitting on top of a curved shell instead of being recessed, saddled, socketed, or structurally blended into the body
237
- - strings/cables that pass through space without terminal knots, hooks, holes, posts, ferrules, pulleys, or anchors
238
- - decorative brass/trim lines floating above the body instead of following a ProductSkin surface or being built as inset/raised strips with believable thickness
239
- - handles/grips touching only by a tangent or thin face instead of having a neck, bridge, socket, screws, or overmolded landing
240
- - small hardware or gems that are bbox-connected but visually read as levitating; replace with flush/inset seats or explicit brackets
241
-
242
- 5. Treat ProductSkin and surface-member limitations honestly. If `inspect fit interference` reports boolean-test warnings because a sampled `Product.skin` loft has boundary edges, distinguish that from real collision findings. You may still deliver if `collisionCount` is clean, the intended connectivity is correct, and the visual attachment audit passes. Mention the residual warning briefly in the final response.
243
-
244
- 6. Final response must name the evidence: commands run, render views checked, joint values tested for moving assemblies, any focus/hide filters used, component count, collision count, and any residual warnings or intentional exceptions. Do not just say "validated."
245
-
246
- ## Render-Verify Loop
247
-
248
- You are building blind unless you render. `forgecad run` only checks that code executes — it cannot tell you a hole is in the wrong place, an internal rib is poking through a cover, or a part doesn't fit. Render from different angles chosen for the model's actual geometry and look at every result.
249
-
250
- ### How to render and inspect
251
-
252
- ```bash
253
- # Render from multiple agent-chosen angles; do not stop at one hero view.
254
- node dist-cli/forgecad.js render model.forge.js /tmp/preview.png \
255
- --camera <context-az:el> \
256
- --camera <failure-mode-az:el> \
257
- --camera <interface-az:el> \
258
- --size 600
259
-
260
- # Camera format: --camera az:el (degrees). Repeatable.
261
- # Choose camera directions that prove or disprove the physical questions in this model.
262
- # Good evidence sets usually include a context view plus views aimed at hidden internals,
263
- # underside joins, mating faces, routed paths, thin walls, or surface attachments.
264
- ```
265
-
266
- Then read the PNG(s) to inspect visually. Single camera → single file. Multiple cameras → suffixed files (`_az45_el25.png`). If any angle reveals internal geometry where the outside should be closed, a cover that does not seat, a hidden part that cannot fit, or a detail that floats/intersects, edit the model and rerender the same angles.
267
-
268
- ### Focused visual evidence
269
-
270
- Use focused and hidden-object renders to collect evidence from the parts a normal hero shot hides. The goal is to answer specific physical questions: "is the cover seated?", "does the cable enter a gland?", "are the screws aligned with bosses?", "does the bracket actually touch the frame?"
271
-
272
- ```bash
273
- # Isolate the target subsystem from several angles.
274
- node dist-cli/forgecad.js render model.forge.js /tmp/model-cover-stack.png \
275
- --focus "Cover,Screws,Gasket,Bosses" \
276
- --camera <subsystem-context-az:el> \
277
- --camera <seating-interface-az:el> \
278
- --camera <fastener-axis-az:el> \
279
- --size 700
280
-
281
- # Hide exterior clutter to inspect the installed internals in context.
282
- node dist-cli/forgecad.js render model.forge.js /tmp/model-internals.png \
283
- --hide "Outer Shell,Top Cover" \
284
- --camera <internal-context-az:el> \
285
- --camera <clearance-path-az:el> \
286
- --camera <underside-or-access-az:el> \
287
- --size 700
288
- ```
289
-
290
- For important components, collect both:
291
-
292
- - Context view — neighbors present, proving the part belongs in the final assembly.
293
- - Focus view — only the relevant objects visible, making small gaps, intersections, missing seats, and floating parts easy to see.
294
-
295
- Prefer CLI `--focus` / `--hide` filters, named views, or parameter-selected diagnostic modes over changing production geometry. Use the object paths from `node dist-cli/forgecad.js ls model.forge.js --tree` when you are unsure what the filters should target.
296
-
297
- ### Structured inspection bundles
298
-
299
- After the normal PNG render, run targeted `forgecad inspect <family> <mode>` commands and read both the evidence PNGs and `manifest.json`. Keep inspection bundles targeted to the current risk; for any multi-part final build, `inspect fit interference` is mandatory:
300
-
301
- ```bash
302
- forgecad inspect fit interference model.forge.js /tmp/model-collisions-inspect --camera <collision-evidence-camera> --force --size 700
303
- ```
304
-
305
- ### Inspection feedback loop
306
-
307
- Use inspections as the repair loop for the model:
308
-
309
- 1. Ask one physical question before each bundle: "what evidence would prove this model is wrong?"
310
- 2. Run the smallest inspection command that can answer it. Add `inspect visual image` or `inspect visual objects` alongside the risk evidence when you need visual context or object-color lookup.
311
- 3. Read `manifest.json` first for counts, pairs, thresholds, filters, object mappings, and warnings.
312
- 4. Read the evidence PNGs next, using `inspect visual image` and `inspect visual objects` outputs to locate findings in the real geometry when needed.
313
- 5. Convert findings into model edits:
314
- - `collisions`: add real receiving geometry, holes, seats, clearance, connectors, or `verify.intentionalOverlap(...)` for true fused/overmolded/bonded matter only.
315
- - `thickness`: change wall, rib, boss, shell, slot, or process dimensions; set material/process thresholds before accepting the result.
316
- - `sections`: add or repair the hidden cavity, screw path, pocket, cable route, captured part, or internal support the slice exposed.
317
- - `connectivity`, `floating`, and `distance`: fix disconnected islands, accidental fusion, unsupported bodies, or surprising gaps in the component graph.
318
- - `objects`, `depth`, `normals`, and `zebra`: fix missing objects, confusing object identity, flipped/odd surfaces, faceting, protrusions, and bad surface continuity.
319
- 6. Rerun the same targeted evidence command after the edit so the before/after evidence is comparable. Add a second evidence command only when the repaired area creates a new risk.
115
+ Prove technical validity and visual plausibility before declaring done. Apply to any model with multiple bodies, surface details, cables, rails, handles, product skins, or hidden mating geometry.
320
116
 
321
- ### Keep CLI inspection scenes small
117
+ 1. **State the intended physical component graph** — one connected component, several intentionally separate, or a selected assembly plus named ghosts — then run `forgecad inspect physical components` and require the count to match. Unexpected islands, accidental fusion, or bbox-only "touching" are model bugs.
118
+ - 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.
119
+ - 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.
120
+ - Include at least one verification that proves a mechanical interface (clearance band, keep-out, connector mate), not just object counts.
121
+ - 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.
122
+ 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.
123
+ 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:
124
+ - long products, rails, handles, tools: views along and across the dominant length (bends, sag, end attachments)
125
+ - enclosures/shells with internals: exterior plus hidden-cover views (fit, concealment, service access)
126
+ - sockets, underside joins, stands, brackets: look directly into the mating face or underside; `inspect sections` for hidden geometry
127
+ - cables, strings, belts, tubes: both endpoints, route clearance, sag, termination hardware
128
+ - surface details on curved ProductSkin bodies: grazing and contextual views proving details conform or embed
129
+ 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:
130
+ - a flat rail or bed sitting on a curved shell instead of being recessed, saddled, socketed, or blended in
131
+ - strings/cables passing through space without knots, hooks, holes, posts, ferrules, pulleys, or anchors
132
+ - trim lines floating above the body instead of following the surface or being inset/raised strips with real thickness
133
+ - handles/grips touching only by a tangent instead of having a neck, bridge, socket, screws, or overmolded landing
134
+ - small hardware/gems that are bbox-connected but visually levitate; give them flush/inset seats or explicit brackets
135
+ 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.
136
+ 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."
322
137
 
323
- When using CLI inspection commands, make the scene as few returned/named objects as the requirement allows. The goal is not to hide required geometry; it is to keep the evidence small enough that the agent can reason about it properly.
138
+ ## Manufacturing Outputs
324
139
 
325
- - Return one selected configuration, not every variant, option bundle, or debug lineup.
326
- - Include only the parts, ghosts, and fixtures needed to prove the current risk. If a collision, clearance, thickness, or section check concerns three objects, inspect those three objects instead of the whole shop floor.
327
- - Prefer `--focus` / `--hide` and parameter-selected diagnostic modes over adding permanent extra objects to the default scene.
328
- - Collapse decorative or already-proven subassemblies into fewer named objects when their internal boundaries are irrelevant to the inspection. Keep separate names only where object identity matters for collisions, masks, clearances, BOM roles, or mechanical contracts.
140
+ A manufacture-realistic model must yield a package a shop can consume, not just a clean viewport.
329
141
 
330
- Small inspection scenes make `manifest.json`, mask colors, collision pairs, component counts, and section images cognitively tractable. If the agent cannot hold the scene in its head, it cannot debug the model honestly.
142
+ - Register every purchased and fabricated part with `bom()` (exact spec, quantity, purpose) so the BOM lives in the model `forgecad export report` must reproduce it without prose supplements.
143
+ - Put `dim()` annotations on the dimensions a builder must hit: overall envelope, critical interfaces, mating bores and bolt patterns.
144
+ - 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.
145
+ - 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.
331
146
 
332
- For faster iteration, request the evidence that matches the current risk:
147
+ ## Render and Inspect Cadence
333
148
 
334
- - `inspect fit interference` — final multi-part assemblies, fixtures, enclosures, ghost fit checks, moving clearances, and any parts intended to touch without overlapping. Visually inspect this evidence; do not rely only on the count.
335
- - `inspect manufacture thickness` — printed shells, sheet metal, molded walls, ribs, bosses, holes, snap fits, slots, brackets, and any feature where thin walls can fail. Set thresholds for the selected material/process instead of blindly accepting defaults.
336
- - `inspect sections at|stack|sample` — hidden internals, cavities, wire channels, pockets, screw paths, captured components, and anything a surface render cannot show.
337
- - `inspect physical components` — parts that should be one connected solid, parts that should remain separate, and assemblies where floating or accidentally fused bodies matter.
338
- - `inspect physical floating` and `inspect physical gaps` — loose bodies, unsupported bodies, or surprising gaps in the component graph.
339
- - `inspect visual objects` — object identity, missing named parts, duplicate geometry, hidden mocks, and color/name confusion.
340
- - `inspect visual depth` / `inspect visual normals` / `inspect surface zebra` — occlusion, orientation, flipped surfaces, odd protrusions, faceting, and surface continuity.
341
- - `inspect visual image` — the human-readable view that keeps structured evidence grounded.
149
+ **You are building blind unless you render.** `forgecad run` passing only means the code didn't crash it cannot tell you a hole is misplaced, a rib pokes through a cover, or a part doesn't fit. Render from angles chosen for the model's actual geometry and read every PNG. For command syntax, evidence selection, and manifest reading, use the `forgecad-render-inspect` skill and the CLI docs this skill fixes only the cadence and the gates.
342
150
 
343
- Useful manifest checks:
151
+ Render after every feature addition, boolean cut, symmetric copy placement, and the last feature. Inspect after adding hidden geometry a surface render cannot prove, after adding or moving mating parts, ghosts, connectors, thin walls, or screw holes, and before delivery with thresholds set for the material/process.
344
152
 
345
- ```bash
346
- jq '.evidence.collisions | {collisionCount, collisions, warnings}' /tmp/model-inspect/manifest.json
347
- jq '.evidence.thickness.objects[] | {name, minThickness, p05Thickness, criticalAreaPercent, warningAreaPercent, unresolvedAreaPercent}' /tmp/model-inspect/manifest.json
348
- jq '.evidence.connectivity | {componentCount, edges, warnings}' /tmp/model-inspect/manifest.json
349
- ```
350
-
351
- Treat unexpected collision findings, critical thin regions, high unresolved thickness, missing sections, or wrong component counts as model bugs. If an overlap is intentional, make that explicit in the model or isolate the inspection with `--focus` / `--hide` so the remaining findings are meaningful:
352
-
353
- ```bash
354
- forgecad inspect fit interference model.forge.js /tmp/model-fit-collisions --focus "Bracket,Screw Ghost" --camera <fit-evidence-camera> --force
355
- forgecad inspect sections sample model.forge.js /tmp/model-fit-sections --plane yz --count 5 --focus "Bracket,Screw Ghost" --force
356
- forgecad inspect manufacture thickness model.forge.js /tmp/model-thickness --min 1.6 --warn 2.4 --camera <thickness-evidence-camera> --force
357
- ```
358
-
359
- ### When to render
360
-
361
- - After every feature addition (not just at the end)
362
- - After any boolean subtraction that creates a hole/pocket
363
- - After placing symmetric copies (to check symmetry)
364
- - After adding the last feature (final check)
365
-
366
- ### When to inspect
367
-
368
- - After adding hidden/internal geometry that a surface render cannot prove
369
- - After adding or moving mating parts, ghosts, connectors, holes, pockets, or clearances
370
- - After adding thin walls, ribs, slots, snap features, bosses, or screw holes
371
- - Before final delivery, with the evidence that matches the remaining risks, and with thresholds appropriate to the model
372
-
373
- ### Ghost parts for fit verification
374
-
375
- When building a part that holds/contains another object (enclosure, mount, bracket), render both together with the contained object transparent:
376
-
377
- ```js
378
- // Ghost servo for visual fit check
379
- const ghost = box(servoW, servoD, servoH)
380
- .placeReference('center', [0, 0, wallThick])
381
- .color('#ff4444').material({ opacity: 0.4 });
382
-
383
- return [
384
- { name: 'Mount', shape: mount.color('#556B2F') },
385
- { name: 'Servo Ghost', shape: ghost },
386
- ];
387
- ```
388
-
389
- This immediately reveals: does it fit? Does it collide with walls? Does the shaft clear the opening?
390
-
391
- ### Use verify for acceptance, console.log for traces
392
-
393
- Use `verify.*` for dimensions and clearances that decide whether the model is acceptable. Use `console.log()` only for explanatory traces that help you read the run output.
394
-
395
- ```js
396
- verify.greaterThan("wall remains around slot", (outerW - slotW) / 2, 1.6);
397
- verify.greaterThan("hole clears flange edge", flangeW / 2 - holeX - holeDia / 2, 2.0);
398
- console.log("wall remaining:", ((outerW - slotW) / 2).toFixed(1));
399
- ```
400
-
401
- Output appears under "Script output:" in `forgecad run`.
402
-
403
- ### Self-inspecting shared constants
404
-
405
- For multi-file projects with a shared constants file (e.g. `shared-dims.js`), add a summary block that prints all computed values when the file is run directly. This replaces one-off throwaway debug scripts.
406
-
407
- ```js
408
- // At the bottom of shared-dims.js:
409
- if (require.main === module) {
410
- console.log('=== SERVO ===');
411
- console.log(' body:', servo.bodyW, '×', servo.bodyD, '×', servo.bodyH, 'mm');
412
- // ... all computed dimensions, clearance checks, etc.
413
- console.log('✓ All validations passed.');
414
- }
415
- ```
416
-
417
- Run with `node shared-dims.js` to see the full dimension summary. Don't write throwaway `node -e "require(...)..."` scripts — put the inspection logic in the source file itself where it stays up to date automatically.
418
-
419
- ## ForgeCAD Quick Reference
420
-
421
- The `forgecad` skill has full API docs.
422
-
423
- Key primitives:
424
-
425
- - `box(x, y, z)`, `cylinder(h, r, rTop?, segments?)`, `sphere(r)`, `torus(R, r)`
426
- - `union()`, `difference()`, `intersection()`
427
- - `.fillet()`, `.chamfer()` for experimental edge treatments only
428
- - `param(name, default, opts)`, `boolParam(name, default)`
429
- - Return `[{ name, shape, color }]` for multi-part colored models
430
-
431
- Primitive placement convention:
153
+ **Keep inspection scenes small.** Return one selected configuration; include only the parts needed to prove the current risk (if a check concerns three objects, inspect those three, not the whole shop floor); prefer `--focus`/`--hide` and parameter-selected diagnostic modes over permanent extra objects; collapse proven subassemblies into fewer named objects where identity doesn't matter for collisions, masks, or contracts. If you cannot hold the scene in your head, you cannot debug it honestly.
432
154
 
433
- - `box()` and `cylinder()` are centered in X/Y and sit on `z=0`.
434
- - `sphere()` and `torus()` are centered in X/Y/Z.
435
- - Use `.placeReference('center', [0, 0, 0])` when a box or cylinder should be centered around the origin.
436
- - Do not pass `center: true` or a positional `true` to primitives; that is stale OpenSCAD-style guidance.
155
+ **Ghost parts for fit checks.** When a part holds or contains another object, render both with the contained object as a compact transparent named ghost — e.g. a `box()` at the seat position with `.color('#ff4444').material({ opacity: 0.4 })`, returned as `{ name: 'Servo Ghost', shape: ghost }`.
437
156
 
438
- Key composition tools:
157
+ Use `verify.*` for dimensions and clearances that decide acceptance; `console.log()` only for explanatory traces (shown under "Script output:" in `forgecad run`).
439
158
 
440
- - Connectors + `matchTo()` for parts that should touch in the final model
441
- - `assembly()` link graphs, frames, and connector joints for moving mechanisms
442
- - `group()` for local-coordinate subassemblies
443
- - `attachTo()` for quick bounding-box placement
444
- - `.translate()` / `.rotate()` for free offsets or bridging computed locations, not as the default assembly contract
159
+ ## Build Bottom-Up
445
160
 
446
- ## Managing Complexity: Build Bottom-Up
161
+ You cannot target a complex model in one pass. Decompose, solve the smallest piece, verify, compose upward:
447
162
 
448
- You cannot target a complex model directly. A chess set, a mechanical assembly, an articulated figure — if you try to write the whole thing in one pass, you will get lost in coordinate math, produce subtle geometry bugs, and waste cycles debugging a tangled script.
163
+ 1. **Decompose** into the smallest parts you can reason about confidently. A gear is not small a single tooth profile is.
164
+ 2. **Solve one piece** in isolation: own variables, own return, no connection logic yet.
165
+ 3. **Verify it**: `forgecad run`, then render and read the PNG. Fix while the scope is tiny.
166
+ 4. **Compose one layer at a time**, verifying at each level so a break is always at the newest seam.
449
167
 
450
- Instead, do what engineers do: decompose, solve the smallest piece, verify, then compose upward.
451
-
452
- ### The process
453
-
454
- 1. Decompose — Break the model into the smallest independent parts you can reason about confidently. A "gear" is not a small part — a single tooth profile is. A "house" is not small — a wall panel with a window cutout is.
455
-
456
- 2. Solve the smallest piece — Write the geometry for one part. Keep it isolated: its own variables, its own return statement. Don't think about how it connects to the rest yet.
457
-
458
- 3. Verify — Run `forgecad run` to check for errors, then `forgecad render` to actually see the shape. Read the rendered PNG. Does it match your intent? Are holes where they should be? Are walls thick enough? Fix it now while the scope is tiny. `forgecad run` passing does not mean the geometry is correct — it only means the code didn't crash.
459
-
460
- 4. Compose upward — Once a piece is verified, combine it with the next piece. Verify again. Each level of assembly should be independently checkable.
461
-
462
- 5. Repeat — Keep climbing. Each step adds one layer of complexity on top of verified foundations. If something breaks, you know it's in the new layer, not buried three levels deep.
463
-
464
- ### Why this matters
465
-
466
- - Debugging is local. When a verified piece breaks after composition, the bug is at the seam, not inside the piece.
467
- - You avoid coordinate chaos. Small pieces use simple local coordinates. Transforms and placements happen at composition time, one layer at a time.
468
- - Iteration is cheap. Changing a tooth profile doesn't require re-reading 200 lines of gear assembly code.
469
-
470
- ### In practice
471
-
472
- For a model with more than ~3 distinct geometric features, explicitly plan the decomposition before writing any geometry. Write each piece as a function or variable block, verify it, then combine. Do not skip verification steps to "save time" — it costs more time in the end.
168
+ For any model with more than ~3 distinct geometric features, plan the decomposition explicitly before writing geometry.
473
169
 
474
170
  ## Scene Presentation
475
171
 
476
- Always set up a proper `scene()` to make models look polished. A bare model with default lighting looks flat and unfinished.
477
-
478
- ### Minimum scene setup
479
-
480
- Every model should have at least:
481
-
482
- ```js
483
- scene({
484
- background: { top: '#1a1a2e', bottom: '#0a0a14' },
485
- camera: { position: [x, y, z], target: [0, 0, 0], fov: 42 },
486
- environment: { preset: 'studio', intensity: 0.6 },
487
- lights: [
488
- { type: 'ambient', color: '#c8cdd4', intensity: 0.15 },
489
- { type: 'directional', position: [80, -60, 120], target: [0, 0, 0], color: '#fff4e0', intensity: 1.8, castShadow: true },
490
- { type: 'directional', position: [-60, 40, 80], target: [0, 0, 0], color: '#b0c4de', intensity: 0.7 },
491
- ],
492
- ground: { visible: true, color: '#111118', height: -10, receiveShadow: true },
493
- postProcessing: {
494
- bloom: { intensity: 0.3, threshold: 0.85, radius: 0.3 },
495
- vignette: { darkness: 0.5, offset: 0.4 },
496
- toneMappingExposure: 1.3,
497
- },
498
- });
499
- ```
500
-
501
- ### Named render views
502
-
503
- For models that need repeatable review, docs, or hero renders, declare named views inside
504
- `scene({ views })`. The canonical form wraps each camera in `{ camera: ... }`; direct camera
505
- shorthand is accepted by the runtime, but the wrapped form is the clearest prompt/example shape.
506
-
507
- ```js
508
- scene({
509
- camera: { position: [430, -540, 340], target: [0, 30, 125], fov: 38 },
510
- views: {
511
- hero: {
512
- camera: { position: [430, -540, 340], target: [0, 30, 125], up: [0, 0, 1], fov: 38 },
513
- },
514
- side: {
515
- camera: { position: [700, 0, 180], target: [0, 30, 100], up: [0, 0, 1], fov: 32 },
516
- },
517
- },
518
- });
519
- ```
520
-
521
- Render one later with:
522
-
523
- ```bash
524
- forgecad render 3d model.forge.js --view hero
525
- ```
526
-
527
- ### Lighting principles
528
-
529
- - When `lights` is set, all defaults are replaced, so always include an ambient light or the scene goes black.
530
- - Use a 3-point setup at minimum: ambient fill + warm key light (with `castShadow: true`) + cool rim/back light for edge separation.
531
- - Add accent point lights near focal features (e.g. a gold crown, a polished surface) for highlights.
532
- - Use `distance` and `decay` on point lights to keep them localized.
533
-
534
- ### Adapt to the model
535
-
536
- - Metallic/jewelry models: `studio` environment, higher `toneMappingExposure` (1.2–1.5), subtle bloom for specular highlights.
537
- - Organic/wood/matte models: `warehouse` or `apartment` environment, lower bloom, warmer ambient.
538
- - Mechanical/industrial models: `warehouse` environment, stronger directional lights, minimal bloom.
539
- - Dark/dramatic models: dark gradient background, `night` environment, bloom + vignette for mood.
540
-
541
- ### Matte industrial hero-shot recipe
542
-
543
- For mechanisms, tools, product prototypes, vehicles, and other industrial showpieces, prefer a matte studio look over glossy or atmospheric drama:
544
-
545
- ```js
546
- scene({
547
- background: { top: '#c3ccd7', bottom: '#566474' },
548
- camera: { position: [430, -540, 340], target: [0, 30, 125], fov: 38 },
549
- environment: { preset: 'studio', intensity: 0.15 - 0.25, background: false },
550
- lights: [
551
- { type: 'ambient', color: '#efe7dc', intensity: 0.12 - 0.2 },
552
- { type: 'directional', position: [260, -320, 420], color: '#ffe2bf', intensity: 2.6 - 3.2, castShadow: true },
553
- { type: 'directional', position: [-260, 210, 220], color: '#d4e6fb', intensity: 0.7 - 1.0 },
554
- { type: 'hemisphere', skyColor: '#c7d3df', groundColor: '#495463', intensity: 0.1 - 0.2 },
555
- ],
556
- postProcessing: {
557
- bloom: { intensity: 0.0 - 0.06, threshold: 0.92 - 0.96, radius: 0.25 - 0.3 },
558
- vignette: { darkness: 0.35 - 0.45, offset: 0.3 - 0.35 },
559
- toneMappingExposure: 1.05 - 1.18,
560
- },
561
- });
562
- ```
563
-
564
- Use a simple plinth or stage under the model, and make it intentionally matte too:
565
-
566
- ```js
567
- const stage = cylinder(16, 226)
568
- .translate(0, 0, -26)
569
- .color('#8b97a4')
570
- .material({ metalness: 0.04, roughness: 0.78 });
571
-
572
- mock(stage, 'StudioPlinth');
573
- ```
574
-
575
- What worked well in practice:
576
-
577
- - Keep `environment.intensity` low. High environment fill kills shadows and makes everything look washed out.
578
- - Let one warm directional key light do most of the shaping. Add only a weaker cool fill/rim for separation.
579
- - Prefer roughness over fog for softness. Fog flattens the model and hides form; matte materials preserve shadow definition.
580
- - Keep bloom extremely low for mechanical scenes. A little is fine; too much makes manufactured parts feel toy-like or overly glossy.
581
- - If the render is close but not perfect, change `toneMappingExposure` by about `0.05` first before redoing the whole lighting rig.
582
- - Avoid large ambient-light jumps. They brighten fast and remove contrast faster than expected.
583
-
584
- ### Ground plane
585
-
586
- Enable `ground` with `receiveShadow: true` for models that benefit from visual grounding (furniture, vehicles, standalone objects). Skip it for floating/abstract geometry.
587
-
588
- ### Camera
589
-
590
- - Position the camera at a 3/4 angle (not dead-on axis) for natural perspective.
591
- - Use `fov` 35–50 for most models. Lower FOV = more telephoto/flatter, higher = more dramatic perspective.
592
- - Set `target` to the visual center of mass, not necessarily `[0,0,0]`.
593
-
594
- ## Tips
172
+ Always set up `scene()` default lighting looks flat. Worked recipes (studio and matte-industrial setups, named views, plinth) live in `guides/scene-presentation.md` via the `forgecad` skill; the schema is in the viewport docs. Hard-won cliffs:
595
173
 
596
- - Make models parametric by defaultdimensions should be `param()` calls, not magic numbers
597
- - Do not assume primitives are XYZ-centered: `box()` and `cylinder()` are XY-centered but sit on `z=0`
598
- - Use `.placeReference('center', [0, 0, 0])` for full-origin-centered boxes or cylinders
599
- - Prefer `group()`, connectors, and `placeReference()` over manual half-height arithmetic
600
- - Prefer `difference()` for holes/cutouts, `union()` for additive features
601
- - Use `.color()` to distinguish parts visually
174
+ - Setting `lights` replaces ALL defaultsalways include an ambient light or the scene goes black.
175
+ - Minimum rig: ambient fill + one warm key (`castShadow: true`) + weaker cool fill/rim. Keep `environment.intensity` low environment fill kills shadows.
176
+ - Prefer roughness over fog for softness; keep bloom near zero for mechanical parts or they read toy-like.
177
+ - If a render is close, nudge `toneMappingExposure` by ~0.05 before redoing the rig; avoid big ambient jumps.
178
+ - Camera: 3/4 angle, `fov` 35–50, `target` at the visual center of mass. Ground plane with shadows for grounded objects.
179
+ - Environment by type: `studio` for metallic/jewelry, `warehouse`/`apartment` for organic/matte, `warehouse` + strong directionals for mechanical, `night` + bloom/vignette for dramatic.