forgecad 0.10.3 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdminPage-CK7ObBz3.js → AdminPage-raksfnNA.js} +1 -1
- package/dist/assets/{BenchmarkPage-Ds7Z2doN.js → BenchmarkPage-DP3RxhPs.js} +2 -2
- package/dist/assets/{BlogPage-DlPbpt6A.js → BlogPage-D7Dos-vl.js} +1 -1
- package/dist/assets/{DocsPage-vZb3b3Y0.js → DocsPage-DO1kvBns.js} +34 -43
- package/dist/assets/{EditorApp-HLoKfe15.js → EditorApp-DQJmcmRT.js} +51 -17
- package/dist/assets/{EmbedViewer--KnqBKrJ.js → EmbedViewer-DFDUhOma.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-C_LssmnA.js → LandingPageProofDriven-DbE_tp8-.js} +54 -36
- package/dist/assets/{LegalPage-DGsyo4n1.js → LegalPage-CominSso.js} +2 -2
- package/dist/assets/{PricingPage-BOE27B-R.js → PricingPage-CcVIN9yj.js} +2 -2
- package/dist/assets/{SettingsPage-f47cnk39.js → SettingsPage-DLWcP289.js} +1 -1
- package/dist/assets/{app-D6ccu2Xx.js → app-xW3hOdq9.js} +1343 -4004
- package/dist/assets/{backendInit-DbTkQN9J.js → backendInit-mDHk97u7.js} +12346 -3803
- package/dist/assets/cli/{render-BsngirjC.js → render--SIU27W_.js} +1909 -146
- package/dist/assets/{constructionHistoryWorker-PCwXrTDB.js → constructionHistoryWorker-uEe_Q7Kg.js} +2362 -835
- package/dist/assets/{evalWorker-CS63PfZu.js → evalWorker-BqyDHDcI.js} +7755 -3127
- package/dist/assets/{forgecad_geometry-CZ_IfuvA.js → forgecad_geometry-D8rWX7nQ.js} +1 -1
- package/dist/assets/{forgecad_geometry_bg-C3rQHfwg.wasm → forgecad_geometry_bg-ObqfqjJT.wasm} +0 -0
- package/dist/assets/{inspectWorker-Y4cOzNyA.js → inspectWorker-UXMxlcR8.js} +6550 -2943
- package/dist/assets/{jointPose-AMvCywzS.js → jointPose-bYMlwU3v.js} +1 -1
- package/dist/assets/{landing-proof-driven-ORyigZ6p.css → landing-proof-driven-_u4v_xQb.css} +71 -11
- package/dist/assets/{manifold-Crd_F2qx.js → manifold-BR7UYI4P.js} +1 -1
- package/dist/assets/{manifold-CBry38ly.js → manifold-CyOV5B9S.js} +2 -2
- package/dist/assets/{manifold-k2kRcc85.js → manifold-D4d5NQst.js} +1 -1
- package/dist/assets/{reportWorker-CWvn0CEv.js → reportWorker-DsaICZsn.js} +7320 -2827
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/usage.md +17 -15
- package/dist/docs-raw/CLI.md +4 -2
- package/dist/docs-raw/component-model.md +2 -2
- package/dist/docs-raw/generated/assembly.md +76 -3
- package/dist/docs-raw/generated/concepts.md +36 -5
- package/dist/docs-raw/generated/core.md +185 -21
- package/dist/docs-raw/generated/curves.md +344 -6
- package/dist/docs-raw/generated/runtime-names.md +12 -12
- package/dist/docs-raw/generated/sketch.md +16 -3
- package/dist/docs-raw/guides/inspection-bundles.md +5 -3
- package/dist/docs-raw/guides/structural-fea.md +224 -0
- package/dist/docs-raw/simulation-workflow.md +1 -1
- package/dist/docs-raw/skills/{forgecad-make-a-model.md → forgecad-build-model.md} +18 -8
- package/dist/docs-raw/skills/{forgecad-spec-by-walking-through-it.md → forgecad-design-spec.md} +6 -6
- package/dist/docs-raw/skills/{forgecad-model-grader.md → forgecad-grade-model.md} +8 -6
- package/{dist-skill/website/skills/forgecad-visual-spec.md → dist/docs-raw/skills/forgecad-image-prompt.md} +7 -7
- package/dist/docs-raw/skills/{forgecad-render-inspect.md → forgecad-inspect-model.md} +6 -6
- package/{dist-skill/website/skills/forgecad-project.md → dist/docs-raw/skills/forgecad-project-sync.md} +5 -5
- package/dist/docs-raw/skills/{forgecad-3d-reconstruction.md → forgecad-reconstruct-cad-file.md} +7 -7
- package/dist/docs-raw/skills/{forgecad-image-replicator.md → forgecad-reconstruct-from-images.md} +12 -12
- package/dist/docs-raw/skills/{forgecad-mujoco-verify.md → forgecad-verify-mujoco.md} +6 -6
- package/dist/docs-raw/skills/forgecad.md +1 -0
- package/dist/docs-raw/skills/index.md +9 -12
- package/dist/index.html +9 -9
- package/dist/llms.txt +7 -7
- package/dist/sitemap.xml +16 -16
- package/dist-cli/{check-compiler-HPF2T2FS.js → check-compiler-7YAHVXYM.js} +1 -1
- package/dist-cli/{check-query-propagation-HYSLTXAB.js → check-query-propagation-ZRR6IOJW.js} +1 -1
- package/dist-cli/{chunk-WLUKAW3H.js → chunk-VNM67DIV.js} +29671 -24865
- package/dist-cli/forgecad.js +5906 -714
- package/dist-cli/forgecad_geometry_bg.wasm +0 -0
- package/dist-skill/CONTEXT.md +853 -45
- package/dist-skill/SKILL.md +1 -0
- package/dist-skill/docs/CLI.md +4 -2
- package/dist-skill/docs/generated/assembly.md +73 -3
- package/dist-skill/docs/generated/core.md +185 -21
- package/dist-skill/docs/generated/curves.md +343 -6
- package/dist-skill/docs/generated/runtime-names.md +12 -12
- package/dist-skill/docs/generated/sketch.md +16 -3
- package/dist-skill/docs/guides/inspection-bundles.md +5 -3
- package/dist-skill/docs/guides/structural-fea.md +224 -0
- package/dist-skill/library/README.md +9 -12
- package/dist-skill/library/{forgecad-make-a-model → forgecad-build-model}/SKILL.md +16 -6
- package/dist-skill/library/{forgecad-spec-by-walking-through-it → forgecad-design-spec}/SKILL.md +4 -4
- package/dist-skill/library/{forgecad-spec-by-walking-through-it → forgecad-design-spec}/references/master-prompt.md +1 -1
- package/dist-skill/library/{forgecad-model-grader → forgecad-grade-model}/SKILL.md +6 -4
- package/dist-skill/library/forgecad-grade-model/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-visual-spec → forgecad-image-prompt}/SKILL.md +5 -5
- package/dist-skill/library/forgecad-image-prompt/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-render-inspect → forgecad-inspect-model}/SKILL.md +4 -4
- package/dist-skill/library/{forgecad-project → forgecad-project-sync}/SKILL.md +3 -3
- package/dist-skill/library/{forgecad-3d-reconstruction → forgecad-reconstruct-cad-file}/SKILL.md +5 -5
- package/dist-skill/library/forgecad-reconstruct-cad-file/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-image-replicator → forgecad-reconstruct-from-images}/SKILL.md +10 -10
- package/dist-skill/library/forgecad-reconstruct-from-images/agents/openai.yaml +4 -0
- package/dist-skill/library/{forgecad-mujoco-verify → forgecad-verify-mujoco}/SKILL.md +4 -4
- package/dist-skill/website/skills/{forgecad-make-a-model.md → forgecad-build-model.md} +18 -8
- package/dist-skill/website/skills/{forgecad-spec-by-walking-through-it.md → forgecad-design-spec.md} +6 -6
- package/dist-skill/website/skills/{forgecad-model-grader.md → forgecad-grade-model.md} +8 -6
- package/{dist/docs-raw/skills/forgecad-visual-spec.md → dist-skill/website/skills/forgecad-image-prompt.md} +7 -7
- package/dist-skill/website/skills/{forgecad-render-inspect.md → forgecad-inspect-model.md} +6 -6
- package/{dist/docs-raw/skills/forgecad-project.md → dist-skill/website/skills/forgecad-project-sync.md} +5 -5
- package/dist-skill/website/skills/{forgecad-3d-reconstruction.md → forgecad-reconstruct-cad-file.md} +7 -7
- package/dist-skill/website/skills/{forgecad-image-replicator.md → forgecad-reconstruct-from-images.md} +12 -12
- package/dist-skill/website/skills/{forgecad-mujoco-verify.md → forgecad-verify-mujoco.md} +6 -6
- package/dist-skill/website/skills/forgecad.md +1 -0
- package/dist-skill/website/skills/index.md +9 -12
- package/examples/analysis/structural-stress-fea.forge.js +19 -0
- package/examples/api/blend-full-round.forge.js +37 -0
- package/examples/api/blend-variable-radius.forge.js +51 -0
- package/examples/api/curve-project-and-intersect.forge.js +59 -0
- package/examples/api/extrude-up-to-face.forge.js +47 -0
- package/examples/api/spoon-full-tang-handle.forge.js +148 -0
- package/examples/api/surface-boundarynet-dished-bowl.forge.js +63 -0
- package/examples/api/surface-fill-interior-constraints.forge.js +59 -0
- package/examples/api/texture-projection.forge.js +75 -0
- package/examples/assets/uv-grid.png +0 -0
- package/package.json +4 -1
- package/dist/docs-raw/skills/forgecad-blockout-model.md +0 -49
- package/dist/docs-raw/skills/forgecad-component-model.md +0 -53
- package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +0 -60
- package/dist-skill/library/forgecad-3d-reconstruction/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +0 -42
- package/dist-skill/library/forgecad-component-model/SKILL.md +0 -46
- package/dist-skill/library/forgecad-image-replicator/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-model-grader/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +0 -48
- package/dist-skill/library/forgecad-reconstruction-benchmark/agents/openai.yaml +0 -4
- package/dist-skill/library/forgecad-visual-spec/agents/openai.yaml +0 -4
- package/dist-skill/website/skills/forgecad-blockout-model.md +0 -49
- package/dist-skill/website/skills/forgecad-component-model.md +0 -53
- package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +0 -60
- /package/dist/assets/{landing-proof-driven-DiGqdtWa.js → landing-proof-driven-DNPRKL_p.js} +0 -0
- /package/dist-skill/library/{forgecad-spec-by-walking-through-it → forgecad-design-spec}/references/default-profiles.md +0 -0
- /package/dist-skill/library/{forgecad-render-inspect → forgecad-inspect-model}/summarize_manifest.py +0 -0
- /package/dist-skill/library/{forgecad-image-replicator → forgecad-reconstruct-from-images}/scripts/compare_images.py +0 -0
- /package/dist-skill/library/{forgecad-mujoco-verify → forgecad-verify-mujoco}/scripts/mujoco_verify.py +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-build-model/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-build-model
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Build or edit a manufacture-realistic `.forge.js` model in a project, then validate it with run, render, inspect, and export evidence.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-build-model/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Build Model
|
|
15
15
|
|
|
16
16
|
Create new ForgeCAD models in the user's active ForgeCAD project.
|
|
17
17
|
|
|
@@ -86,7 +86,17 @@ For any mechanism (linkage, hinge, slider, suspension, gripper, drawer), the rig
|
|
|
86
86
|
|
|
87
87
|
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.
|
|
88
88
|
|
|
89
|
-
-
|
|
89
|
+
For multi-part assemblies, the component model is mandatory:
|
|
90
|
+
|
|
91
|
+
- Parts build at origin in their own local coordinates. They do not know final assembly-space offsets, sibling dimensions, or world placement.
|
|
92
|
+
- A part's public interface is `shape` plus connectors and metadata, e.g. `return { shape, boltPattern, pinionZ }`. Declare mating faces with `.withConnectors({})`; axes point outward, with prismatic slide axes as the explicit exception.
|
|
93
|
+
- The parent assembly chooses the root and positions every structural part through connectors, `connect()`, `match()`, or `matchTo()`. Final `translate()` calls are not assembly contracts.
|
|
94
|
+
- Data flows down through `require('./part.forge.js', params)` overrides and up through returned metadata. Siblings never import each other; the parent routes shared decisions and measured outputs.
|
|
95
|
+
- Default to one file for a project-specific assembly. Split only for cross-project reuse, independent subassemblies, or when a file grows past roughly 300 lines. Never create `shared-dims.js` just to coordinate siblings.
|
|
96
|
+
|
|
97
|
+
Reject these shortcuts on sight: sibling `require()`, assembly-space coordinates inside a part, `translate()` used to position a structural assembly member, `console.log` + `if` validation instead of `verify.*`, and bare `connector.neutral()` outside a reusable component library with compatibility checks.
|
|
98
|
+
|
|
99
|
+
- Bespoke fixed assemblies: build each part in local coordinates, pick one root, place every touching part with `matchTo()`, verify each mate with `verify.connectorDistance`.
|
|
90
100
|
- 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.
|
|
91
101
|
- 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.
|
|
92
102
|
- 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.
|
|
@@ -101,7 +111,7 @@ Treat `fillet()`/`chamfer()` as experimental (Manifold can be incorrect, OCCT sl
|
|
|
101
111
|
|
|
102
112
|
### Imported Parts (User-Supplied 3D Files)
|
|
103
113
|
|
|
104
|
-
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-
|
|
114
|
+
When the user supplies mesh or CAD files to design around (a motor, an off-the-shelf housing, a scanned part), the import IS a component of the assembly — keep it, don't rebuild it parametrically (rebuilding is `forgecad-reconstruct-cad-file`, a different request).
|
|
105
115
|
|
|
106
116
|
- 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()`.
|
|
107
117
|
- 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.
|
|
@@ -153,7 +163,7 @@ A manufacture-realistic model must yield a package a shop can consume, not just
|
|
|
153
163
|
|
|
154
164
|
### Render and Inspect Cadence
|
|
155
165
|
|
|
156
|
-
**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-
|
|
166
|
+
**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-inspect-model` skill and the CLI docs — this skill fixes only the cadence and the gates.
|
|
157
167
|
|
|
158
168
|
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.
|
|
159
169
|
|
package/dist-skill/website/skills/{forgecad-spec-by-walking-through-it.md → forgecad-design-spec.md}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-spec
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-design-spec/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-spec
|
|
3
|
+
# forgecad-design-spec
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Create a ForgeCAD design brief, HLD, or LLD before coding by walking through use, assembly, interfaces, decisions, and verification.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-spec
|
|
10
|
+
| Source | `agent-skill-library/forgecad-design-spec/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## Spec
|
|
14
|
+
## Design Spec
|
|
15
15
|
|
|
16
16
|
The design document — a git-committed, diff-reviewed markdown file — is the source of truth. Not the code, not the chat, not your head. You iterate it by commit-and-review, and the `git diff` is the review artifact.
|
|
17
17
|
|
|
@@ -136,7 +136,7 @@ HLDs and LLDs iterate through git, not conversation:
|
|
|
136
136
|
|-------|--------------------|--------|------|
|
|
137
137
|
| Explore a fuzzy ask | Intake | engineering brief + master prompt | HLD |
|
|
138
138
|
| Decide *what* to build | HLD | `*-hld.md` (Decisions filled) | LLD |
|
|
139
|
-
| Detail *how* to build | LLD | `*-lld.md` | `forgecad-
|
|
139
|
+
| Detail *how* to build | LLD | `*-lld.md` | `forgecad-build-model` + `forgecad` → `.forge.js` |
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
## Bundled Files
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-model
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-grade-model/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-model
|
|
3
|
+
# forgecad-grade-model
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Grade a ForgeCAD or CAD-as-code model against a requirement, brief, prompt, reference, or acceptance criteria with evidence and a 0-10 score.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-model
|
|
10
|
+
| Source | `agent-skill-library/forgecad-grade-model/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Grade Model
|
|
15
15
|
|
|
16
16
|
Grade the delivered model against the requirement, not against what could be fixed later. Never edit the model unless the user explicitly requests repairs — then record the baseline grade first, change, and re-grade.
|
|
17
17
|
|
|
@@ -21,7 +21,7 @@ Grade the delivered model against the requirement, not against what could be fix
|
|
|
21
21
|
2. **Run the model**: `forgecad run <model>.forge.js` (in the ForgeCAD repo use the local build, `node dist-cli/forgecad.js run ...`). If it fails to execute, stop and apply the caps.
|
|
22
22
|
3. **Render** at least `iso`, `front`, `right`, `top` to a scratch dir; add views (back, bottom, close-up, section) when the model is asymmetric, hollow, mechanical, or likely to hide mistakes.
|
|
23
23
|
4. **Open and look at every PNG** — never score from command output alone. Check silhouette, proportions, required features, part boundaries, interfaces, and whether the model reads as the requested artifact from more than one angle.
|
|
24
|
-
5. **Inspect** whenever hidden internals, fit, wall thickness, or assembly behavior are central to the brief — grading without inspecting them caps the score. Delegate evidence choice, commands, and manifest reading to the `forgecad-
|
|
24
|
+
5. **Inspect** whenever hidden internals, fit, wall thickness, or assembly behavior are central to the brief — grading without inspecting them caps the score. Delegate evidence choice, commands, and manifest reading to the `forgecad-inspect-model` skill. Findings (unexpected collisions, thin regions, floating bodies, wrong component counts) are evidence, not warnings to wave away.
|
|
25
25
|
6. **Score**: fill the rubric, apply caps, give a final 0-10 in whole or `.5` increments. Unknowns count against the score.
|
|
26
26
|
|
|
27
27
|
### Rubric
|
|
@@ -47,6 +47,7 @@ Maximum scores, applied after the rubric:
|
|
|
47
47
|
- A must-have requirement is absent: max `6`.
|
|
48
48
|
- Visually recognizable but physically impossible for the requested use: max `6`.
|
|
49
49
|
- Internals, fit, walls, or assembly central to the brief but uninspected: max `7`.
|
|
50
|
+
- Multi-part assembly violates the ForgeCAD component model — sibling imports, assembly-space coordinates inside parts, structural `translate()` placement, missing connector mates, or parent/child data flow confusion: max `7`; max `6` when the violation makes the assembly brittle or mechanically wrong.
|
|
50
51
|
- Inspection finds unexpected collisions, floating bodies, critical thin walls, or wrong connectivity: max `6`; max `5` when the defect invalidates the main function.
|
|
51
52
|
- Delivered as a finished product/prototype but presented with default flat lighting (no `scene()` rig), a generically colorful or material-false palette, or teaching-diagram styling: max `8`. Does not apply when the brief asks for a blockout or bare technical study.
|
|
52
53
|
- Any score relying on an assumption the evidence cannot verify: mark it `Unknown`, never score above `8`.
|
|
@@ -73,6 +74,7 @@ Next fixes: the 2-5 highest-leverage improvements.
|
|
|
73
74
|
- Grade the default returned model unless the user names a parameter set or variant.
|
|
74
75
|
- No points for comments, labels, or intentions absent from the geometry.
|
|
75
76
|
- Decorative screws, floating labels, and teaching-diagram callouts are not real mechanical interfaces.
|
|
77
|
+
- For multi-part assemblies, require the component model: parts build locally at origin, expose connectors/metadata, the parent positions them, and inter-part data flows through parent props and returned metadata.
|
|
76
78
|
- Cite which render or inspection finding drove the grade.
|
|
77
79
|
- When comparing models, use identical checklist, cameras, inspection evidence, and caps for all.
|
|
78
80
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-image-prompt/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-image-prompt
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Write builder-honest AI image prompts from a concrete ForgeCAD model, build brief, HLD, or LLD without hiding how the artifact is built.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-image-prompt/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Image Prompt
|
|
15
15
|
|
|
16
16
|
### Scope
|
|
17
17
|
|
|
18
|
-
Only for artifacts already concrete enough to visualize (a specific `.forge.js` model, build brief, or HLD); route vague briefs to `forgecad-spec
|
|
18
|
+
Only for artifacts already concrete enough to visualize (a specific `.forge.js` model, build brief, or HLD); route vague briefs to `forgecad-design-spec` first. Read minimum context — entry `.forge.js`, one key helper if it delegates geometry, brief/HLD — and capture what must survive the image model: artifact type and scale, major subassemblies, actuation style, visible mechanisms, material and color cues.
|
|
19
19
|
|
|
20
20
|
### Core Rule
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Image prompts, not concept art: show the final artifact clearly, preserve build and subsystem truth, and keep visible the seams, modules, hardware, and mechanical hierarchy that matter.
|
|
23
23
|
|
|
24
24
|
Negatives (the only negatives list — reuse it, never restate variants):
|
|
25
25
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-inspect-model/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-inspect-model
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Select, run, and interpret ForgeCAD inspection evidence for collisions, sections, wall thickness, components, masks, depth, normals, surface continuity, and fit.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-inspect-model/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Inspect Model
|
|
15
15
|
|
|
16
16
|
Use `forgecad inspect ...` when a shaded render is too ambiguous and you need structured evidence: a bundle directory with evidence PNGs plus a root `manifest.json` (or, for `inspect section`, a probe directory with `result.json`, `section.svg`, `section.png`). Inspection is not a substitute artifact: look inside with sections, masks, `--focus`/`--hide`, and transparency — never edit the model into a cutaway or exploded default to make inspecting easier. Output dirs: let `inspect` allocate its timestamped directory by default (repeated probes never collide); use `/tmp/<model>-inspect` for throwaway bundles, a project directory only for persistent artifacts.
|
|
17
17
|
|
|
18
|
-
Routing: authoring/API questions → `forgecad` skill; creating a new model → `forgecad-
|
|
18
|
+
Routing: authoring/API questions → `forgecad` skill; creating a new model → `forgecad-build-model`.
|
|
19
19
|
|
|
20
20
|
### Workflow
|
|
21
21
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-project/SKILL.md instead. -->
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-project-sync/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-project
|
|
3
|
+
# forgecad-project-sync
|
|
4
4
|
|
|
5
|
-
ForgeCAD project
|
|
5
|
+
Manage hosted ForgeCAD project sync from the CLI: init, clone, pull, push, file operations, members, publishing, and shares.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-project/SKILL.md` |
|
|
10
|
+
| Source | `agent-skill-library/forgecad-project-sync/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Project Sync
|
|
15
15
|
|
|
16
16
|
forgecad.io is the hosted ForgeCAD platform; a project is a local folder linked to the server by `forgecad.json`. The full command inventory (project, file, member, share, token commands and flags) lives in `forgecad project --help` and the forgecad skill's `docs/CLI.md` — do not relearn it here.
|
|
17
17
|
|
package/dist-skill/website/skills/{forgecad-3d-reconstruction.md → forgecad-reconstruct-cad-file.md}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-reconstruct-cad-file/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-reconstruct-cad-file
|
|
4
4
|
|
|
5
|
-
Reconstruct a parametric ForgeCAD model from an existing
|
|
5
|
+
Reconstruct a readable parametric ForgeCAD model from an existing CAD or mesh file such as STL, OBJ, 3MF, STEP, or STP.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-reconstruct-cad-file/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Reconstruct CAD File
|
|
15
15
|
|
|
16
16
|
The reference asset is evidence, not the deliverable. The deliverable is a readable, parametric `.forge.js` model that runs, renders, and scores well against the source. Never return `Import.mesh()`/`Import.step()` of the source as the final model unless the user explicitly asks for an import wrapper — imports are for measurement, rendering, and scoring only.
|
|
17
17
|
|
|
18
|
-
Routing: user wants to KEEP the file as a live component and design around it (bracket, enclosure, mating assembly) → `forgecad-
|
|
18
|
+
Routing: user wants to KEEP the file as a live component and design around it (bracket, enclosure, mating assembly) → `forgecad-build-model` (Imported Parts section), not this skill; prepared benchmark/RL episodes → use the task-local benchmark instructions, not the public skill library; inspection-bundle interpretation → `forgecad-inspect-model`; independent grading after reconstruction → `forgecad-grade-model`; API and command reference → `forgecad` skill + CLI.md.
|
|
19
19
|
|
|
20
20
|
### Workflow
|
|
21
21
|
|
|
@@ -50,7 +50,7 @@ Faceted sources: decide whether tessellation itself is evidence. Matching low-po
|
|
|
50
50
|
|
|
51
51
|
### Done Criteria
|
|
52
52
|
|
|
53
|
-
The final model must run, render, re-compare at `--samples 5000`, and pass an `inspect compare overlay`. Add targeted inspects (`forgecad-
|
|
53
|
+
The final model must run, render, re-compare at `--samples 5000`, and pass an `inspect compare overlay`. Add targeted inspects (`forgecad-inspect-model`) when the object is multi-part, hollow, thin-walled, or surface-sensitive. Report: source and candidate paths, score JSON path, final metrics, and every known mismatch classified as intentional simplification or remaining work.
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
## Bundled Files
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-reconstruct-from-images/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-
|
|
3
|
+
# forgecad-reconstruct-from-images
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Reconstruct a real parametric ForgeCAD object from reference images by using images as evidence, not as a one-view facade.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-
|
|
10
|
+
| Source | `agent-skill-library/forgecad-reconstruct-from-images/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Reconstruct From Images
|
|
15
15
|
|
|
16
16
|
The reference image is evidence, not the deliverable. The deliverable is a real parametric object that holds up from front, back, side, top, bottom, and reference camera views — a model that matches one image but falls apart from other angles has failed, even if the comparison board looks close. Cutaway, sectioned, exploded, or transparent references are evidence about the complete object: build the closed artifact and recreate explanatory views with viewer/inspection tools (the main `forgecad` skill's closed-artifact rule applies).
|
|
17
17
|
|
|
18
18
|
### Companion Skills
|
|
19
19
|
|
|
20
20
|
- `forgecad` — API docs, model authoring, renderer behavior.
|
|
21
|
-
- `forgecad-spec
|
|
22
|
-
- `forgecad-
|
|
23
|
-
- `forgecad-
|
|
21
|
+
- `forgecad-design-spec` — when the images underdetermine artifact family, process posture, scale, operating story, or validation boundary.
|
|
22
|
+
- `forgecad-build-model` — file placement, project structure, decomposition, definition of done.
|
|
23
|
+
- `forgecad-inspect-model` — pre-delivery inspection for multi-part, internal, mechanical, thin-wall, or fit-sensitive objects.
|
|
24
24
|
|
|
25
25
|
### Core Rule
|
|
26
26
|
|
|
@@ -30,19 +30,19 @@ Infer the real object before matching any camera — identity, manufacture, scal
|
|
|
30
30
|
|
|
31
31
|
1. Stage references in `/tmp/<slug>-replicate/refs`, keeping originals and adding view names where possible (`front`, `side`, `rear-iso`, `top`, `detail`).
|
|
32
32
|
2. Read each image as evidence, recording: visible facts; scale cues; camera cues; unknowns (hidden/occluded geometry); conflicts across images or stylization.
|
|
33
|
-
3. Write a Real Object Brief — a hard gate before modeling: (a) artifact identity + operating story; (b) assumed scale and units; (c) process posture + part/BOM boundary (real geometry vs purchased vs ghost vs omitted); (d) inferred hidden-side geometry + expected canonical front/back/left/right/top/bottom forms; (e) validation views and inspection evidence. Use `forgecad-spec
|
|
34
|
-
4. Build a coarse 3D blockout — model the object, not the image: large volumes, axes, symmetry, side depth, rear form, underside, hidden continuations. Render canonical views before any reference-camera comparison. Follow `forgecad-
|
|
33
|
+
3. Write a Real Object Brief — a hard gate before modeling: (a) artifact identity + operating story; (b) assumed scale and units; (c) process posture + part/BOM boundary (real geometry vs purchased vs ghost vs omitted); (d) inferred hidden-side geometry + expected canonical front/back/left/right/top/bottom forms; (e) validation views and inspection evidence. Use `forgecad-design-spec` when these are underdetermined.
|
|
34
|
+
4. Build a coarse 3D blockout — model the object, not the image: large volumes, axes, symmetry, side depth, rear form, underside, hidden continuations. Render canonical views before any reference-camera comparison. Follow `forgecad-build-model` for project structure.
|
|
35
35
|
5. Calibrate one camera per usable reference, only after the blockout makes sense from canonical views. Use the object center as `target`; estimate azimuth/elevation/distance/FOV from visible faces and perspective cues; use orthographic when parallel edges stay parallel with no perspective convergence.
|
|
36
36
|
6. Render comparison boards: render the model from each calibrated reference camera and place it next to the original. Never compare from memory.
|
|
37
37
|
7. Iterate one class of change at a time, in order: object hypothesis → major proportions → canonical geometry → camera → details → presentation. If improving one reference view makes another view or a canonical render worse, the object hypothesis is wrong — fix the model, not the camera illusion.
|
|
38
38
|
8. Use every image as a constraint. Never pick one target image and ignore the rest: assign each image a camera, evidence list, and confidence; optimize one shared geometry against the whole set; state how distorted or decorative images were weighted.
|
|
39
|
-
9. Validate the final object: `forgecad run`, reference comparison boards, canonical renders, and targeted inspections via `forgecad-
|
|
39
|
+
9. Validate the final object: `forgecad run`, reference comparison boards, canonical renders, and targeted inspections via `forgecad-inspect-model`.
|
|
40
40
|
|
|
41
41
|
### Comparison Boards
|
|
42
42
|
|
|
43
43
|
Render with exact `--camera` specs (see the forgecad CLI doc for supported forms). If exact full camera specs do not render, fix the renderer before continuing — never substitute guesses from default `iso` renders.
|
|
44
44
|
|
|
45
|
-
Build side-by-side boards with the bundled self-contained `uv` helper (installs Pillow on demand). Resolve `scripts/compare_images.py` relative to the installed `forgecad-
|
|
45
|
+
Build side-by-side boards with the bundled self-contained `uv` helper (installs Pillow on demand). Resolve `scripts/compare_images.py` relative to the installed `forgecad-reconstruct-from-images` skill directory:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
uv run <skill-dir>/scripts/compare_images.py refs/front.png render-front.png compare-front.png
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-mujoco
|
|
1
|
+
<!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-verify-mujoco/SKILL.md instead. -->
|
|
2
2
|
|
|
3
|
-
# forgecad-mujoco
|
|
3
|
+
# forgecad-verify-mujoco
|
|
4
4
|
|
|
5
|
-
Verify ForgeCAD MJCF
|
|
5
|
+
Verify a ForgeCAD MJCF export in MuJoCo with dynamics, contacts, controls, joint travel, and rendered evidence before calling it simulation-ready.
|
|
6
6
|
|
|
7
7
|
| Field | Value |
|
|
8
8
|
| --- | --- |
|
|
9
9
|
| Installed by | `forgecad skill install` |
|
|
10
|
-
| Source | `agent-skill-library/forgecad-mujoco
|
|
10
|
+
| Source | `agent-skill-library/forgecad-verify-mujoco/SKILL.md` |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Verify MuJoCo
|
|
15
15
|
|
|
16
16
|
Use this when `forgecad export mjcf ...` is part of the deliverable. A model is not sim-ready just because `forgecad check simready` passes or the MJCF file loads: it must be loaded in MuJoCo, stepped under gravity, driven with the intended controls, contact pairs inspected, and rendered from useful views.
|
|
17
17
|
|
|
18
|
-
Routing: geometry-only visual inspection -> `forgecad-
|
|
18
|
+
Routing: geometry-only visual inspection -> `forgecad-inspect-model`; model authoring/API questions -> `forgecad`; building a new model -> `forgecad-build-model`.
|
|
19
19
|
|
|
20
20
|
### Definition Of Done
|
|
21
21
|
|
|
@@ -11,15 +11,12 @@ forgecad skill install
|
|
|
11
11
|
| Skill | Installed by | Purpose |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| [forgecad](/docs/skills/forgecad) | `forgecad skill install` | ForgeCAD model authoring, editing, debugging, and execution guidance for .forge.js, SVG-import, assembly, and CLI workflows. Use when building or modifying ForgeCAD geometry, structuring multi-file projects, validating scripts, or using ForgeCAD export/render tooling. |
|
|
14
|
-
| [forgecad-
|
|
15
|
-
| [forgecad-
|
|
16
|
-
| [forgecad-
|
|
17
|
-
| [forgecad-image-
|
|
18
|
-
| [forgecad-
|
|
19
|
-
| [forgecad-
|
|
20
|
-
| [forgecad-
|
|
21
|
-
| [forgecad-
|
|
22
|
-
| [forgecad-
|
|
23
|
-
| [forgecad-render-inspect](/docs/skills/forgecad-render-inspect) | `forgecad skill install` | Run and interpret ForgeCAD inspection bundles for model verification. Use when asked to inspect a ForgeCAD model, analyze an inspection bundle, validate collisions, wall thickness, connectivity, floating bodies, sections, masks, depth, normals, or Zebra stripes. |
|
|
24
|
-
| [forgecad-spec-by-walking-through-it](/docs/skills/forgecad-spec-by-walking-through-it) | `forgecad skill install` | Design a ForgeCAD model, mechanism, or assembly by fixing WHAT before HOW in a git-reviewed design document, validated by mentally operating the thing step by step. Covers fuzzy-request intake and process choice, high-level design (HLD), and low-level design (LLD). Use on "spec this out", "plan the design", "write the HLD/LLD", a vague build request that needs concrete decisions, or any moment the right move is a reviewable spec before code. |
|
|
25
|
-
| [forgecad-visual-spec](/docs/skills/forgecad-visual-spec) | `forgecad skill install` | Turn a concrete ForgeCAD artifact, build brief, HLD, or existing model into builder-honest image prompts for AI image models. Use when the user wants visual-spec renders that show the final product while keeping mechanisms, seams, hardware, and build cues visible instead of drifting into concept art. |
|
|
14
|
+
| [forgecad-build-model](/docs/skills/forgecad-build-model) | `forgecad skill install` | Build or edit a manufacture-realistic `.forge.js` model in a project, then validate it with run, render, inspect, and export evidence. |
|
|
15
|
+
| [forgecad-design-spec](/docs/skills/forgecad-design-spec) | `forgecad skill install` | Create a ForgeCAD design brief, HLD, or LLD before coding by walking through use, assembly, interfaces, decisions, and verification. |
|
|
16
|
+
| [forgecad-grade-model](/docs/skills/forgecad-grade-model) | `forgecad skill install` | Grade a ForgeCAD or CAD-as-code model against a requirement, brief, prompt, reference, or acceptance criteria with evidence and a 0-10 score. |
|
|
17
|
+
| [forgecad-image-prompt](/docs/skills/forgecad-image-prompt) | `forgecad skill install` | Write builder-honest AI image prompts from a concrete ForgeCAD model, build brief, HLD, or LLD without hiding how the artifact is built. |
|
|
18
|
+
| [forgecad-inspect-model](/docs/skills/forgecad-inspect-model) | `forgecad skill install` | Select, run, and interpret ForgeCAD inspection evidence for collisions, sections, wall thickness, components, masks, depth, normals, surface continuity, and fit. |
|
|
19
|
+
| [forgecad-project-sync](/docs/skills/forgecad-project-sync) | `forgecad skill install` | Manage hosted ForgeCAD project sync from the CLI: init, clone, pull, push, file operations, members, publishing, and shares. |
|
|
20
|
+
| [forgecad-reconstruct-cad-file](/docs/skills/forgecad-reconstruct-cad-file) | `forgecad skill install` | Reconstruct a readable parametric ForgeCAD model from an existing CAD or mesh file such as STL, OBJ, 3MF, STEP, or STP. |
|
|
21
|
+
| [forgecad-reconstruct-from-images](/docs/skills/forgecad-reconstruct-from-images) | `forgecad skill install` | Reconstruct a real parametric ForgeCAD object from reference images by using images as evidence, not as a one-view facade. |
|
|
22
|
+
| [forgecad-verify-mujoco](/docs/skills/forgecad-verify-mujoco) | `forgecad skill install` | Verify a ForgeCAD MJCF export in MuJoCo with dynamics, contacts, controls, joint travel, and rendered evidence before calling it simulation-ready. |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const aluminum = Fea.material('6061-T6', {
|
|
2
|
+
densityKgM3: 2700,
|
|
3
|
+
youngsModulusMPa: 68900,
|
|
4
|
+
poissonRatio: 0.33,
|
|
5
|
+
yieldStrengthMPa: 276,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const beam = box(200, 20, 10);
|
|
9
|
+
|
|
10
|
+
return assembly('Cantilever FEA')
|
|
11
|
+
.addPart('Beam', beam, { fea: Fea.body({ material: aluminum }) })
|
|
12
|
+
.withFeaStudy(
|
|
13
|
+
Fea.study.staticStress('tip-load', {
|
|
14
|
+
fixtures: [Fea.fix.fixed(Fea.region.face('Beam', 'left'))],
|
|
15
|
+
loads: [Fea.load.force(Fea.region.face('Beam', 'right'), { newtons: 100, direction: [0, 0, -1] })],
|
|
16
|
+
target: Fea.target.minSafetyFactor(2),
|
|
17
|
+
mesh: Fea.mesh.quadraticTets({ maxSizeMm: 3 }),
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Full round and face fillet — two face-driven blends. Both require OCCT.
|
|
2
|
+
const length = param('Length', 90);
|
|
3
|
+
const railWidth = param('Rail Width', 14);
|
|
4
|
+
const height = param('Height', 30);
|
|
5
|
+
const gap = length * 0.75;
|
|
6
|
+
|
|
7
|
+
// A bar whose narrow top face ("top") sits between the two long side faces.
|
|
8
|
+
function bar() {
|
|
9
|
+
return box(length, railWidth, height);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Full round: roll a blend over the narrow top face so the two sides meet
|
|
13
|
+
// tangentially. The radius defaults to half the center-face span.
|
|
14
|
+
const rounded = Blend.FullRound({
|
|
15
|
+
shape: bar(),
|
|
16
|
+
centerFace: bar().face('top'),
|
|
17
|
+
})
|
|
18
|
+
.translate(-gap, 0, 0)
|
|
19
|
+
.color('#9ed892');
|
|
20
|
+
|
|
21
|
+
// Face fillet: blend every edge shared by the top face and one side face.
|
|
22
|
+
const seed = bar();
|
|
23
|
+
const faceFilleted = Blend.Face({
|
|
24
|
+
shape: seed,
|
|
25
|
+
faces: [seed.face('top'), seed.face('side-right')],
|
|
26
|
+
radius: 5,
|
|
27
|
+
})
|
|
28
|
+
.translate(gap, 0, 0)
|
|
29
|
+
.color('#e8c06a');
|
|
30
|
+
|
|
31
|
+
verify.noSelfIntersection('Full round is a valid solid', rounded);
|
|
32
|
+
verify.noSelfIntersection('Face fillet is a valid solid', faceFilleted);
|
|
33
|
+
|
|
34
|
+
return [
|
|
35
|
+
{ name: 'Full Round (top consumed)', shape: rounded },
|
|
36
|
+
{ name: 'Face Fillet (top x side-right)', shape: faceFilleted },
|
|
37
|
+
];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Variable-radius edge fillet — the blend tapers along the edge instead of
|
|
2
|
+
// holding a single radius. Requires the OCCT backend.
|
|
3
|
+
const width = param('Width', 80);
|
|
4
|
+
const depth = param('Depth', 40);
|
|
5
|
+
const height = param('Height', 24);
|
|
6
|
+
const gap = width * 0.95;
|
|
7
|
+
|
|
8
|
+
function block() {
|
|
9
|
+
return box(width, depth, height);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Constant radius — the reference.
|
|
13
|
+
const constant = Blend.Edge({
|
|
14
|
+
shape: block(),
|
|
15
|
+
edges: [block().edge('top-right')],
|
|
16
|
+
radius: 4,
|
|
17
|
+
})
|
|
18
|
+
.translate(-gap, 0, 0)
|
|
19
|
+
.color('#8aa0c8');
|
|
20
|
+
|
|
21
|
+
// Linear taper from 1mm at u=0 to 8mm at u=1 along the same edge.
|
|
22
|
+
const tapered = Blend.Edge({
|
|
23
|
+
shape: block(),
|
|
24
|
+
edges: [block().edge('top-right')],
|
|
25
|
+
variableRadius: { start: 1, end: 8 },
|
|
26
|
+
})
|
|
27
|
+
.color('#9ed892');
|
|
28
|
+
|
|
29
|
+
// Station law — a bulge in the middle of the edge.
|
|
30
|
+
const bulged = Blend.Edge({
|
|
31
|
+
shape: block(),
|
|
32
|
+
edges: [block().edge('top-right')],
|
|
33
|
+
variableRadius: {
|
|
34
|
+
stations: [
|
|
35
|
+
{ at: 0, radius: 1 },
|
|
36
|
+
{ at: 0.5, radius: 7 },
|
|
37
|
+
{ at: 1, radius: 1 },
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
.translate(gap, 0, 0)
|
|
42
|
+
.color('#e8c06a');
|
|
43
|
+
|
|
44
|
+
verify.noSelfIntersection('Tapered fillet is a valid solid', tapered);
|
|
45
|
+
verify.noSelfIntersection('Bulged fillet is a valid solid', bulged);
|
|
46
|
+
|
|
47
|
+
return [
|
|
48
|
+
{ name: 'Constant r=4', shape: constant },
|
|
49
|
+
{ name: 'Linear taper 1->8', shape: tapered },
|
|
50
|
+
{ name: 'Station bulge 1-7-1', shape: bulged },
|
|
51
|
+
];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Projected curve & surface-surface intersection curve on Surface.Net sheets.
|
|
2
|
+
//
|
|
3
|
+
// Curve.ProjectOnSurface drapes a planned guide line onto a freeform panel along
|
|
4
|
+
// the surface normal; the foot curve becomes a real on-surface seam bead.
|
|
5
|
+
// Curve.Intersect follows the surface-surface intersection of two sheets and
|
|
6
|
+
// returns the exact NURBS seam where they meet, which we sweep into a weld bead.
|
|
7
|
+
|
|
8
|
+
const span = param('Span', 120);
|
|
9
|
+
const depth = param('Depth', 100);
|
|
10
|
+
const crown = param('Crown', 22);
|
|
11
|
+
|
|
12
|
+
// A gently crowned panel.
|
|
13
|
+
const panelCage = [];
|
|
14
|
+
const M = 6;
|
|
15
|
+
const N = 6;
|
|
16
|
+
for (let i = 0; i <= M; i++) {
|
|
17
|
+
const row = [];
|
|
18
|
+
for (let j = 0; j <= N; j++) {
|
|
19
|
+
const x = (i / M) * span - span / 2;
|
|
20
|
+
const y = (j / N) * depth - depth / 2;
|
|
21
|
+
const z = Math.sin((i / M) * Math.PI) * crown + Math.cos((j / N) * Math.PI) * (crown * 0.4);
|
|
22
|
+
row.push([x, y, z]);
|
|
23
|
+
}
|
|
24
|
+
panelCage.push(row);
|
|
25
|
+
}
|
|
26
|
+
const panel = Surface.Net().cage(panelCage).degree(3, 3);
|
|
27
|
+
const panelSolid = panel.thicken(2).color('#9fd3ff');
|
|
28
|
+
|
|
29
|
+
// 1) Project a straight guide onto the crowned panel → on-surface seam.
|
|
30
|
+
const guide = Curve.Line([-span * 0.4, -depth * 0.2, crown * 2], [span * 0.4, depth * 0.2, crown * 2]);
|
|
31
|
+
const seam = Curve.ProjectOnSurface(guide, panel, { samples: 64, maxGap: crown * 3 });
|
|
32
|
+
const seamBead = sweep(circle2d(0.8), seam).color('#ffd166');
|
|
33
|
+
|
|
34
|
+
// 2) Intersect the panel with a vertical cutting sheet → exact intersection curve.
|
|
35
|
+
const cutCage = [];
|
|
36
|
+
for (let i = 0; i <= 4; i++) {
|
|
37
|
+
const row = [];
|
|
38
|
+
for (let j = 0; j <= 4; j++) {
|
|
39
|
+
const t = i / 4;
|
|
40
|
+
row.push([(t - 0.5) * span * 0.9, (t - 0.5) * depth * 0.4, (j / 4) * crown * 2]);
|
|
41
|
+
}
|
|
42
|
+
cutCage.push(row);
|
|
43
|
+
}
|
|
44
|
+
const cutSheet = Surface.Net().cage(cutCage).degree(3, 1);
|
|
45
|
+
|
|
46
|
+
const branches = Curve.Intersect(panel, cutSheet, { samples: 40 });
|
|
47
|
+
if (branches.length === 0) throw new Error('Expected the panel and cutting sheet to intersect.');
|
|
48
|
+
const weldBeads = branches.map((branch) => sweep(circle2d(0.9), branch).color('#ef476f'));
|
|
49
|
+
|
|
50
|
+
scene({
|
|
51
|
+
background: { top: '#eef3f8', bottom: '#fbfdff' },
|
|
52
|
+
camera: { position: [0, -260, 150], target: [0, 0, 24], fov: 34 },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return [
|
|
56
|
+
{ name: 'Crowned Panel', shape: panelSolid },
|
|
57
|
+
{ name: 'Projected Seam Bead', shape: seamBead },
|
|
58
|
+
...weldBeads.map((shape, index) => ({ name: `Intersection Weld ${index + 1}`, shape })),
|
|
59
|
+
];
|