forgecad 0.9.14 → 0.9.15

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 (219) hide show
  1. package/LICENSE +6 -4
  2. package/README.md +8 -4
  3. package/dist/assets/{AdminPage-eWGs2K6H.js → AdminPage-CDyGUinA.js} +2 -2
  4. package/dist/assets/{BenchmarkPage-CTrLKfpo.js → BenchmarkPage-DfPMY_-d.js} +4 -15
  5. package/dist/assets/{BlogPage-5nPesyds.js → BlogPage-kF0fkdJT.js} +2 -2
  6. package/dist/assets/{DocsPage-C4Y3nbYc.js → DocsPage-B954L3YN.js} +9 -3
  7. package/dist/assets/EditorApp-Beb-IZ0y.js +14014 -0
  8. package/dist/assets/{EditorApp-BAnckbsk.css → EditorApp-CuDLxKqL.css} +698 -0
  9. package/dist/assets/{EmbedViewer-C8fB4n5U.js → EmbedViewer-C77B-TrF.js} +3 -3
  10. package/dist/assets/{LandingPageProofDriven-jSz0LaMM.js → LandingPageProofDriven-Cr6fXMDj.js} +35 -37
  11. package/dist/assets/LegalPage-BRlScr9A.css +91 -0
  12. package/dist/assets/LegalPage-Dzklqmmg.js +39 -0
  13. package/dist/assets/{PricingPage-BMedqFef.css → PricingPage-BPF6HKyO.css} +25 -0
  14. package/dist/assets/{PricingPage-B83B90zh.js → PricingPage-zWXkvlwl.js} +19 -19
  15. package/dist/assets/{SettingsPage-DY889pcu.js → SettingsPage-Bz0of4KQ.js} +2 -2
  16. package/dist/assets/app-CE3sYcV7.css +3890 -0
  17. package/dist/assets/{app-bEww1ic4.js → app-D3kDkggg.js} +2293 -946
  18. package/dist/assets/cli/{render-Cho2uKG_.js → render-DSY3mMQa.js} +337 -7
  19. package/dist/assets/{constructionHistoryWorker-HYwzJY4m.js → constructionHistoryWorker-gpDo-uH2.js} +927 -243
  20. package/dist/assets/{evalWorker-CjQwJSE-.js → evalWorker-CU0Ke6DP.js} +7800 -4164
  21. package/dist/assets/{forgecad_geometry-CH2nvuLA.js → forgecad_geometry-Dgceylq9.js} +43 -1
  22. package/dist/assets/forgecad_geometry_bg-dD4RNQF1.wasm +0 -0
  23. package/dist/assets/{inspectWorker-DeRnMVv1.js → inspectWorker-COyp8XXA.js} +927 -243
  24. package/dist/assets/{javascript-70-4uGcz.js → javascript-1kQXfVaz.js} +1 -1
  25. package/dist/assets/landing-proof-driven-DiGqdtWa.js +18 -0
  26. package/dist/assets/{landing-proof-driven-oFYW6mjz.css → landing-proof-driven-ORyigZ6p.css} +13 -7
  27. package/dist/assets/legalContent-ZfFGMmi4.js +251 -0
  28. package/dist/assets/{manifold-CG9Fokx-.js → manifold-BRI5prcH.js} +1 -1
  29. package/dist/assets/{manifold-uRzgk5O8.js → manifold-C-3h2M7p.js} +2 -2
  30. package/dist/assets/{manifold-rmfAcdwF.js → manifold-DNkrUWpA.js} +1 -1
  31. package/dist/assets/{reportWorker-4cW_ZpoS.js → reportWorker-CdBz5bNg.js} +7538 -10857
  32. package/dist/assets/{scalar-sampling-budget-CfDiFvh7.js → scalar-sampling-budget-wJF98aY9.js} +6935 -4331
  33. package/dist/assets/{scanProxyWorker-Bs2TDgLw.js → scanProxyWorker-B-9VbLIs.js} +32 -1
  34. package/dist/assets/{solver-DuJAO8S6.js → solver-BZ9LPTHs.js} +1 -1
  35. package/dist/assets/solver_bg-DAHZJ_rw.wasm +0 -0
  36. package/dist/assets/{targets-D6PWsv6X.js → targets-B9sGB5nB.js} +1 -1
  37. package/dist/assets/{vendor-react-Da3A2QmU.js → vendor-react-6j1Kke-Y.js} +6 -5
  38. package/dist/cli/render.html +1 -1
  39. package/dist/docs/index.html +2 -2
  40. package/dist/docs-raw/AI/ai-native-cad.md +50 -0
  41. package/dist/docs-raw/AI/usage.md +3 -12
  42. package/dist/docs-raw/CLI.md +30 -10
  43. package/dist/docs-raw/component-model.md +27 -11
  44. package/dist/docs-raw/generated/assembly.md +301 -212
  45. package/dist/docs-raw/generated/concepts.md +235 -237
  46. package/dist/docs-raw/generated/core.md +283 -6
  47. package/dist/docs-raw/generated/curves.md +274 -361
  48. package/dist/docs-raw/generated/lib.md +7 -1
  49. package/dist/docs-raw/generated/output.md +19 -4
  50. package/dist/docs-raw/generated/runtime-names.md +41 -0
  51. package/dist/docs-raw/generated/sdf.md +31 -0
  52. package/dist/docs-raw/generated/sheet-metal.md +9 -0
  53. package/dist/docs-raw/generated/sketch.md +44 -1
  54. package/dist/docs-raw/generated/viewport.md +11 -3
  55. package/dist/docs-raw/guides/coordinate-system.md +20 -16
  56. package/dist/docs-raw/guides/geometry-conventions.md +2 -2
  57. package/dist/docs-raw/guides/inspection-bundles.md +2 -1
  58. package/dist/docs-raw/guides/joint-design.md +24 -0
  59. package/dist/docs-raw/guides/positioning.md +13 -3
  60. package/dist/docs-raw/legal/privacy.md +63 -0
  61. package/dist/docs-raw/legal/software-license.md +55 -0
  62. package/dist/docs-raw/legal/terms.md +87 -0
  63. package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +1 -1
  64. package/dist/docs-raw/skills/forgecad-blockout-model.md +1 -1
  65. package/dist/docs-raw/skills/forgecad-component-model.md +11 -2
  66. package/dist/docs-raw/skills/forgecad-high-level-spec.md +1 -1
  67. package/dist/docs-raw/skills/forgecad-image-replicator.md +8 -8
  68. package/dist/docs-raw/skills/forgecad-lld.md +1 -1
  69. package/dist/docs-raw/skills/forgecad-make-a-model.md +1 -1
  70. package/dist/docs-raw/skills/forgecad-model-grader.md +2 -2
  71. package/dist/docs-raw/skills/forgecad-prepare-prompt.md +2 -2
  72. package/dist/docs-raw/skills/forgecad-project.md +1 -1
  73. package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +1 -1
  74. package/dist/docs-raw/skills/forgecad-render-inspect.md +4 -2
  75. package/dist/docs-raw/skills/forgecad-visual-spec.md +1 -1
  76. package/dist/docs-raw/skills/forgecad.md +4 -3
  77. package/dist/index.html +40 -12
  78. package/dist/llms.txt +8 -0
  79. package/dist/site.webmanifest +1 -1
  80. package/dist/sitemap.xml +49 -13
  81. package/dist-cli/{check-compiler-U5SOPN7X.js → check-compiler-SDX5QIXI.js} +1 -2
  82. package/dist-cli/{check-query-propagation-XOKNSSYU.js → check-query-propagation-EAYEFT77.js} +1 -2
  83. package/dist-cli/{chunk-EXWGNL6K.js → chunk-N4O47JLF.js} +12540 -9046
  84. package/dist-cli/forgecad.js +1786 -679
  85. package/dist-cli/{forgecad_geometry-GYVNKPIE.js → forgecad_geometry-QOQIIP53.js} +42 -1
  86. package/dist-cli/forgecad_geometry_bg.wasm +0 -0
  87. package/dist-cli/{solver-46FFSK2U.js → solver-OK4HECRH.js} +0 -1
  88. package/dist-cli/solver_bg.wasm +0 -0
  89. package/dist-skill/CONTEXT.md +1117 -721
  90. package/dist-skill/SKILL.md +3 -2
  91. package/dist-skill/docs/API/core/concepts.md +64 -1
  92. package/dist-skill/docs/CLI.md +30 -10
  93. package/dist-skill/docs/generated/assembly.md +277 -229
  94. package/dist-skill/docs/generated/core.md +283 -6
  95. package/dist-skill/docs/generated/curves.md +272 -362
  96. package/dist-skill/docs/generated/lib.md +7 -1
  97. package/dist-skill/docs/generated/output.md +19 -4
  98. package/dist-skill/docs/generated/runtime-names.md +41 -0
  99. package/dist-skill/docs/generated/sdf.md +31 -0
  100. package/dist-skill/docs/generated/sheet-metal.md +9 -0
  101. package/dist-skill/docs/generated/sketch.md +44 -2
  102. package/dist-skill/docs/generated/viewport.md +2 -87
  103. package/dist-skill/docs/guides/coordinate-system.md +20 -16
  104. package/dist-skill/docs/guides/geometry-conventions.md +2 -2
  105. package/dist-skill/docs/guides/inspection-bundles.md +2 -1
  106. package/dist-skill/docs/guides/joint-design.md +24 -0
  107. package/dist-skill/docs/guides/positioning.md +13 -3
  108. package/dist-skill/library/forgecad-component-model/SKILL.md +10 -1
  109. package/dist-skill/library/forgecad-image-replicator/SKILL.md +6 -6
  110. package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.py +166 -0
  111. package/dist-skill/library/forgecad-model-grader/SKILL.md +1 -1
  112. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +1 -1
  113. package/dist-skill/library/forgecad-render-inspect/SKILL.md +3 -1
  114. package/examples/api/assembly-kinematics-foundation.forge.js +65 -0
  115. package/examples/api/assembly-kinematics-four-bar.forge.js +115 -0
  116. package/examples/api/assembly-kinematics-limb.forge.js +116 -0
  117. package/examples/api/connector-frame-rig-chain.forge.js +102 -0
  118. package/examples/api/exact-sheet-shell-assembly.forge.js +0 -2
  119. package/examples/api/exact-surface-studio.forge.js +6 -8
  120. package/examples/api/helix-basics.forge.js +6 -6
  121. package/examples/api/lean-foundations/README.md +12 -0
  122. package/examples/api/lean-foundations/curve-blend-exact.forge.js +22 -0
  123. package/examples/api/lean-foundations/curve-fit-interpolation.forge.js +18 -0
  124. package/examples/api/lean-foundations/curve-helix-canonicalization.forge.js +27 -0
  125. package/examples/api/lean-foundations/curve-route-canonicalization.forge.js +16 -0
  126. package/examples/api/lean-foundations/curve-trim-reverse.forge.js +24 -0
  127. package/examples/api/lean-foundations/exact-curve-arc.forge.js +36 -0
  128. package/examples/api/mixed-edge-finishes-proof.forge.js +8 -11
  129. package/examples/api/route3d-elbow.forge.js +68 -0
  130. package/examples/api/transition-curves.forge.js +44 -15
  131. package/examples/api/y-blend-corner-showcase.forge.js +0 -2
  132. package/examples/generative/coral-vase.forge.js +1 -1
  133. package/examples/nurbs-tube.forge.js +1 -1
  134. package/package.json +14 -13
  135. package/dist/assets/EditorApp-lXv53A1m.js +0 -13610
  136. package/dist/assets/app-CsHnaBWt.css +0 -1789
  137. package/dist/assets/forgecad_geometry_bg-C5_E9Oa9.wasm +0 -0
  138. package/dist/assets/solver_bg-CWvv4lnN.wasm +0 -0
  139. package/dist/docs-raw/API/README.md +0 -16
  140. package/dist/docs-raw/API/core/concepts.md +0 -118
  141. package/dist/docs-raw/INDEX.md +0 -138
  142. package/dist/docs-raw/RELEASING.md +0 -87
  143. package/dist/docs-raw/agent-native-api.md +0 -27
  144. package/dist/docs-raw/beta-deployment.md +0 -304
  145. package/dist/docs-raw/beta-operations.md +0 -325
  146. package/dist/docs-raw/blueprint-first.md +0 -145
  147. package/dist/docs-raw/cli-monetization.md +0 -112
  148. package/dist/docs-raw/coding-best-practices.md +0 -120
  149. package/dist/docs-raw/coding.md +0 -340
  150. package/dist/docs-raw/deployment.md +0 -374
  151. package/dist/docs-raw/guides/skill-maintenance.md +0 -161
  152. package/dist/docs-raw/guides/surface-members.md +0 -82
  153. package/dist/docs-raw/harbor-cli.md +0 -854
  154. package/dist/docs-raw/internals/backend-vocabulary.md +0 -35
  155. package/dist/docs-raw/internals/compiler.md +0 -307
  156. package/dist/docs-raw/internals/constraint-solver-quality.md +0 -161
  157. package/dist/docs-raw/internals/constraint-solver.md +0 -176
  158. package/dist/docs-raw/internals/shape-from-slices.md +0 -152
  159. package/dist/docs-raw/internals/sketch-2d-pipeline.md +0 -108
  160. package/dist/docs-raw/platform/admin.md +0 -45
  161. package/dist/docs-raw/platform/architecture.md +0 -82
  162. package/dist/docs-raw/platform/auth.md +0 -139
  163. package/dist/docs-raw/platform/email.md +0 -67
  164. package/dist/docs-raw/platform/google-oauth-setup.md +0 -88
  165. package/dist/docs-raw/platform/observability.md +0 -197
  166. package/dist/docs-raw/platform/projects.md +0 -111
  167. package/dist/docs-raw/platform/sharing.md +0 -90
  168. package/dist/docs-raw/product/README.md +0 -39
  169. package/dist/docs-raw/product/api-as-product-language.md +0 -13
  170. package/dist/docs-raw/product/business-model.md +0 -15
  171. package/dist/docs-raw/product/competitive-positioning.md +0 -17
  172. package/dist/docs-raw/product/creative-manufacturing.md +0 -15
  173. package/dist/docs-raw/product/founder-story.md +0 -11
  174. package/dist/docs-raw/product/manufacturing-workflows.md +0 -15
  175. package/dist/docs-raw/product/onboarding-first-experience.md +0 -256
  176. package/dist/docs-raw/product/product-loop.md +0 -17
  177. package/dist/docs-raw/product/strategic-decisions.md +0 -22
  178. package/dist/docs-raw/product/user-outreach-email-templates.md +0 -161
  179. package/dist/docs-raw/product/user-segments.md +0 -15
  180. package/dist/docs-raw/product/vision.md +0 -26
  181. package/dist/docs-raw/rl-environments.md +0 -350
  182. package/dist/docs-raw/runbook.md +0 -611
  183. package/dist-cli/check-compiler-U5SOPN7X.js.map +0 -1
  184. package/dist-cli/check-query-propagation-XOKNSSYU.js.map +0 -1
  185. package/dist-cli/chunk-EXWGNL6K.js.map +0 -1
  186. package/dist-cli/forgecad.js.map +0 -1
  187. package/dist-cli/forgecad_geometry-GYVNKPIE.js.map +0 -1
  188. package/dist-cli/solver-46FFSK2U.js.map +0 -1
  189. package/dist-skill/SKILL-dev.md +0 -145
  190. package/dist-skill/docs-dev/API/core/concepts.md +0 -118
  191. package/dist-skill/docs-dev/CLI.md +0 -677
  192. package/dist-skill/docs-dev/agent-native-api.md +0 -27
  193. package/dist-skill/docs-dev/blueprint-first.md +0 -145
  194. package/dist-skill/docs-dev/coding-best-practices.md +0 -120
  195. package/dist-skill/docs-dev/coding.md +0 -340
  196. package/dist-skill/docs-dev/component-model.md +0 -164
  197. package/dist-skill/docs-dev/generated/assembly.md +0 -794
  198. package/dist-skill/docs-dev/generated/core.md +0 -2117
  199. package/dist-skill/docs-dev/generated/curves.md +0 -2583
  200. package/dist-skill/docs-dev/generated/lib.md +0 -169
  201. package/dist-skill/docs-dev/generated/output.md +0 -247
  202. package/dist-skill/docs-dev/generated/sdf.md +0 -446
  203. package/dist-skill/docs-dev/generated/sheet-metal.md +0 -504
  204. package/dist-skill/docs-dev/generated/sketch.md +0 -1811
  205. package/dist-skill/docs-dev/generated/viewport.md +0 -585
  206. package/dist-skill/docs-dev/generated/wood.md +0 -108
  207. package/dist-skill/docs-dev/guides/coordinate-system.md +0 -46
  208. package/dist-skill/docs-dev/guides/geometry-conventions.md +0 -52
  209. package/dist-skill/docs-dev/guides/inspection-bundles.md +0 -485
  210. package/dist-skill/docs-dev/guides/joint-design.md +0 -78
  211. package/dist-skill/docs-dev/guides/modeling-recipes.md +0 -78
  212. package/dist-skill/docs-dev/guides/positioning.md +0 -161
  213. package/dist-skill/docs-dev/guides/skill-maintenance.md +0 -161
  214. package/dist-skill/docs-dev/internals/backend-vocabulary.md +0 -35
  215. package/dist-skill/docs-dev/internals/compiler.md +0 -307
  216. package/dist-skill/docs-dev/internals/constraint-solver-quality.md +0 -161
  217. package/dist-skill/docs-dev/internals/constraint-solver.md +0 -176
  218. package/dist-skill/docs-dev/internals/sketch-2d-pipeline.md +0 -108
  219. package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.mjs +0 -289
@@ -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.