forgecad 0.9.14 → 0.9.16
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/LICENSE +6 -4
- package/README.md +8 -4
- package/dist/assets/{AdminPage-eWGs2K6H.js → AdminPage-CXvls4-J.js} +2 -2
- package/dist/assets/{BenchmarkPage-CTrLKfpo.js → BenchmarkPage-B27zk8xL.js} +4 -15
- package/dist/assets/{BlogPage-5nPesyds.js → BlogPage-CMAVvgQL.js} +2 -2
- package/dist/assets/{DocsPage-C4Y3nbYc.js → DocsPage-knf4I4h7.js} +9 -3
- package/dist/assets/EditorApp-BHMQlJ-D.js +14686 -0
- package/dist/assets/{EditorApp-BAnckbsk.css → EditorApp-BpjZgzk0.css} +846 -0
- package/dist/assets/{EmbedViewer-C8fB4n5U.js → EmbedViewer-D7ZGlFjx.js} +3 -3
- package/dist/assets/{LandingPageProofDriven-jSz0LaMM.js → LandingPageProofDriven-CnevhTE8.js} +36 -38
- package/dist/assets/LegalPage-BPTUmqeg.js +39 -0
- package/dist/assets/LegalPage-BRlScr9A.css +91 -0
- package/dist/assets/{PricingPage-B83B90zh.js → PricingPage-B0D4goG_.js} +19 -19
- package/dist/assets/{PricingPage-BMedqFef.css → PricingPage-BPF6HKyO.css} +25 -0
- package/dist/assets/{SettingsPage-DY889pcu.js → SettingsPage-CFF-UgjI.js} +2 -2
- package/dist/assets/app-CE3sYcV7.css +3890 -0
- package/dist/assets/{app-bEww1ic4.js → app-T0pDcSX4.js} +3382 -1069
- package/dist/assets/cli/{render-Cho2uKG_.js → render-C5pcIISc.js} +477 -29
- package/dist/assets/{constructionHistoryWorker-HYwzJY4m.js → constructionHistoryWorker-Ba2Hm58b.js} +928 -243
- package/dist/assets/{evalWorker-CjQwJSE-.js → evalWorker-vkx310U2.js} +8883 -6040
- package/dist/assets/{forgecad_geometry-CH2nvuLA.js → forgecad_geometry-Dgceylq9.js} +43 -1
- package/dist/assets/forgecad_geometry_bg-dD4RNQF1.wasm +0 -0
- package/dist/assets/{inspectWorker-DeRnMVv1.js → inspectWorker-BuTJDVX6.js} +1179 -273
- package/dist/assets/{javascript-70-4uGcz.js → javascript-1kQXfVaz.js} +1 -1
- package/dist/assets/{targets-D6PWsv6X.js → jointPose-B_Cgedn9.js} +71 -3
- package/dist/assets/landing-proof-driven-DiGqdtWa.js +18 -0
- package/dist/assets/{landing-proof-driven-oFYW6mjz.css → landing-proof-driven-ORyigZ6p.css} +13 -7
- package/dist/assets/legalContent-ZfFGMmi4.js +251 -0
- package/dist/assets/{manifold-rmfAcdwF.js → manifold-BWgsjmAM.js} +1 -1
- package/dist/assets/{manifold-uRzgk5O8.js → manifold-D6IFSkhH.js} +2 -2
- package/dist/assets/{manifold-CG9Fokx-.js → manifold-rZexZI0G.js} +1 -1
- package/dist/assets/{reportWorker-4cW_ZpoS.js → reportWorker-0AGij1Ru.js} +8659 -12771
- package/dist/assets/{scalar-sampling-budget-CfDiFvh7.js → scalar-sampling-budget-J5cuzxT1.js} +8050 -6203
- package/dist/assets/{scanProxyWorker-Bs2TDgLw.js → scanProxyWorker-Vl4Wxa1y.js} +50 -6
- package/dist/assets/{solver-DuJAO8S6.js → solver-BZ9LPTHs.js} +1 -1
- package/dist/assets/solver_bg-DAHZJ_rw.wasm +0 -0
- package/dist/assets/{vendor-react-Da3A2QmU.js → vendor-react-6j1Kke-Y.js} +6 -5
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/ai-native-cad.md +50 -0
- package/dist/docs-raw/AI/usage.md +5 -12
- package/dist/docs-raw/CLI.md +34 -10
- package/dist/docs-raw/component-model.md +27 -11
- package/dist/docs-raw/generated/assembly.md +374 -187
- package/dist/docs-raw/generated/concepts.md +245 -237
- package/dist/docs-raw/generated/core.md +283 -6
- package/dist/docs-raw/generated/curves.md +274 -361
- package/dist/docs-raw/generated/lib.md +9 -19
- package/dist/docs-raw/generated/output.md +29 -4
- package/dist/docs-raw/generated/runtime-names.md +49 -0
- package/dist/docs-raw/generated/sdf.md +31 -0
- package/dist/docs-raw/generated/sheet-metal.md +9 -0
- package/dist/docs-raw/generated/sketch.md +44 -1
- package/dist/docs-raw/generated/viewport.md +11 -3
- package/dist/docs-raw/guides/coordinate-system.md +20 -16
- package/dist/docs-raw/guides/geometry-conventions.md +2 -2
- package/dist/docs-raw/guides/inspection-bundles.md +2 -1
- package/dist/docs-raw/guides/joint-design.md +24 -0
- package/dist/docs-raw/guides/positioning.md +13 -3
- package/dist/docs-raw/legal/privacy.md +63 -0
- package/dist/docs-raw/legal/software-license.md +55 -0
- package/dist/docs-raw/legal/terms.md +87 -0
- package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +1 -1
- package/dist/docs-raw/skills/forgecad-blockout-model.md +1 -1
- package/dist/docs-raw/skills/forgecad-component-model.md +11 -2
- package/dist/docs-raw/skills/forgecad-high-level-spec.md +1 -1
- package/dist/docs-raw/skills/forgecad-image-replicator.md +8 -8
- package/dist/docs-raw/skills/forgecad-lld.md +1 -1
- package/dist/docs-raw/skills/forgecad-make-a-model.md +40 -39
- package/dist/docs-raw/skills/forgecad-model-grader.md +2 -2
- package/dist/docs-raw/skills/forgecad-prepare-prompt.md +2 -2
- package/dist/docs-raw/skills/forgecad-project.md +3 -1
- package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +1 -1
- package/dist/docs-raw/skills/forgecad-render-inspect.md +4 -2
- package/dist/docs-raw/skills/forgecad-visual-spec.md +1 -1
- package/dist/docs-raw/skills/forgecad.md +4 -3
- package/dist/docs-raw/welcome.md +2 -0
- package/dist/index.html +40 -12
- package/dist/llms.txt +8 -0
- package/dist/site.webmanifest +1 -1
- package/dist/sitemap.xml +49 -13
- package/dist-cli/{check-compiler-U5SOPN7X.js → check-compiler-SYQ2PWOB.js} +1 -2
- package/dist-cli/{check-query-propagation-XOKNSSYU.js → check-query-propagation-HIAGV62W.js} +1 -2
- package/dist-cli/{chunk-EXWGNL6K.js → chunk-SPZE3DUY.js} +20659 -17930
- package/dist-cli/forgecad.js +3568 -1250
- package/dist-cli/{forgecad_geometry-GYVNKPIE.js → forgecad_geometry-QOQIIP53.js} +42 -1
- package/dist-cli/forgecad_geometry_bg.wasm +0 -0
- package/dist-cli/{solver-46FFSK2U.js → solver-OK4HECRH.js} +0 -1
- package/dist-cli/solver_bg.wasm +0 -0
- package/dist-skill/CONTEXT.md +1192 -725
- package/dist-skill/SKILL.md +3 -2
- package/dist-skill/docs/API/core/concepts.md +64 -1
- package/dist-skill/docs/CLI.md +34 -10
- package/dist-skill/docs/generated/assembly.md +339 -213
- package/dist-skill/docs/generated/core.md +283 -6
- package/dist-skill/docs/generated/curves.md +272 -362
- package/dist-skill/docs/generated/lib.md +9 -19
- package/dist-skill/docs/generated/output.md +29 -4
- package/dist-skill/docs/generated/runtime-names.md +40 -0
- package/dist-skill/docs/generated/sdf.md +31 -0
- package/dist-skill/docs/generated/sheet-metal.md +9 -0
- package/dist-skill/docs/generated/sketch.md +44 -2
- package/dist-skill/docs/generated/viewport.md +2 -87
- package/dist-skill/docs/guides/coordinate-system.md +20 -16
- package/dist-skill/docs/guides/geometry-conventions.md +2 -2
- package/dist-skill/docs/guides/inspection-bundles.md +2 -1
- package/dist-skill/docs/guides/joint-design.md +24 -0
- package/dist-skill/docs/guides/positioning.md +13 -3
- package/dist-skill/library/forgecad-component-model/SKILL.md +10 -1
- package/dist-skill/library/forgecad-image-replicator/SKILL.md +6 -6
- package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.py +166 -0
- package/dist-skill/library/forgecad-make-a-model/SKILL.md +39 -38
- package/dist-skill/library/forgecad-model-grader/SKILL.md +1 -1
- package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +1 -1
- package/dist-skill/library/forgecad-project/SKILL.md +2 -0
- package/dist-skill/library/forgecad-render-inspect/SKILL.md +3 -1
- package/examples/api/assembly-kinematics-foundation.forge.js +65 -0
- package/examples/api/assembly-kinematics-four-bar.forge.js +115 -0
- package/examples/api/assembly-kinematics-limb.forge.js +116 -0
- package/examples/api/connector-frame-rig-chain.forge.js +102 -0
- package/examples/api/exact-sheet-shell-assembly.forge.js +0 -2
- package/examples/api/exact-surface-studio.forge.js +6 -8
- package/examples/api/helix-basics.forge.js +8 -8
- package/examples/api/lean-foundations/README.md +12 -0
- package/examples/api/lean-foundations/curve-blend-exact.forge.js +22 -0
- package/examples/api/lean-foundations/curve-fit-interpolation.forge.js +18 -0
- package/examples/api/lean-foundations/curve-helix-canonicalization.forge.js +27 -0
- package/examples/api/lean-foundations/curve-route-canonicalization.forge.js +16 -0
- package/examples/api/lean-foundations/curve-trim-reverse.forge.js +24 -0
- package/examples/api/lean-foundations/exact-curve-arc.forge.js +36 -0
- package/examples/api/mixed-edge-finishes-proof.forge.js +8 -11
- package/examples/api/route3d-elbow.forge.js +71 -0
- package/examples/api/transition-curves.forge.js +44 -15
- package/examples/api/variable-sweep-test.forge.js +3 -1
- package/examples/api/y-blend-corner-showcase.forge.js +0 -2
- package/examples/generative/coral-vase.forge.js +1 -1
- package/examples/nurbs-tube.forge.js +1 -1
- package/package.json +17 -13
- package/dist/assets/EditorApp-lXv53A1m.js +0 -13610
- package/dist/assets/app-CsHnaBWt.css +0 -1789
- package/dist/assets/forgecad_geometry_bg-C5_E9Oa9.wasm +0 -0
- package/dist/assets/solver_bg-CWvv4lnN.wasm +0 -0
- package/dist/docs-raw/API/README.md +0 -16
- package/dist/docs-raw/API/core/concepts.md +0 -118
- package/dist/docs-raw/INDEX.md +0 -138
- package/dist/docs-raw/RELEASING.md +0 -87
- package/dist/docs-raw/agent-native-api.md +0 -27
- package/dist/docs-raw/beta-deployment.md +0 -304
- package/dist/docs-raw/beta-operations.md +0 -325
- package/dist/docs-raw/blueprint-first.md +0 -145
- package/dist/docs-raw/cli-monetization.md +0 -112
- package/dist/docs-raw/coding-best-practices.md +0 -120
- package/dist/docs-raw/coding.md +0 -340
- package/dist/docs-raw/deployment.md +0 -374
- package/dist/docs-raw/guides/skill-maintenance.md +0 -161
- package/dist/docs-raw/guides/surface-members.md +0 -82
- package/dist/docs-raw/harbor-cli.md +0 -854
- package/dist/docs-raw/internals/backend-vocabulary.md +0 -35
- package/dist/docs-raw/internals/compiler.md +0 -307
- package/dist/docs-raw/internals/constraint-solver-quality.md +0 -161
- package/dist/docs-raw/internals/constraint-solver.md +0 -176
- package/dist/docs-raw/internals/shape-from-slices.md +0 -152
- package/dist/docs-raw/internals/sketch-2d-pipeline.md +0 -108
- package/dist/docs-raw/platform/admin.md +0 -45
- package/dist/docs-raw/platform/architecture.md +0 -82
- package/dist/docs-raw/platform/auth.md +0 -139
- package/dist/docs-raw/platform/email.md +0 -67
- package/dist/docs-raw/platform/google-oauth-setup.md +0 -88
- package/dist/docs-raw/platform/observability.md +0 -197
- package/dist/docs-raw/platform/projects.md +0 -111
- package/dist/docs-raw/platform/sharing.md +0 -90
- package/dist/docs-raw/product/README.md +0 -39
- package/dist/docs-raw/product/api-as-product-language.md +0 -13
- package/dist/docs-raw/product/business-model.md +0 -15
- package/dist/docs-raw/product/competitive-positioning.md +0 -17
- package/dist/docs-raw/product/creative-manufacturing.md +0 -15
- package/dist/docs-raw/product/founder-story.md +0 -11
- package/dist/docs-raw/product/manufacturing-workflows.md +0 -15
- package/dist/docs-raw/product/onboarding-first-experience.md +0 -256
- package/dist/docs-raw/product/product-loop.md +0 -17
- package/dist/docs-raw/product/strategic-decisions.md +0 -22
- package/dist/docs-raw/product/user-outreach-email-templates.md +0 -161
- package/dist/docs-raw/product/user-segments.md +0 -15
- package/dist/docs-raw/product/vision.md +0 -26
- package/dist/docs-raw/rl-environments.md +0 -350
- package/dist/docs-raw/runbook.md +0 -611
- package/dist-cli/check-compiler-U5SOPN7X.js.map +0 -1
- package/dist-cli/check-query-propagation-XOKNSSYU.js.map +0 -1
- package/dist-cli/chunk-EXWGNL6K.js.map +0 -1
- package/dist-cli/forgecad.js.map +0 -1
- package/dist-cli/forgecad_geometry-GYVNKPIE.js.map +0 -1
- package/dist-cli/solver-46FFSK2U.js.map +0 -1
- package/dist-skill/SKILL-dev.md +0 -145
- package/dist-skill/docs-dev/API/core/concepts.md +0 -118
- package/dist-skill/docs-dev/CLI.md +0 -677
- package/dist-skill/docs-dev/agent-native-api.md +0 -27
- package/dist-skill/docs-dev/blueprint-first.md +0 -145
- package/dist-skill/docs-dev/coding-best-practices.md +0 -120
- package/dist-skill/docs-dev/coding.md +0 -340
- package/dist-skill/docs-dev/component-model.md +0 -164
- package/dist-skill/docs-dev/generated/assembly.md +0 -794
- package/dist-skill/docs-dev/generated/core.md +0 -2117
- package/dist-skill/docs-dev/generated/curves.md +0 -2583
- package/dist-skill/docs-dev/generated/lib.md +0 -169
- package/dist-skill/docs-dev/generated/output.md +0 -247
- package/dist-skill/docs-dev/generated/sdf.md +0 -446
- package/dist-skill/docs-dev/generated/sheet-metal.md +0 -504
- package/dist-skill/docs-dev/generated/sketch.md +0 -1811
- package/dist-skill/docs-dev/generated/viewport.md +0 -585
- package/dist-skill/docs-dev/generated/wood.md +0 -108
- package/dist-skill/docs-dev/guides/coordinate-system.md +0 -46
- package/dist-skill/docs-dev/guides/geometry-conventions.md +0 -52
- package/dist-skill/docs-dev/guides/inspection-bundles.md +0 -485
- package/dist-skill/docs-dev/guides/joint-design.md +0 -78
- package/dist-skill/docs-dev/guides/modeling-recipes.md +0 -78
- package/dist-skill/docs-dev/guides/positioning.md +0 -161
- package/dist-skill/docs-dev/guides/skill-maintenance.md +0 -161
- package/dist-skill/docs-dev/internals/backend-vocabulary.md +0 -35
- package/dist-skill/docs-dev/internals/compiler.md +0 -307
- package/dist-skill/docs-dev/internals/constraint-solver-quality.md +0 -161
- package/dist-skill/docs-dev/internals/constraint-solver.md +0 -176
- package/dist-skill/docs-dev/internals/sketch-2d-pipeline.md +0 -108
- package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.mjs +0 -289
- package/examples/api/bolted-service-cover.forge.js +0 -17
- package/examples/api/cable-gland-anchor.forge.js +0 -14
- package/examples/api/captured-cartridge-guide.forge.js +0 -14
- package/examples/api/captured-linear-slide.forge.js +0 -13
- package/examples/api/clevis-pin-joint.forge.js +0 -13
- package/examples/api/datum-enclosure.forge.js +0 -16
- package/examples/api/hose-barb-port.forge.js +0 -14
- package/examples/api/knuckled-hinge-assembly.forge.js +0 -15
- package/examples/api/living-hinge-cover.forge.js +0 -14
- package/examples/api/pcb-terminal-block.forge.js +0 -22
- package/examples/api/pinned-lever-pivot-stack.forge.js +0 -14
- package/examples/api/retained-shaft-knob-stack.forge.js +0 -15
- package/examples/api/routed-tube-clip.forge.js +0 -15
- package/examples/api/seated-bearing-stack.forge.js +0 -30
- package/examples/api/snap-latch-cover.forge.js +0 -14
- package/examples/api/thumb-screw-clamp.forge.js +0 -15
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill-group: recipes
|
|
3
|
-
skill-order: 1
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Modeling Recipes
|
|
7
|
-
|
|
8
|
-
## Iteration Bias
|
|
9
|
-
|
|
10
|
-
- Default to a buildable first pass instead of a long proposal.
|
|
11
|
-
- Replace a broken model wholesale when that is faster than incremental patching.
|
|
12
|
-
- Validate early with `forgecad run <file>`.
|
|
13
|
-
|
|
14
|
-
## Common Patterns
|
|
15
|
-
|
|
16
|
-
### Hollow Shell
|
|
17
|
-
```javascript
|
|
18
|
-
const innerSize = outer - 2 * wall;
|
|
19
|
-
const outerBox = box(outer, outer, outer).placeReference('center', [0, 0, 0]);
|
|
20
|
-
const innerBox = box(innerSize, innerSize, innerSize).placeReference('center', [0, 0, 0]);
|
|
21
|
-
return outerBox.subtract(innerBox);
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Sketch-Based Twist
|
|
25
|
-
```javascript
|
|
26
|
-
const outer = ngon(sides, radius);
|
|
27
|
-
const inner = ngon(sides, radius - wall);
|
|
28
|
-
return outer.subtract(inner).extrude(height, { twist: 45, divisions: 32 });
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Rounded Profiles
|
|
32
|
-
```javascript
|
|
33
|
-
// All convex corners — offset trick
|
|
34
|
-
const base = rect(50, 30).offset(-3, 'Round').offset(3, 'Round');
|
|
35
|
-
|
|
36
|
-
// Selected corners only
|
|
37
|
-
const roof = filletCorners(roofPoints, [
|
|
38
|
-
{ index: 3, radius: 19 },
|
|
39
|
-
{ index: 4, radius: 19 },
|
|
40
|
-
{ index: 5, radius: 19 },
|
|
41
|
-
]);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Choosing the right sketch-rounding tool
|
|
45
|
-
|
|
46
|
-
- `offset(-r).offset(+r)` — round every convex corner of a closed outline
|
|
47
|
-
- `stroke(points, width, 'Round')` — centerline-based geometry (ribs, traces)
|
|
48
|
-
- `filletCorners(points, ...)` — selective true-corner fillets on mixed profiles
|
|
49
|
-
|
|
50
|
-
## Best Practices
|
|
51
|
-
|
|
52
|
-
- All dimensions in millimeters; angles in degrees.
|
|
53
|
-
- Primitives are centered on XY, base at Z=0. Use `placeReference('center', [0,0,0])` to center on all axes.
|
|
54
|
-
- Prefer named intermediate values over deeply nested one-liners.
|
|
55
|
-
- `union2d`, `difference2d`, `intersection2d` batch faster than chained `.add()` / `.subtract()`.
|
|
56
|
-
|
|
57
|
-
## Debugging
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
console.log("Volume:", shape.volume());
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
For sketch-heavy work, compare the raw profile and rounded profile side-by-side before extruding:
|
|
64
|
-
|
|
65
|
-
```javascript
|
|
66
|
-
return [
|
|
67
|
-
{ name: "Raw", sketch: polygon(roofPoints) },
|
|
68
|
-
{ name: "Rounded", sketch: filletCorners(roofPoints, [...]).translate(120, 0) },
|
|
69
|
-
];
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Common Errors
|
|
73
|
-
|
|
74
|
-
- `"Kernel not initialized"` — internal/runtime issue, reload the app
|
|
75
|
-
- zero dimensions or self-intersecting sketches → invalid geometry
|
|
76
|
-
- wrong variable name → `"Cannot read property of undefined"`
|
|
77
|
-
|
|
78
|
-
For deeper API coverage, load the relevant generated doc group from the skill source map instead of reaching for repo examples by default.
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill-group: geometry
|
|
3
|
-
skill-order: 3
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Positioning Strategy
|
|
7
|
-
|
|
8
|
-
## Rule 0: if parts should touch, use connectors first
|
|
9
|
-
|
|
10
|
-
For any fixed assembly where parts are meant to stay in contact in the final model, start with connectors + `matchTo()`. This applies to furniture, fixtures, toys, enclosures, sleds, and any other static multi-part object, not only mechanisms.
|
|
11
|
-
|
|
12
|
-
Use raw `translate()` and `rotate()` when parts are intentionally free-floating or when you are doing quick exploratory layout. Use `attachTo()` for rough bounding-box placement. But if the relationship is a real interface, make it explicit with connectors.
|
|
13
|
-
|
|
14
|
-
## Primitive origin convention
|
|
15
|
-
|
|
16
|
-
All 3D primitives are **centered on XY, base at Z=0**:
|
|
17
|
-
|
|
18
|
-
| Primitive | X range | Y range | Z range |
|
|
19
|
-
|-----------|---------|---------|---------|
|
|
20
|
-
| `box(60, 40, 20)` | [-30, 30] | [-20, 20] | [0, 20] |
|
|
21
|
-
| `cylinder(50, 10)` | [-10, 10] | [-10, 10] | [0, 50] |
|
|
22
|
-
| `sphere(15)` | [-15, 15] | [-15, 15] | [-15, 15] |
|
|
23
|
-
| `torus(20, 5)` | [-25, 25] | [-25, 25] | [-5, 5] |
|
|
24
|
-
|
|
25
|
-
Sphere and torus are fully centered (symmetric in Z). Box and cylinder sit on the XY ground plane — **Z goes up from zero, never negative**.
|
|
26
|
-
|
|
27
|
-
This means `box(w, d, h).translate(0, 0, -h / 2)` is the manual way to "center on Z" — it moves the box from `[0, h]` to `[-h / 2, h / 2]`. Prefer `box(w, d, h).placeReference('center', [0, 0, 0])` when you want full XYZ centering.
|
|
28
|
-
|
|
29
|
-
Do not assume `center: true` or a positional `true` gives OpenSCAD-style full XYZ centering. Primitive placement is fixed unless the primitive docs explicitly say otherwise.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
Most positioning bugs come from manual coordinate arithmetic. Use these methods in priority order.
|
|
34
|
-
|
|
35
|
-
## 1. Connectors + `matchTo()` — default for mating interfaces
|
|
36
|
-
|
|
37
|
-
Define connectors on parts; `matchTo()` provides automatic 6-DOF alignment. The child translates and rotates so its connector aligns with the target's — origins coincide, axes oppose (plug-in model).
|
|
38
|
-
|
|
39
|
-
```javascript
|
|
40
|
-
const shelf = box(200, 120, 10).translate(0, 0, -5).withConnectors({
|
|
41
|
-
left_tab: connector.male("dovetail", { origin: [-100, 0, 0], axis: [-1, 0, 0] }),
|
|
42
|
-
});
|
|
43
|
-
const panel = box(12, 120, 200).translate(0, 0, -100).withConnectors({
|
|
44
|
-
shelf_0: connector.female("dovetail", { origin: [6, 0, -50], axis: [1, 0, 0] }),
|
|
45
|
-
});
|
|
46
|
-
const placed = shelf.matchTo(panel, "left_tab", "shelf_0");
|
|
47
|
-
// Dictionary form for multiple pairs on same target:
|
|
48
|
-
const placed2 = shelf.matchTo(panel, { left_tab: "shelf_0" });
|
|
49
|
-
// Named group children bubble connectors via dotted paths:
|
|
50
|
-
const cabinet = group({ name: "Left", shape: panel });
|
|
51
|
-
shelf.matchTo(cabinet, "left_tab", "Left.shelf_0");
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Why connectors first:** stable (don't shift on fillet/chamfer/boolean), semantic (carry type/gender), oriented (full frame), queryable (`shape.connectorDistance('a','b')`), explode-aware.
|
|
55
|
-
|
|
56
|
-
For a non-mechanism fixed-assembly example, see `examples/api/static-assembly-connectors.forge.js`.
|
|
57
|
-
|
|
58
|
-
## 2. `group()` — local coordinates for multi-part assemblies
|
|
59
|
-
|
|
60
|
-
The most common positioning bug: manually adding a parent's global offset to every sub-part. One wrong sign or forgotten variable and parts float into space. **Use `group()` to build parts in local coordinates (at the origin), then position the group once.**
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
// BAD — every sub-part repeats the parent's global position
|
|
64
|
-
const unitY = -18, unitZ = 70;
|
|
65
|
-
const body = lib.roundedBox(100, 20, 32, 4).translate(0, unitY, unitZ);
|
|
66
|
-
const panel = box(98, 2, 18).translate(0, unitY - 12, unitZ + 4);
|
|
67
|
-
const louver = box(88, 2, 6).translate(0, unitY - 14, unitZ - 11);
|
|
68
|
-
const led = sphere(1.2).translate(35, unitY - 12, unitZ + 9);
|
|
69
|
-
|
|
70
|
-
// GOOD — build at local origin, group, translate once
|
|
71
|
-
const body = lib.roundedBox(100, 20, 32, 4);
|
|
72
|
-
const panel = box(98, 2, 18).translate(0, -12, 4); // relative to local origin
|
|
73
|
-
const louver = box(88, 2, 6).translate(0, -14, -11); // relative to local origin
|
|
74
|
-
const led = sphere(1.2).translate(35, -12, 9); // relative to local origin
|
|
75
|
-
const indoorUnit = group(
|
|
76
|
-
{ name: 'Body', shape: body },
|
|
77
|
-
{ name: 'Panel', shape: panel },
|
|
78
|
-
{ name: 'Louver', shape: louver },
|
|
79
|
-
{ name: 'LED', shape: led },
|
|
80
|
-
).translate(0, -18, 70); // ONE translate for the whole assembly
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Groups nest.** Build sub-assemblies as groups, then group those into larger assemblies — each level has its own local origin.
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
const fan = group(hub, ...blades).translate(0, 25, 0); // fan assembly
|
|
87
|
-
const outdoorUnit = group(
|
|
88
|
-
{ name: 'Body', shape: casing },
|
|
89
|
-
{ name: 'Fan', shape: fan }, // already a group
|
|
90
|
-
{ name: 'Grille', shape: grille },
|
|
91
|
-
).translate(0, 23, -42); // position the whole outdoor unit
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
**When to use something else:** `group()` preserves individual shapes — you can't boolean (subtract/intersect) a group. If a sub-part needs a boolean with the parent body, do that boolean first in local coordinates, then group the result.
|
|
95
|
-
|
|
96
|
-
## 3. `pointAlong()` — orient cylinders before positioning
|
|
97
|
-
|
|
98
|
-
```javascript
|
|
99
|
-
// BAD
|
|
100
|
-
const pipe = cylinder(100, 5).rotateX(90).translate(x, y, z);
|
|
101
|
-
// GOOD — reads as "pipe pointing along Y"
|
|
102
|
-
const pipe = cylinder(100, 5).pointAlong([0, 1, 0]).translate(x, y, z);
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Always call `pointAlong()` BEFORE `matchTo()` or `translate()`** — it reorients around the origin.
|
|
106
|
-
|
|
107
|
-
## 4. `attachTo()` — quick bounding-box positioning
|
|
108
|
-
|
|
109
|
-
```javascript
|
|
110
|
-
const column = cylinder(50, 8).attachTo(base, 'top', 'bottom');
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`child.attachTo(parent, parentAnchor, selfAnchor, offset)`. Anchor points shift on fillet/chamfer/boolean — fragile for assembly interfaces, fine for quick prototyping.
|
|
114
|
-
|
|
115
|
-
## 5. `rotateAroundTo()` — aim a point around a hinge/axis
|
|
116
|
-
|
|
117
|
-
```javascript
|
|
118
|
-
const aimed = arm.rotateAroundTo([0, 0, 1], [0, 0, 0], "tip", [30, 30, 20]);
|
|
119
|
-
// Exact line solve:
|
|
120
|
-
const lineHit = arm.rotateAroundTo([0, 0, 1], [0, 0, 0], "tip", [30, 30, 0], { mode: 'line' });
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 6. `moveToLocal()` — offset from another shape's min corner
|
|
124
|
-
|
|
125
|
-
```javascript
|
|
126
|
-
const part = box(20, 20, 30).moveToLocal(base, 10, 10, 10);
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## 7. `translate()` — for simple offsets or bridging computed locations
|
|
130
|
-
|
|
131
|
-
```javascript
|
|
132
|
-
const pipeLen = bb2.min[1] - bb1.max[1];
|
|
133
|
-
const pipe = cylinder(pipeLen, 5).pointAlong([0, 1, 0]).translate(40, (bb1.max[1] + bb2.min[1]) / 2, bb1.min[2] + 15);
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## 8. `placeReference()` — align any anchor to a world coordinate
|
|
137
|
-
|
|
138
|
-
Place a shape so a named anchor point lands exactly where you want it. Accepts all built-in anchors (`'bottom'`, `'center'`, `'top-front-left'`, etc.) plus custom references from `withReferences()`.
|
|
139
|
-
|
|
140
|
-
```javascript
|
|
141
|
-
// Ground a shape — bottom face center at Z = 0
|
|
142
|
-
const grounded = shape.placeReference('bottom', [0, 0, 0])
|
|
143
|
-
|
|
144
|
-
// Center at the world origin
|
|
145
|
-
const centered = shape.placeReference('center', [0, 0, 0])
|
|
146
|
-
|
|
147
|
-
// Align left edge to X = 10
|
|
148
|
-
const aligned = shape.placeReference('left', [10, 0, 0])
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
Also works with custom placement references for cross-file parts:
|
|
152
|
-
|
|
153
|
-
```javascript
|
|
154
|
-
// widget.forge.js — define once
|
|
155
|
-
return union(base, post).withReferences({ points: { mount: [0, -16, -4] } });
|
|
156
|
-
|
|
157
|
-
// importer — consume
|
|
158
|
-
const widget = require("./widget.forge.js").placeReference("mount", [120, 40, 0]);
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
For cross-file parts needing proper alignment, prefer connectors over placement references.
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill-group: dev-skill
|
|
3
|
-
skill-order: 1
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill System Maintenance
|
|
7
|
-
|
|
8
|
-
ForgeCAD ships an AI agent skill that teaches language models how to author `.forge.js` models. The skill has two variants:
|
|
9
|
-
|
|
10
|
-
- **Standard** (`forgecad skill install`) — model-authoring docs only. Shipped to users.
|
|
11
|
-
- **Dev** (`forgecad skill install --dev`) — everything above plus internals (compiler, solver, sketch pipeline, coding conventions, full CLI). For developers building ForgeCAD itself.
|
|
12
|
-
|
|
13
|
-
## Architecture
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
docs/permanent/ ← source of truth for all docs
|
|
17
|
-
scripts/build-forgecad-skill.mjs ← reads docs, emits skill artifacts
|
|
18
|
-
dist-skill/
|
|
19
|
-
SKILL.md ← standard skill ({{SKILL_DIR}} placeholders)
|
|
20
|
-
SKILL-dev.md ← dev skill (same, with extra sections)
|
|
21
|
-
CONTEXT.md ← one-file paste target for chat UIs
|
|
22
|
-
docs/ ← full docs tree, copied from docs/permanent/
|
|
23
|
-
library/ ← namespaced companion skills for `skill install`
|
|
24
|
-
docs/permanent/skills/ ← generated website pages for installable skills
|
|
25
|
-
src/pages/generatedSkillSections.ts ← generated docs sidebar/search manifest
|
|
26
|
-
skills/forgecad/SKILL.md ← in-repo dev SKILL.md (relative paths)
|
|
27
|
-
skills/*/SKILL.md ← companion workflow skills, tagged for public export
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
At install time (`forge-skill.ts`), the `{{SKILL_DIR}}` placeholder is replaced with the actual install directory (for example `~/.agents/skills/forgecad`), and the docs tree is copied alongside.
|
|
31
|
-
|
|
32
|
-
## Adding a New Doc to the Skill
|
|
33
|
-
|
|
34
|
-
1. Write the doc under `docs/permanent/` (e.g. `docs/permanent/API/core/my-feature.md`).
|
|
35
|
-
2. Add YAML frontmatter at the top declaring which skill group it belongs to:
|
|
36
|
-
```yaml
|
|
37
|
-
---
|
|
38
|
-
skill-group: core
|
|
39
|
-
skill-order: 5
|
|
40
|
-
---
|
|
41
|
-
```
|
|
42
|
-
3. Run `npm run refresh` — this rebuilds CLI, types, docs, and skill in the correct order.
|
|
43
|
-
4. Run `node dist-cli/forgecad.js skill install` (or `--dev`) to install locally.
|
|
44
|
-
|
|
45
|
-
`skill install` copies the already-built `dist-skill` artifacts. It does not rebuild them. If you are working from a checkout, run `npm run build:skill:forgecad` or `npm run refresh` before installing.
|
|
46
|
-
|
|
47
|
-
`forgecad skill flattened-files <output-folder>` also reads the already-built `dist-skill` artifacts. It writes `forgecad.md` plus one Markdown file per bundled companion skill, appending extra files under filename-prefixed sections so each skill can be moved around as a single file.
|
|
48
|
-
|
|
49
|
-
The build script discovers docs by scanning `docs/permanent/` for files with `skill-group` frontmatter. No hardcoded file lists to update.
|
|
50
|
-
|
|
51
|
-
### Frontmatter fields
|
|
52
|
-
|
|
53
|
-
| Field | Required | Default | Description |
|
|
54
|
-
|-------|----------|---------|-------------|
|
|
55
|
-
| `skill-group` | Yes | — | Group name (must match `GROUP_REGISTRY` in build script) |
|
|
56
|
-
| `skill-order` | No | 50 | Sort order within the group |
|
|
57
|
-
|
|
58
|
-
### Inclusion rules
|
|
59
|
-
|
|
60
|
-
- **`skill-group: <name>`** — included in SKILL.md (index) and CONTEXT.md (inlined).
|
|
61
|
-
- **`skill-group: dev-<name>`** — dev-only, appears in SKILL-dev.md only.
|
|
62
|
-
- **No `skill-group`** — not part of the skill at all.
|
|
63
|
-
|
|
64
|
-
### Adding a new group
|
|
65
|
-
|
|
66
|
-
If you need a new group, add it to `GROUP_REGISTRY` in `scripts/build-forgecad-skill.mjs` with a title, guidance, and order number.
|
|
67
|
-
|
|
68
|
-
## Companion Skill Public Export
|
|
69
|
-
|
|
70
|
-
ForgeCAD also keeps companion workflow skills under `skills/`. These are the prompts and operating procedures used around the core modeling skill: build-brief preparation, model authoring, render inspection, print-time optimization, public project workflows, and similar.
|
|
71
|
-
|
|
72
|
-
Each companion skill declares whether it can be mirrored to the public repository:
|
|
73
|
-
|
|
74
|
-
```yaml
|
|
75
|
-
---
|
|
76
|
-
name: forgecad-make-a-model
|
|
77
|
-
description: Create new ForgeCAD (.forge.js) models...
|
|
78
|
-
forgecad-public: true
|
|
79
|
-
---
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Use `forgecad-public: true` for skills that help people reproduce ForgeCAD modeling workflows. Use `forgecad-public: false` for operational, private, or personal-process skills.
|
|
83
|
-
|
|
84
|
-
To list the public set:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
npm run sync:public-skills -- --list
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
To copy the public README source, rebuild the generated `forgecad` skill, build the installable companion library, and copy all public skills into the sibling public repo:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
npm run sync:public-skills
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
End users install the core skill and namespaced companion library from the npm package with:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
forgecad skill install
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Public companion skill folder names are the installed names. Use the `forgecad-*` prefix directly in `skills/` for public skills, for example `skills/forgecad-prepare-prompt/`, `skills/forgecad-make-a-model/`, and `skills/forgecad-lld/`. The build step copies these folders into `dist-skill/library/` without renaming them.
|
|
103
|
-
|
|
104
|
-
The sync script writes:
|
|
105
|
-
|
|
106
|
-
- `README.md` in the public repo from this repo's `public-kit/README.md`
|
|
107
|
-
- `skills/README.md` in this repo, listing public and private/internal skills
|
|
108
|
-
- `skills/README.md` in the public repo, listing only exported skills
|
|
109
|
-
- `skills/forgecad/` in the public repo from `dist-skill/`, so `forgecad skill install --core-only` remains available as the simple generated skill path
|
|
110
|
-
- every other public skill from `skills/<skill-name>/`
|
|
111
|
-
|
|
112
|
-
The skill build also writes the website-facing skill docs:
|
|
113
|
-
|
|
114
|
-
- `docs/permanent/skills/index.md`
|
|
115
|
-
- one page per installable skill under `docs/permanent/skills/<skill-name>.md`
|
|
116
|
-
- `src/pages/generatedSkillSections.ts`, which powers the React docs sidebar, index cards, keyboard navigation, and search list
|
|
117
|
-
|
|
118
|
-
Those pages are generated from the same `forgecad-public: true` skill set used for `dist-skill/library/`, so a public companion skill should never be installable without also appearing in the docs.
|
|
119
|
-
|
|
120
|
-
## Adding Dev-Only Docs
|
|
121
|
-
|
|
122
|
-
Use a `skill-group` with a `dev-` prefix (e.g. `dev-compiler`, `dev-solver`, `dev-conventions`). These appear in `SKILL-dev.md` but not in `SKILL.md` or `CONTEXT.md`. Use this for:
|
|
123
|
-
|
|
124
|
-
- Compiler/solver internals
|
|
125
|
-
- Coding conventions and PR guidelines
|
|
126
|
-
- Full CLI reference (vs the slim user-facing docs)
|
|
127
|
-
|
|
128
|
-
## Deciding Standard vs Dev
|
|
129
|
-
|
|
130
|
-
| Question | If yes → |
|
|
131
|
-
|----------|----------|
|
|
132
|
-
| Does a model author need this to build `.forge.js` files? | Standard |
|
|
133
|
-
| Does it describe internal architecture (compiler, solver, pipeline)? | Dev only |
|
|
134
|
-
| Does it cover team process (coding standards, releases, CI)? | Dev only |
|
|
135
|
-
| Is it repo-only developer tooling (`npm run check:suite`, `sdf`, debug flags)? | Dev only |
|
|
136
|
-
|
|
137
|
-
## Orphan files
|
|
138
|
-
|
|
139
|
-
Current `skill install` removes the installed `~/.agents/skills/forgecad/docs/` directory before copying the built docs tree, so normal installs should not leave doc orphans. If a machine used an older installer or files were edited manually, stale copies can still exist and should be deleted.
|
|
140
|
-
|
|
141
|
-
To check for orphans:
|
|
142
|
-
```bash
|
|
143
|
-
for f in $(find ~/.agents/skills/forgecad/docs -name '*.md'); do
|
|
144
|
-
echo "$f" | grep -q '/generated/' && continue
|
|
145
|
-
base=$(echo "$f" | sed "s|$HOME/.agents/skills/forgecad/docs/|docs/permanent/|")
|
|
146
|
-
[ -f "$base" ] || echo "ORPHAN: $f"
|
|
147
|
-
done
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Delete any orphans found. They're stale copies that can mislead agents with outdated information.
|
|
151
|
-
|
|
152
|
-
## Verifying
|
|
153
|
-
|
|
154
|
-
After changes, check that the build succeeds and the doc counts look right:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
npm run refresh
|
|
158
|
-
node dist-cli/forgecad.js skill install --dev # verify dev install
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
The build script prints the number of indexed source files. Verify new docs are counted.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill-group: dev-compiler
|
|
3
|
-
skill-order: 0
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Backend Vocabulary
|
|
7
|
-
|
|
8
|
-
Use Forge terms first. Mention concrete backend implementations only at real implementation boundaries.
|
|
9
|
-
|
|
10
|
-
## Canonical Terms
|
|
11
|
-
|
|
12
|
-
- **Forge semantic intent**: the meaning of a modeling operation in Forge terms.
|
|
13
|
-
- **Compile plan**: the serializable Forge IR that preserves that intent for later lowering.
|
|
14
|
-
- **Backend**: a geometry engine with its own strengths, limits, and implementation details.
|
|
15
|
-
- **Capability**: something a backend can or cannot do for a given flow.
|
|
16
|
-
- **Route**: the centralized decision about which backend path or fallback a scene/object will use.
|
|
17
|
-
- **Implementation boundary**: the narrow place where a concrete backend or adapter is named directly.
|
|
18
|
-
|
|
19
|
-
## Naming Rules
|
|
20
|
-
|
|
21
|
-
- In shared IR, scene routing, and contributor docs, prefer Forge terms such as `compile plan`, `backend`, `capability`, and `route`.
|
|
22
|
-
- Use backend names like `manifold` or `occt` only when the code or doc is truly about that implementation boundary.
|
|
23
|
-
- Use `CadQuery` only when discussing the current Python export executor or other real CadQuery-specific behavior.
|
|
24
|
-
- Use `BREP` and `STEP` for file formats and interchange behavior, not as the primary architecture names for shared compiler layers.
|
|
25
|
-
- Avoid `exact` as a substitute for backend identity. If the real concern is capability, say which capability is required or missing.
|
|
26
|
-
|
|
27
|
-
## Practical Test
|
|
28
|
-
|
|
29
|
-
When naming a shared type or document section, ask:
|
|
30
|
-
|
|
31
|
-
1. Is this describing Forge's meaning?
|
|
32
|
-
2. Is this describing a backend capability?
|
|
33
|
-
3. Or is this describing one backend implementation detail?
|
|
34
|
-
|
|
35
|
-
If the answer is 1 or 2, do not name it after a historical implementation.
|