create-rulecad 0.3.13 → 0.3.14

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 +20 -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.14",
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": {
@@ -30,7 +30,7 @@ variable says which rule it comes from. Follow these steps; they're what makes a
30
30
  1. `npx cad history <project>/<object>` first: read the print log. A failed print is the reason for most changes:
31
31
  fix the rule or variable it points at (a measured fit beats a community rule).
32
32
  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
33
+ name=value` and assemblies with `npx cad add fit|joint|item|pose|fasten …`: they keep the file's layout and refuse an edit
34
34
  that breaks it. `npx cad values` lists an object's numbers; `npx cad why <project>/<object>.<name>` shows what a
35
35
  value depends on, down to the rules (estimates marked). `--json` on check, values and why gives data to act on:
36
36
  each finding has a code, its numbers and where it is.
@@ -43,15 +43,23 @@ variable says which rule it comes from. Follow these steps; they're what makes a
43
43
  - Walls are whole numbers of print lines (`x1c.line * 3`, or your printer's set), heights whole numbers of layers.
44
44
  - Holes and slots get the printer's hole compensation; parts that slide together get its fit clearance. Chamfer
45
45
  bottom edges.
46
+ - 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
47
+ typed number: `v.fixings.hole('M3', { kind: 'pilot', at })` (kinds: `clearance`, `close`, `loose`, `pilot`, `tap`,
48
+ `insert`, `thread`), `counterbore`, `countersink`, `nutPocket`, `nutTrap`, `squareNutSlot`, `insertBoss`. Each reads
49
+ the workspace's thread set (`rules/m3.json` before the kit's), the project's printer and its material, so no
50
+ diameter is typed and none is passed in. `cad check` then says what each was drawn to and the rule it rests on:
51
+ report a figure it marks as an estimate or a community figure, and measure it. A thread's name is text
52
+ (`'M3x12 cap'`), so the check on numbers passes it.
46
53
  - An overhang warning means supports: say so in `orientation`, or change the shape or orientation.
47
54
  - 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
55
  bends within its layers; give its thickness in whole lines (`x1c.line`), and check its strain at the travel against
49
56
  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
57
+ - Use the print-aware features in `v.shapes` before drawing your own: `teardropHole`, `crushRibs`, `wallOpening`
58
+ 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
59
  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
60
+ - Designs run sandboxed: they may import only `@jscad/modeling`, `@rulecad/shapes`, `@rulecad/flexures`,
61
+ `@rulecad/gears`, `@rulecad/motors`, `@rulecad/fixings` and files in their project, and can't write files or start
62
+ programs. To see a value while designing, `console.log` it: it comes
55
63
  out with the command's output. A misspelt `v.name` stops the build and says which name was meant.
56
64
  - Something printed under the part and removed afterwards is a named `support` part (`return { cap, pillar }`, both
57
65
  described in the .json's `parts`), not part of the shape. Look at `cad preview --explode` too.
@@ -73,7 +81,13 @@ variable says which rule it comes from. Follow these steps; they're what makes a
73
81
  them with joints, name the positions in `poses`, and run `cad check --sweep` to find where parts collide on the way.
74
82
  See "Joints and poses" in the cad README.
75
83
  - 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
84
+ - Where parts screw together, say so with `fasten`, which knows the screw:
85
+ `{ "screw": "M3 cap", "through": ["bracket"], "into": "base", "at": ["bracket.h1", "bracket.h2"] }` (anchors on the
86
+ holes' axes), or `"holes": "bracket.body"` to use the part's own holes; `npx cad add fasten …` writes it. The check
87
+ reads the holes from the parts as drawn: one axis through the stack, a clearance hole in each part passed, a pilot,
88
+ insert or nut at the far end, the length chosen from what is sold, thread engaged, and the seat under the head.
89
+ Report what it finds with its numbers, and fix the part, never the relation, to make it pass.
90
+ - 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
91
  (`{ "holes": "pcb.board", "into": "case.body", "depth": "m2.insert_length" }`).
78
92
  - A part built around another (a case around its board) reads it: `"uses": ["macropad/pcb"]`, then
79
93
  `pcb.board_w` and `v.pcb.board_holes`. Never copy another object's numbers by hand.