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.
Files changed (239) hide show
  1. package/LICENSE +6 -4
  2. package/README.md +8 -4
  3. package/dist/assets/{AdminPage-eWGs2K6H.js → AdminPage-CXvls4-J.js} +2 -2
  4. package/dist/assets/{BenchmarkPage-CTrLKfpo.js → BenchmarkPage-B27zk8xL.js} +4 -15
  5. package/dist/assets/{BlogPage-5nPesyds.js → BlogPage-CMAVvgQL.js} +2 -2
  6. package/dist/assets/{DocsPage-C4Y3nbYc.js → DocsPage-knf4I4h7.js} +9 -3
  7. package/dist/assets/EditorApp-BHMQlJ-D.js +14686 -0
  8. package/dist/assets/{EditorApp-BAnckbsk.css → EditorApp-BpjZgzk0.css} +846 -0
  9. package/dist/assets/{EmbedViewer-C8fB4n5U.js → EmbedViewer-D7ZGlFjx.js} +3 -3
  10. package/dist/assets/{LandingPageProofDriven-jSz0LaMM.js → LandingPageProofDriven-CnevhTE8.js} +36 -38
  11. package/dist/assets/LegalPage-BPTUmqeg.js +39 -0
  12. package/dist/assets/LegalPage-BRlScr9A.css +91 -0
  13. package/dist/assets/{PricingPage-B83B90zh.js → PricingPage-B0D4goG_.js} +19 -19
  14. package/dist/assets/{PricingPage-BMedqFef.css → PricingPage-BPF6HKyO.css} +25 -0
  15. package/dist/assets/{SettingsPage-DY889pcu.js → SettingsPage-CFF-UgjI.js} +2 -2
  16. package/dist/assets/app-CE3sYcV7.css +3890 -0
  17. package/dist/assets/{app-bEww1ic4.js → app-T0pDcSX4.js} +3382 -1069
  18. package/dist/assets/cli/{render-Cho2uKG_.js → render-C5pcIISc.js} +477 -29
  19. package/dist/assets/{constructionHistoryWorker-HYwzJY4m.js → constructionHistoryWorker-Ba2Hm58b.js} +928 -243
  20. package/dist/assets/{evalWorker-CjQwJSE-.js → evalWorker-vkx310U2.js} +8883 -6040
  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-BuTJDVX6.js} +1179 -273
  24. package/dist/assets/{javascript-70-4uGcz.js → javascript-1kQXfVaz.js} +1 -1
  25. package/dist/assets/{targets-D6PWsv6X.js → jointPose-B_Cgedn9.js} +71 -3
  26. package/dist/assets/landing-proof-driven-DiGqdtWa.js +18 -0
  27. package/dist/assets/{landing-proof-driven-oFYW6mjz.css → landing-proof-driven-ORyigZ6p.css} +13 -7
  28. package/dist/assets/legalContent-ZfFGMmi4.js +251 -0
  29. package/dist/assets/{manifold-rmfAcdwF.js → manifold-BWgsjmAM.js} +1 -1
  30. package/dist/assets/{manifold-uRzgk5O8.js → manifold-D6IFSkhH.js} +2 -2
  31. package/dist/assets/{manifold-CG9Fokx-.js → manifold-rZexZI0G.js} +1 -1
  32. package/dist/assets/{reportWorker-4cW_ZpoS.js → reportWorker-0AGij1Ru.js} +8659 -12771
  33. package/dist/assets/{scalar-sampling-budget-CfDiFvh7.js → scalar-sampling-budget-J5cuzxT1.js} +8050 -6203
  34. package/dist/assets/{scanProxyWorker-Bs2TDgLw.js → scanProxyWorker-Vl4Wxa1y.js} +50 -6
  35. package/dist/assets/{solver-DuJAO8S6.js → solver-BZ9LPTHs.js} +1 -1
  36. package/dist/assets/solver_bg-DAHZJ_rw.wasm +0 -0
  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 +5 -12
  42. package/dist/docs-raw/CLI.md +34 -10
  43. package/dist/docs-raw/component-model.md +27 -11
  44. package/dist/docs-raw/generated/assembly.md +374 -187
  45. package/dist/docs-raw/generated/concepts.md +245 -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 +9 -19
  49. package/dist/docs-raw/generated/output.md +29 -4
  50. package/dist/docs-raw/generated/runtime-names.md +49 -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 +40 -39
  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 +3 -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/docs-raw/welcome.md +2 -0
  78. package/dist/index.html +40 -12
  79. package/dist/llms.txt +8 -0
  80. package/dist/site.webmanifest +1 -1
  81. package/dist/sitemap.xml +49 -13
  82. package/dist-cli/{check-compiler-U5SOPN7X.js → check-compiler-SYQ2PWOB.js} +1 -2
  83. package/dist-cli/{check-query-propagation-XOKNSSYU.js → check-query-propagation-HIAGV62W.js} +1 -2
  84. package/dist-cli/{chunk-EXWGNL6K.js → chunk-SPZE3DUY.js} +20659 -17930
  85. package/dist-cli/forgecad.js +3568 -1250
  86. package/dist-cli/{forgecad_geometry-GYVNKPIE.js → forgecad_geometry-QOQIIP53.js} +42 -1
  87. package/dist-cli/forgecad_geometry_bg.wasm +0 -0
  88. package/dist-cli/{solver-46FFSK2U.js → solver-OK4HECRH.js} +0 -1
  89. package/dist-cli/solver_bg.wasm +0 -0
  90. package/dist-skill/CONTEXT.md +1192 -725
  91. package/dist-skill/SKILL.md +3 -2
  92. package/dist-skill/docs/API/core/concepts.md +64 -1
  93. package/dist-skill/docs/CLI.md +34 -10
  94. package/dist-skill/docs/generated/assembly.md +339 -213
  95. package/dist-skill/docs/generated/core.md +283 -6
  96. package/dist-skill/docs/generated/curves.md +272 -362
  97. package/dist-skill/docs/generated/lib.md +9 -19
  98. package/dist-skill/docs/generated/output.md +29 -4
  99. package/dist-skill/docs/generated/runtime-names.md +40 -0
  100. package/dist-skill/docs/generated/sdf.md +31 -0
  101. package/dist-skill/docs/generated/sheet-metal.md +9 -0
  102. package/dist-skill/docs/generated/sketch.md +44 -2
  103. package/dist-skill/docs/generated/viewport.md +2 -87
  104. package/dist-skill/docs/guides/coordinate-system.md +20 -16
  105. package/dist-skill/docs/guides/geometry-conventions.md +2 -2
  106. package/dist-skill/docs/guides/inspection-bundles.md +2 -1
  107. package/dist-skill/docs/guides/joint-design.md +24 -0
  108. package/dist-skill/docs/guides/positioning.md +13 -3
  109. package/dist-skill/library/forgecad-component-model/SKILL.md +10 -1
  110. package/dist-skill/library/forgecad-image-replicator/SKILL.md +6 -6
  111. package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.py +166 -0
  112. package/dist-skill/library/forgecad-make-a-model/SKILL.md +39 -38
  113. package/dist-skill/library/forgecad-model-grader/SKILL.md +1 -1
  114. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +1 -1
  115. package/dist-skill/library/forgecad-project/SKILL.md +2 -0
  116. package/dist-skill/library/forgecad-render-inspect/SKILL.md +3 -1
  117. package/examples/api/assembly-kinematics-foundation.forge.js +65 -0
  118. package/examples/api/assembly-kinematics-four-bar.forge.js +115 -0
  119. package/examples/api/assembly-kinematics-limb.forge.js +116 -0
  120. package/examples/api/connector-frame-rig-chain.forge.js +102 -0
  121. package/examples/api/exact-sheet-shell-assembly.forge.js +0 -2
  122. package/examples/api/exact-surface-studio.forge.js +6 -8
  123. package/examples/api/helix-basics.forge.js +8 -8
  124. package/examples/api/lean-foundations/README.md +12 -0
  125. package/examples/api/lean-foundations/curve-blend-exact.forge.js +22 -0
  126. package/examples/api/lean-foundations/curve-fit-interpolation.forge.js +18 -0
  127. package/examples/api/lean-foundations/curve-helix-canonicalization.forge.js +27 -0
  128. package/examples/api/lean-foundations/curve-route-canonicalization.forge.js +16 -0
  129. package/examples/api/lean-foundations/curve-trim-reverse.forge.js +24 -0
  130. package/examples/api/lean-foundations/exact-curve-arc.forge.js +36 -0
  131. package/examples/api/mixed-edge-finishes-proof.forge.js +8 -11
  132. package/examples/api/route3d-elbow.forge.js +71 -0
  133. package/examples/api/transition-curves.forge.js +44 -15
  134. package/examples/api/variable-sweep-test.forge.js +3 -1
  135. package/examples/api/y-blend-corner-showcase.forge.js +0 -2
  136. package/examples/generative/coral-vase.forge.js +1 -1
  137. package/examples/nurbs-tube.forge.js +1 -1
  138. package/package.json +17 -13
  139. package/dist/assets/EditorApp-lXv53A1m.js +0 -13610
  140. package/dist/assets/app-CsHnaBWt.css +0 -1789
  141. package/dist/assets/forgecad_geometry_bg-C5_E9Oa9.wasm +0 -0
  142. package/dist/assets/solver_bg-CWvv4lnN.wasm +0 -0
  143. package/dist/docs-raw/API/README.md +0 -16
  144. package/dist/docs-raw/API/core/concepts.md +0 -118
  145. package/dist/docs-raw/INDEX.md +0 -138
  146. package/dist/docs-raw/RELEASING.md +0 -87
  147. package/dist/docs-raw/agent-native-api.md +0 -27
  148. package/dist/docs-raw/beta-deployment.md +0 -304
  149. package/dist/docs-raw/beta-operations.md +0 -325
  150. package/dist/docs-raw/blueprint-first.md +0 -145
  151. package/dist/docs-raw/cli-monetization.md +0 -112
  152. package/dist/docs-raw/coding-best-practices.md +0 -120
  153. package/dist/docs-raw/coding.md +0 -340
  154. package/dist/docs-raw/deployment.md +0 -374
  155. package/dist/docs-raw/guides/skill-maintenance.md +0 -161
  156. package/dist/docs-raw/guides/surface-members.md +0 -82
  157. package/dist/docs-raw/harbor-cli.md +0 -854
  158. package/dist/docs-raw/internals/backend-vocabulary.md +0 -35
  159. package/dist/docs-raw/internals/compiler.md +0 -307
  160. package/dist/docs-raw/internals/constraint-solver-quality.md +0 -161
  161. package/dist/docs-raw/internals/constraint-solver.md +0 -176
  162. package/dist/docs-raw/internals/shape-from-slices.md +0 -152
  163. package/dist/docs-raw/internals/sketch-2d-pipeline.md +0 -108
  164. package/dist/docs-raw/platform/admin.md +0 -45
  165. package/dist/docs-raw/platform/architecture.md +0 -82
  166. package/dist/docs-raw/platform/auth.md +0 -139
  167. package/dist/docs-raw/platform/email.md +0 -67
  168. package/dist/docs-raw/platform/google-oauth-setup.md +0 -88
  169. package/dist/docs-raw/platform/observability.md +0 -197
  170. package/dist/docs-raw/platform/projects.md +0 -111
  171. package/dist/docs-raw/platform/sharing.md +0 -90
  172. package/dist/docs-raw/product/README.md +0 -39
  173. package/dist/docs-raw/product/api-as-product-language.md +0 -13
  174. package/dist/docs-raw/product/business-model.md +0 -15
  175. package/dist/docs-raw/product/competitive-positioning.md +0 -17
  176. package/dist/docs-raw/product/creative-manufacturing.md +0 -15
  177. package/dist/docs-raw/product/founder-story.md +0 -11
  178. package/dist/docs-raw/product/manufacturing-workflows.md +0 -15
  179. package/dist/docs-raw/product/onboarding-first-experience.md +0 -256
  180. package/dist/docs-raw/product/product-loop.md +0 -17
  181. package/dist/docs-raw/product/strategic-decisions.md +0 -22
  182. package/dist/docs-raw/product/user-outreach-email-templates.md +0 -161
  183. package/dist/docs-raw/product/user-segments.md +0 -15
  184. package/dist/docs-raw/product/vision.md +0 -26
  185. package/dist/docs-raw/rl-environments.md +0 -350
  186. package/dist/docs-raw/runbook.md +0 -611
  187. package/dist-cli/check-compiler-U5SOPN7X.js.map +0 -1
  188. package/dist-cli/check-query-propagation-XOKNSSYU.js.map +0 -1
  189. package/dist-cli/chunk-EXWGNL6K.js.map +0 -1
  190. package/dist-cli/forgecad.js.map +0 -1
  191. package/dist-cli/forgecad_geometry-GYVNKPIE.js.map +0 -1
  192. package/dist-cli/solver-46FFSK2U.js.map +0 -1
  193. package/dist-skill/SKILL-dev.md +0 -145
  194. package/dist-skill/docs-dev/API/core/concepts.md +0 -118
  195. package/dist-skill/docs-dev/CLI.md +0 -677
  196. package/dist-skill/docs-dev/agent-native-api.md +0 -27
  197. package/dist-skill/docs-dev/blueprint-first.md +0 -145
  198. package/dist-skill/docs-dev/coding-best-practices.md +0 -120
  199. package/dist-skill/docs-dev/coding.md +0 -340
  200. package/dist-skill/docs-dev/component-model.md +0 -164
  201. package/dist-skill/docs-dev/generated/assembly.md +0 -794
  202. package/dist-skill/docs-dev/generated/core.md +0 -2117
  203. package/dist-skill/docs-dev/generated/curves.md +0 -2583
  204. package/dist-skill/docs-dev/generated/lib.md +0 -169
  205. package/dist-skill/docs-dev/generated/output.md +0 -247
  206. package/dist-skill/docs-dev/generated/sdf.md +0 -446
  207. package/dist-skill/docs-dev/generated/sheet-metal.md +0 -504
  208. package/dist-skill/docs-dev/generated/sketch.md +0 -1811
  209. package/dist-skill/docs-dev/generated/viewport.md +0 -585
  210. package/dist-skill/docs-dev/generated/wood.md +0 -108
  211. package/dist-skill/docs-dev/guides/coordinate-system.md +0 -46
  212. package/dist-skill/docs-dev/guides/geometry-conventions.md +0 -52
  213. package/dist-skill/docs-dev/guides/inspection-bundles.md +0 -485
  214. package/dist-skill/docs-dev/guides/joint-design.md +0 -78
  215. package/dist-skill/docs-dev/guides/modeling-recipes.md +0 -78
  216. package/dist-skill/docs-dev/guides/positioning.md +0 -161
  217. package/dist-skill/docs-dev/guides/skill-maintenance.md +0 -161
  218. package/dist-skill/docs-dev/internals/backend-vocabulary.md +0 -35
  219. package/dist-skill/docs-dev/internals/compiler.md +0 -307
  220. package/dist-skill/docs-dev/internals/constraint-solver-quality.md +0 -161
  221. package/dist-skill/docs-dev/internals/constraint-solver.md +0 -176
  222. package/dist-skill/docs-dev/internals/sketch-2d-pipeline.md +0 -108
  223. package/dist-skill/library/forgecad-image-replicator/scripts/compare_images.mjs +0 -289
  224. package/examples/api/bolted-service-cover.forge.js +0 -17
  225. package/examples/api/cable-gland-anchor.forge.js +0 -14
  226. package/examples/api/captured-cartridge-guide.forge.js +0 -14
  227. package/examples/api/captured-linear-slide.forge.js +0 -13
  228. package/examples/api/clevis-pin-joint.forge.js +0 -13
  229. package/examples/api/datum-enclosure.forge.js +0 -16
  230. package/examples/api/hose-barb-port.forge.js +0 -14
  231. package/examples/api/knuckled-hinge-assembly.forge.js +0 -15
  232. package/examples/api/living-hinge-cover.forge.js +0 -14
  233. package/examples/api/pcb-terminal-block.forge.js +0 -22
  234. package/examples/api/pinned-lever-pivot-stack.forge.js +0 -14
  235. package/examples/api/retained-shaft-knob-stack.forge.js +0 -15
  236. package/examples/api/routed-tube-clip.forge.js +0 -15
  237. package/examples/api/seated-bearing-stack.forge.js +0 -30
  238. package/examples/api/snap-latch-cover.forge.js +0 -14
  239. package/examples/api/thumb-screw-clamp.forge.js +0 -15
@@ -1,145 +0,0 @@
1
- ---
2
- skill-group: dev-conventions
3
- skill-order: 3
4
- ---
5
-
6
- # Blueprint-First Philosophy
7
-
8
- ## Code Should Read Like a Mechanical Blueprint
9
-
10
- ForgeCAD is a **mechanical compiler**. The user inputs design intent — dimensions, constraints, relationships — and the engine handles the geometry. If a mechanical feature can be dimensioned on a 2D drawing without explicit X/Y coordinates, a user should be able to model it in ForgeCAD without calculating those coordinates.
11
-
12
- We are building a geometry engine, not a math test.
13
-
14
- ## The Trigonometry Tax
15
-
16
- Every time a user writes `Math.sin()` or `Math.cos()` to place a bolt hole, position a circular pattern, or compute a tangent point, our API has failed them. This is the **Trigonometry Tax** — the cost of translating declarative engineering intent into imperative Cartesian math.
17
-
18
- The tax is real and measurable. In our own example library, ~40 of 250+ files contain manual trig. The same patterns repeat: circular positioning, polygon vertex layout, rotation result computation, polar-to-cartesian conversion. Each one is a place where the API should have provided an abstraction but didn't.
19
-
20
- ## The Core Pillars
21
-
22
- ### Pillar I: Intent-Driven Constraints over Explicit Coordinates
23
-
24
- Traditional CAD-as-code requires calculating exact center points and intersections. ForgeCAD uses **constraint-driven pathing** — users define the knowns (radii, angles, distances), and the solver calculates the implicit intersections.
25
-
26
- ```javascript
27
- // The old way — calculating tangent arc intercepts by hand
28
- const cx = r1 * Math.cos(angle) + offset * Math.sin(angle);
29
- const cy = r1 * Math.sin(angle) - offset * Math.cos(angle);
30
-
31
- // The ForgeCAD way — declare intent, solver handles geometry
32
- sketch.route([
33
- { tangent: circleA },
34
- { fillet: 17 },
35
- { tangent: circleB },
36
- ]);
37
- ```
38
-
39
- ### Pillar II: Topological Selection
40
-
41
- Hardcoding vertex indices or exact 3D coordinates to apply fillets makes models brittle. If a base dimension changes, the coordinates change, and the build breaks. ForgeCAD borrows from the DOM: **select geometry via topological queries, not hardcoded indices.**
42
-
43
- ```javascript
44
- // Brittle — breaks if topology changes
45
- body.fillet(5, edgeIndex[14]);
46
-
47
- // ForgeCAD — semantic edge selection
48
- fillet(body, 5, { parallel: [0, 0, 1], convex: true });
49
- fillet(body, 3, selectEdges(body, { atZ: 0 }));
50
- ```
51
-
52
- ### Pillar III: Mechanical First-Class Citizens
53
-
54
- Primitives should not be limited to circles, rectangles, and polygons. Mechanical engineering relies on standard features that are tedious to build from scratch. If a machinist has a specific tool bit for it, the API should have a specific primitive for it.
55
-
56
- ```javascript
57
- // Holes with real mechanical features — not raw boolean subtraction
58
- shape.hole('top', { diameter: 11, depth: 20,
59
- counterbore: { diameter: 18, depth: 5 },
60
- thread: { designation: 'M10' },
61
- });
62
-
63
- // Standard mechanical profiles
64
- slot(30, 10);
65
- arcSlot({ pitchRadius: 50, sweep: 60, width: 12 });
66
- lib.spurGear({ module: 2, teeth: 24 });
67
- ```
68
-
69
- ### Pillar IV: Relative Workplanes
70
-
71
- Everything in mechanical design is relative. You don't drill a hole at `[15.5, 30.2, 100.0]` in global space. You drill a hole on the top face of the flange, centered on the lug. The API must support dynamic coordinate systems that attach to existing geometry.
72
-
73
- ```javascript
74
- // Global coordinates — fragile, unreadable
75
- const hole = circle2d(5).extrude(20).translate(15.5, 30.2, 100.0);
76
-
77
- // Relative to geometry — moves with the parent
78
- circle2d(5).onFace(flange, 'top', { u: 10, v: 0 }).extrude(-20);
79
- ```
80
-
81
- ### Pillar V: No Manual Math for Standard Layout
82
-
83
- If a user has to import `Math.sin` to place elements in a circle, compute `Math.sqrt(3)` for an equilateral triangle, or manually convert degrees to radians, our API has a gap. Standard layout operations are first-class:
84
-
85
- ```javascript
86
- // Circular layout — no trig
87
- const positions = circularLayout(12, radius);
88
-
89
- // Polygon vertex positions — no sqrt(3)
90
- const vertices = polygonVertices(3, radius);
91
-
92
- // Polar positioning — no sin/cos
93
- shape.translatePolar(radius, angleDeg);
94
- ```
95
-
96
- ## The Anti-Patterns
97
-
98
- ### 1. No sin/cos in user code for standard layout
99
- If a user imports `Math.sin` to place a bolt hole, we have a missing abstraction. We provide polar coordinates, patterns, and layout helpers natively.
100
-
101
- ### 2. No magic shrinkwraps without explicit control
102
- Connections between shapes must be explicit. "Connect Shape A to Shape B with a tangent arc of R15" — not a black-box convex hull that guesses intent.
103
-
104
- ### 3. No silent failures
105
- If a fillet radius is too large, or a tangent route can't be solved, the API throws a descriptive mechanical error — not a generic engine crash. (See also: CLAUDE.md "No Silent Fallbacks" rule.)
106
-
107
- ### 4. No coordinate math for relative positioning
108
- If a feature is defined relative to another feature (a hole on a face, a boss centered on a lug), the API must express that relationship directly — not force the user to compute the absolute position.
109
-
110
- ## Design Gate
111
-
112
- **Every new public API method must pass this test:**
113
-
114
- > Can the user accomplish this without `Math.sin`, `Math.cos`, `Math.atan2`, manual degree-to-radian conversion, or computing intermediate Cartesian coordinates from polar/angular intent?
115
-
116
- If the answer is no, the API needs a higher-level alternative. The raw math path can still exist for power users, but the common case must be trig-free.
117
-
118
- ## Ergonomics in JavaScript
119
-
120
- JavaScript lacks Python's `with` statement, so ForgeCAD relies on **method chaining** and **callback scopes** for clean, fluid modeling:
121
-
122
- ```javascript
123
- // Fluid chaining — sketch to solid to features
124
- const part = circle2d(50)
125
- .extrude(15)
126
- .fillet(5, { atZ: 0 });
127
-
128
- // Callback workplane — scoped 2D ops on a 3D face
129
- shape.onFace('top', (face) => {
130
- face.subtract(
131
- circularPattern(circle2d(5.5), 6, { radius: 32.5 })
132
- );
133
- });
134
- ```
135
-
136
- ## Architecture Constraints
137
-
138
- - **TypeScript native.** Autocomplete and compile-time checking for mechanical parameters are mandatory.
139
- - **B-Rep capable.** Topological naming and precise filleting require a real CAD kernel (Manifold for mesh, OCCT for B-Rep).
140
- - **Immutable geometry, mutable builders.** Underlying geometry is immutable for predictable undo/redo. Builder classes maintain state for ergonomic chaining.
141
- - **Degrees at the API boundary.** All user-facing angles are in degrees. Radians are an internal implementation detail.
142
-
143
- ## Summary
144
-
145
- We are not building a 3D drawing tool. We are building a **mechanical compiler**. The user inputs the blueprint's design intent, and our API handles the geometry.
@@ -1,112 +0,0 @@
1
- # CLI Monetization Strategy
2
-
3
- ## The Model: Sublime Text Now, Cursor Later
4
-
5
- ForgeCAD follows a phased monetization strategy informed by how real software companies make money — not by how they try to prevent piracy.
6
-
7
- ### Phase 1: Honor System (Now)
8
-
9
- Ship a compiled binary with a local license gate. Production export commands stay free and show a clear commercial-use message; Pro-only render/capture commands show a clear upgrade message.
10
-
11
- **Why this works:**
12
- - Sublime Text makes $5-25M/year with zero enforcement (nag popup only)
13
- - WinRAR makes $20-40M/year with zero enforcement (40-day trial that never expires)
14
- - JetBrains makes $593M/year despite being cracked constantly
15
- - The pattern: individuals who crack it weren't going to pay. Enterprises must pay (legal compliance, audit risk, IT procurement). Pirates who learn ForgeCAD become advocates inside companies that buy licenses.
16
-
17
- **What we ship:**
18
- - Compiled native binary via `bun build --compile --minify` (source not trivially readable)
19
- - Local JWT license validation at `~/.forgecad/license.json`
20
- - Production outputs marked with commercial-use guidance, not blocked
21
- - Pro-only render/capture commands blocked with helpful message + free alternatives
22
- - `forgecad license activate/deactivate/status` commands
23
-
24
- **What we accept:**
25
- - A developer can bypass the local check in 30 minutes
26
- - String literals (error messages, API names) are visible via `strings`
27
- - This is fine. The gate converts honest users; it doesn't stop determined pirates.
28
-
29
- ### Phase 2: Enterprise Features (Soon)
30
-
31
- Add features that enterprises need and individuals don't care about:
32
- - License server (floating seats, team management, usage reporting)
33
- - Audit log (who exported what, when)
34
- - SSO/SAML integration
35
- - Priority support channel
36
-
37
- These features don't need anti-piracy because they're inherently organizational. A solo developer doesn't need a license server.
38
-
39
- ### Phase 3: Server-Side Pro Features (Later)
40
-
41
- Move high-value compute to run on the ForgeCAD server after the security model is ready. The CLI uploads the model, the server processes it, the CLI downloads the result.
42
-
43
- **Why this is piracy-proof:** The code for server-only rendering, optimization, and future compute-heavy workflows never ships to the user. You can't crack what you don't have.
44
-
45
- **Proven by:**
46
- - Cursor: $2B ARR — the editor is free, AI calls are server-side
47
- - Figma: $1B revenue — all rendering is server-side
48
- - Onshape: acquired for $470M — 100% browser-based, nothing local to crack
49
-
50
- ## Feature Tiers
51
-
52
- | Tier | Price | Features |
53
- |------|-------|----------|
54
- | **Free** | $0 | Editor, dev server, run scripts, render PNG, exports including STEP/BREP/report/layout, all checks, debug tools |
55
- | **Pro** | $15-25/mo | Commercial coverage, render-hq (Blender), capture GIF/MP4, 500 MB cloud storage, support for production workflows |
56
- | **Team** | $40-60/seat/mo | Everything in Pro + license server, floating seats, audit log, SSO, priority support |
57
-
58
- ### Why this split?
59
-
60
- **Free tier** includes everything needed to learn ForgeCAD, build models, export files, and 3D print. This is the funnel — hobbyists, students, and evaluators use this. It's genuinely useful, not a crippled demo.
61
-
62
- **Pro tier** covers the work professionals need to pay for: client work, employer work, funded projects, products for sale, closed commercial IP, larger hosted storage, support, and Pro-only render/capture tools. Exact and manufacturing exports remain free actions with production/commercial reminders.
63
-
64
- **Team tier** gates organizational features that individuals don't need.
65
-
66
- ## What NOT to Do
67
-
68
- ### Don't rewrite in a compiled language for code protection
69
- SolidWorks is C++ and it's cracked (SolidSquad). AutoCAD is C++ and it's cracked. The language doesn't matter — Ghidra/IDA Pro can reverse-engineer any native binary. The cost (rewriting years of work, losing the JS API that makes ForgeCAD special) far outweighs the marginal protection gain.
70
-
71
- ### Don't add aggressive DRM
72
- Dassault embeds forensic signatures in SolidWorks files and sues pirates — this generates "many millions" in settlements but also generates resentment. For a small product trying to build a community, aggressive enforcement is counterproductive.
73
-
74
- ### Don't make the free tier useless
75
- Ondsel (commercial FreeCAD) died in 2 years. Open-source CAD has near-zero commercial traction. But the opposite extreme — locking everything behind a paywall — kills adoption. The free tier must be genuinely useful.
76
-
77
- ### Don't ship source maps
78
- Claude Code accidentally shipped `.map` files in npm v2.1.88. Within hours, the entire 1,900-file TypeScript codebase was extracted, mirrored to GitHub (1,100+ stars), and reverse-engineered. `.npmignore` must exclude `*.map`, `*.ts` source, and `tsconfig.json`.
79
-
80
- ## The Gabe Newell Principle
81
-
82
- > "Piracy is almost always a service problem, not a pricing problem."
83
-
84
- Steam proved this — Russia went from "don't bother, too much piracy" to Valve's largest European market once they localized and shipped same-day.
85
-
86
- **Applied to ForgeCAD:** Make the paid version more convenient than the cracked one:
87
- - Automatic updates (the binary self-updates, cracked copies don't)
88
- - Cloud project sync (your models available everywhere)
89
- - Share links (one-click sharing from the editor)
90
- - Support (access to help when stuck)
91
- - Team features (collaboration, permissions)
92
-
93
- People pay for convenience and reliability, not because they can't find a crack.
94
-
95
- ## Distribution
96
-
97
- | Channel | Format | Audience |
98
- |---------|--------|----------|
99
- | **npm** (`npm install -g forgecad`) | Minified `cli.js` (no source maps) | Primary channel |
100
- | **forgecad.io** | Web editor (no install) | Evaluators, casual users |
101
-
102
- ForgeCAD users write `.forge.js` files — they already have Node.js. npm is the only CLI distribution channel we need to maintain.
103
-
104
- A compiled native binary build script exists (`npm run build:binary`) for potential future Homebrew distribution, but compiled binaries offer no additional source protection over minified JS (the source is stored as plain text in the binary's `__BUN` section). The binary is not worth maintaining as a separate channel until user volume justifies it.
105
-
106
- ### Build
107
-
108
- ```
109
- TypeScript source → tsup (ESM bundle, 2.5MB) → dist-cli/forgecad.js
110
- ```
111
-
112
- **Never ship source maps.** `.npmignore` must exclude `*.map`, `*.ts` source, and `tsconfig.json`.
@@ -1,120 +0,0 @@
1
- ---
2
- skill-group: dev-conventions
3
- skill-order: 1
4
- ---
5
-
6
- # Coding Best Practices
7
-
8
- ## Minimal Implementation
9
-
10
- Write only the code needed to solve the problem. No verbose implementations, no speculative features.
11
-
12
- ## TypeScript
13
-
14
- - Use explicit types for function parameters and return values
15
- - Avoid `any` — use `unknown` or proper types
16
- - Prefer interfaces for object shapes
17
-
18
- ## React Components
19
-
20
- - Functional components only
21
- - Inline styles for simplicity (no CSS files unless necessary)
22
- - Extract reusable logic to custom hooks or store actions
23
-
24
- ### Stable References in Render Bodies
25
-
26
- Never use `?? []`, `?? {}`, or inline fallback literals in a component render body if the value flows (directly or transitively) into a `useMemo`/`useCallback`/`useEffect` dependency array. Each render creates a new reference, which silently invalidates every downstream memo.
27
-
28
- ```tsx
29
- // BAD — new [] every render, breaks every useMemo that depends on `items`
30
- const items = config?.items ?? [];
31
-
32
- // GOOD — stable reference across renders
33
- const items = useMemo(() => config?.items ?? [], [config]);
34
- ```
35
-
36
- Use `useMemo` for any derived-with-fallback value that feeds into other hooks.
37
-
38
- ## State Management
39
-
40
- - All global state lives in `forgeStore.ts`
41
- - Use Zustand selectors to prevent unnecessary re-renders
42
- - Keep actions pure and synchronous where possible
43
-
44
- ## Performance
45
-
46
- ### Geometry Operations
47
-
48
- - Manifold operations are expensive — minimize boolean ops
49
- - Cache geometry results when parameters don't change
50
- - Use debouncing for real-time updates
51
-
52
- ### React Rendering
53
-
54
- - Use Zustand selectors to prevent unnecessary re-renders
55
- - Memoize expensive computations with `useMemo`
56
- - Keep component tree shallow
57
-
58
- ## Linting & Formatting
59
-
60
- [Biome](https://biomejs.dev/) handles both linting and formatting for all TS/JS code.
61
-
62
- ```bash
63
- npm run lint # check for lint issues (no changes)
64
- npm run lint:fix # auto-fix lint issues
65
- npm run format # auto-format all files
66
- ```
67
-
68
- Biome runs as part of `npm run check:suite`. Configuration lives in `biome.json` at the repo root.
69
-
70
- ## Self-Review Before Commit
71
-
72
- 1. Remove console.logs and debug code
73
- 2. Check for unused imports
74
- 3. Verify TypeScript has no errors
75
- 4. Test the change works as intended
76
- 5. Read the diff — does it make sense?
77
-
78
- ### What to Look For
79
-
80
- - Does this solve the problem with minimal code?
81
- - Are there edge cases not handled?
82
- - Is the code readable without comments?
83
- - Does it follow existing patterns?
84
-
85
- ## API Naming: Methods Read Like Sentences
86
-
87
- Public API method names must read like natural English. Prefer verbose, intuitive names over short, ambiguous ones. The method name alone should tell you exactly what it does — no options objects or magic strings needed to disambiguate.
88
-
89
- ```ts
90
- // BAD — technical jargon, not a sentence
91
- shape.rotateAxisAngle([0,1,0], 45)
92
-
93
- // GOOD — reads like a sentence
94
- shape.rotateX(45) // "rotate X 45 degrees"
95
- shape.rotateY(45) // "rotate Y 45 degrees"
96
- shape.rotateZ(45) // "rotate Z 45 degrees"
97
- shape.rotate([0, 1, 0], 45) // "rotate around axis"
98
- shape.rotateZ(45, { pivot: [10, 0, 0] }) // "rotate Z at pivot"
99
-
100
- shape.scale(2) // "scale by 2" (from center)
101
- shape.scaleAround(pivot, 2) // "scale around pivot"
102
-
103
- shape.mirror([1,0,0]) // "mirror along X" (through center)
104
- shape.mirrorThrough(point, [1,0,0]) // "mirror through point"
105
- ```
106
-
107
- Rules:
108
- - The **bare method** (`rotate`, `scale`, `mirror`) does the common-sense default (operates relative to the shape's own center)
109
- - **Longer names** make the reference point explicit — no ambiguity
110
- - **No string literals** as behavior selectors (`'center'`, `'origin'`)
111
- - **No options objects** to disambiguate what should be separate methods
112
-
113
- ## Runtime Global Namespace
114
-
115
- Do not add new lowercase injected globals to `.forge.js` scripts. Existing lowercase globals such as `box`, `union`, and `loft` are established core vocabulary; new domain helpers must live under a PascalCase namespace or class such as `Product.materials`, `Product.profiles`, or `Shape.fromSlices`.
116
-
117
- The repo enforces this in `npm run check:suite -- --profile smoke`. If a lowercase global truly must be added for compatibility, it needs an explicit API review and an allowlist update in `cli/check-runtime-globals.ts`.
118
-
119
- ## File length
120
- Keep files under 200 lines. If a file grows beyond that, consider splitting it into smaller, focused files.