create-rulecad 0.3.13 → 0.3.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 (2) hide show
  1. package/package.json +1 -1
  2. package/template/AGENTS.md +24 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rulecad",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Start a rulecad project: npm create rulecad my-designs. A workspace with a soap tray to start from, ready to check, preview, export and share.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,6 +21,10 @@ variable says which rule it comes from. Follow these steps; they're what makes a
21
21
  - When a part must fit something whose model exists (a maker's CAD, a model site), measure that model:
22
22
  `npx cad measure <file> --rules <name> --source <url> --licence "…"`. Look at the drawing in `.preview/measure/`,
23
23
  then rename the draft rules for what they are and say in each `rule` what the feature does.
24
+ - For a beam (an aluminium extrusion) the kit has no profile for, measure the maker's model or a DXF of its section:
25
+ `npx cad measure <beam.stl|section.dxf> --profile <name> --source <url> --licence "…"`. It writes a draft profile
26
+ set and the section's outline into this workspace's `rules/`. Look at the drawing, check the slot figures against
27
+ the maker's sheet, and never copy the outline out of the workspace: it is the maker's shape.
24
28
  - Model it from those rules, then `npx cad match <project>/<object> <file>`: report the worst places with their numbers,
25
29
  and look at the sections picture. A deliberate clearance shows as an even offset; anything else is a finding.
26
30
  - Don't copy the shape of a model whose licence is non-commercial, no-derivatives or share-alike into a design under
@@ -30,7 +34,7 @@ variable says which rule it comes from. Follow these steps; they're what makes a
30
34
  1. `npx cad history <project>/<object>` first: read the print log. A failed print is the reason for most changes:
31
35
  fix the rule or variable it points at (a measured fit beats a community rule).
32
36
  2. Change, then check, preview and look, as for a new part. Change values with `npx cad set <project>/<object>
33
- name=value` and assemblies with `npx cad add fit|joint|item|pose …`: they keep the file's layout and refuse an edit
37
+ name=value` and assemblies with `npx cad add fit|joint|item|pose|fasten …`: they keep the file's layout and refuse an edit
34
38
  that breaks it. `npx cad values` lists an object's numbers; `npx cad why <project>/<object>.<name>` shows what a
35
39
  value depends on, down to the rules (estimates marked). `--json` on check, values and why gives data to act on:
36
40
  each finding has a code, its numbers and where it is.
@@ -43,15 +47,23 @@ variable says which rule it comes from. Follow these steps; they're what makes a
43
47
  - Walls are whole numbers of print lines (`x1c.line * 3`, or your printer's set), heights whole numbers of layers.
44
48
  - Holes and slots get the printer's hole compensation; parts that slide together get its fit clearance. Chamfer
45
49
  bottom edges.
50
+ - A hole or a seat for a screw, a nut or a heat-set insert comes from `v.fixings`, named by its thread, never from a
51
+ typed number: `v.fixings.hole('M3', { kind: 'pilot', at })` (kinds: `clearance`, `close`, `loose`, `pilot`, `tap`,
52
+ `insert`, `thread`), `counterbore`, `countersink`, `nutPocket`, `nutTrap`, `squareNutSlot`, `insertBoss`. Each reads
53
+ the workspace's thread set (`rules/m3.json` before the kit's), the project's printer and its material, so no
54
+ diameter is typed and none is passed in. `cad check` then says what each was drawn to and the rule it rests on:
55
+ report a figure it marks as an estimate or a community figure, and measure it. A thread's name is text
56
+ (`'M3x12 cap'`), so the check on numbers passes it.
46
57
  - An overhang warning means supports: say so in `orientation`, or change the shape or orientation.
47
58
  - A part that moves by bending (a spring, a snap, a hinge with no pin) is a flexure from `v.flexures`: drawn flat, so it
48
59
  bends within its layers; give its thickness in whole lines (`x1c.line`), and check its strain at the travel against
49
60
  the material's limit with `v.flexures.printable`. PLA creeps held bent and fatigues; PETG or nylon for springs.
50
- - Use the print-aware features in `v.shapes` before drawing your own: `countersink`, `teardropHole`, `nutPocket`,
51
- `crushRibs`, `wallOpening` print without supports as drawn. Use `v.ops.union/subtract/intersect` for booleans: the
61
+ - Use the print-aware features in `v.shapes` before drawing your own: `teardropHole`, `crushRibs`, `wallOpening`
62
+ print without supports as drawn (and `countersink` and `nutPocket` for a size that is no screw's). Use `v.ops.union/subtract/intersect` for booleans: the
52
63
  workspace can switch them to Manifold (faster, watertight) without touching the design.
53
- - Designs run sandboxed: they may import only `@jscad/modeling`, `@rulecad/shapes`, `@rulecad/flexures` and files in
54
- their project, and can't write files or start programs. To see a value while designing, `console.log` it: it comes
64
+ - Designs run sandboxed: they may import only `@jscad/modeling`, `@rulecad/shapes`, `@rulecad/flexures`,
65
+ `@rulecad/gears`, `@rulecad/motors`, `@rulecad/fixings` and files in their project, and can't write files or start
66
+ programs. To see a value while designing, `console.log` it: it comes
55
67
  out with the command's output. A misspelt `v.name` stops the build and says which name was meant.
56
68
  - Something printed under the part and removed afterwards is a named `support` part (`return { cap, pillar }`, both
57
69
  described in the .json's `parts`), not part of the shape. Look at `cad preview --explode` too.
@@ -73,7 +85,13 @@ variable says which rule it comes from. Follow these steps; they're what makes a
73
85
  them with joints, name the positions in `poses`, and run `cad check --sweep` to find where parts collide on the way.
74
86
  See "Joints and poses" in the cad README.
75
87
  - A part is named in fits as `<item>.<part>`; an object that returns one unnamed shape has one part, `body`.
76
- - A gap fit can't tell whether holes line up. Where a board screws into a part, add a holes fit
88
+ - Where parts screw together, say so with `fasten`, which knows the screw:
89
+ `{ "screw": "M3 cap", "through": ["bracket"], "into": "base", "at": ["bracket.h1", "bracket.h2"] }` (anchors on the
90
+ holes' axes), or `"holes": "bracket.body"` to use the part's own holes; `npx cad add fasten …` writes it. The check
91
+ reads the holes from the parts as drawn: one axis through the stack, a clearance hole in each part passed, a pilot,
92
+ insert or nut at the far end, the length chosen from what is sold, thread engaged, and the seat under the head.
93
+ Report what it finds with its numbers, and fix the part, never the relation, to make it pass.
94
+ - A gap fit can't tell whether holes line up. Where a board only rests on its screws' bosses, a holes fit follows them
77
95
  (`{ "holes": "pcb.board", "into": "case.body", "depth": "m2.insert_length" }`).
78
96
  - A part built around another (a case around its board) reads it: `"uses": ["macropad/pcb"]`, then
79
97
  `pcb.board_w` and `v.pcb.board_holes`. Never copy another object's numbers by hand.