create-rulecad 0.3.17 → 0.3.19

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/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ print (a hole's diameter, a seat's depth, a part's outline). Each release lists
5
5
  it makes, with its reason. A **fasten** is an entry in an assembly's `"fasten"` list: one screwed joint, naming the
6
6
  screw by thread and head, the parts it passes through and the part it ends in.
7
7
 
8
+ ## 0.3.19: pins, magnets and printed bolts in the agent notes (Fixings 4)
9
+
10
+ ### Changed
11
+
12
+ - The template's `AGENTS.md`, copied from `@rulecad/cad`, tells an agent to name pins and magnets in a fit's
13
+ `fastener` (`{ "pin": "snap pin 4x6", "count": 2 }`, `{ "magnet": "disc magnet 8x3", "count": 2 }`) with their holes
14
+ drawn by `v.fixings`, a printed bolt as a fasten's screw with the word printed, and that snap pins live in
15
+ `v.fixings` now.
16
+
17
+ ### Printed sizes that moved
18
+
19
+ None: the template's designs are unchanged.
20
+
21
+ ## 0.3.18: a frame to start from (Frames 3)
22
+
23
+ ### Added
24
+
25
+ - `--machine frame --size 300x300x350 --profile 2020-misumi-hfs5`: a box frame generated from its inside size, with
26
+ a load on its top, that checks clean on a fresh install in each profile offered (2020-misumi-hfs5 and
27
+ 2020-openbuilds joined blind on printed levelling feet, 3030-misumi-hfs6 on printed brackets and feet); `cad kit
28
+ frame/box` writes the folder to build it from. Each profile takes the sizes its box checks clean in (2020: width
29
+ and depth 50 to 1400 mm, height 50 to 600 mm; 3030: 100 to 800 mm, height 100 to 300 mm); a size outside them, or
30
+ a profile it cannot make, is refused before anything is written, and so is a frame's flag on another machine.
31
+ So is a size inside them whose beams' cut lengths (the width's, the depth's and the uprights') lie under 1 mm
32
+ apart and not one length, which two cuts at ±0.5 mm cannot hold apart (358 x 300 x 300 in 2020: 358 mm beams beside
33
+ 358.5 mm uprights); cad check warned `frame.cut` there. The 3030 box's feet tap M8 in each upright's middle bore
34
+ alone, where the kit's beam sheets said all five.
35
+ - The template's AGENTS.md follows cad's: the kit, plates by material, and the frame template.
36
+
8
37
  ## 0.3.17: frames in the agents' notes (Frames 2)
9
38
 
10
39
  ### Changed
package/README.md CHANGED
@@ -30,3 +30,38 @@ sheet, and the streamer for an Uno. `--machine leg` makes a leg on a test stand,
30
30
  terminal with neither given it asks; given a flag, or with no terminal, it uses the defaults without asking. The arm and the leg
31
31
  are explained part by part in EXAMPLES chapters 12 and 14, and [the machines guide](https://jonibach.github.io/rulecad/docs/machines/)
32
32
  walks the arm from task to drawing.
33
+
34
+ ## A frame to start from
35
+
36
+ ```sh
37
+ npm create rulecad my-frame --machine frame --size 300x300x350 --profile 2020-misumi-hfs5
38
+ cd my-frame
39
+ npx cad check frame/box
40
+ npx cad kit frame/box
41
+ ```
42
+
43
+ `--machine frame` makes a box frame of aluminium extrusion in `projects/frame`, asked for by its inside size
44
+ (`--size`, width x depth x height in mm; default 300x300x350) in one profile (`--profile`). Its
45
+ beams, joins, feet and end caps are generated from that each time it is built (`"frame": { "kind": "box" }` in
46
+ `projects/frame/assemblies/box.json`), with a 5 kg load on its top front beam to change to what it carries. Each
47
+ profile offered comes with the join and feet its box checks clean with, on a fresh install, and the sizes it checks
48
+ clean in:
49
+
50
+ | `--profile` | Joins | Feet | Width and depth | Height |
51
+ |---|---|---|---|---|
52
+ | `2020-misumi-hfs5` (the default) | blind: a screw in each butting beam's end, its head in the upright's slot | printed levelling feet | 50 to 1400 mm | 50 to 600 mm |
53
+ | `2020-openbuilds` | blind | printed levelling feet | 50 to 1400 mm | 50 to 600 mm |
54
+ | `3030-misumi-hfs6` | printed corner brackets on drop-in slot nuts | printed feet | 100 to 800 mm | 100 to 300 mm |
55
+
56
+ The largest sizes are where its checks stop passing: wider, the top front beam sags past its width over 360 under
57
+ the 5 kg load; taller, a 20 N push at the top sways it past its height over 400 (the printed brackets of the 3030 box
58
+ give more than the blind joins of the 2020 ones, so it is clean only up to 300 mm tall). Under 100 mm the 3030
59
+ brackets crowd each other. Inside the ranges, a size whose beams' cut lengths lie under 1 mm apart (and are not one
60
+ length) is refused too: two cuts at ±0.5 mm cannot hold them apart. A 2020 box's uprights are its height and 58.5 mm
61
+ (two widths and the 18.5 mm its bottom ring rises over the feet's taps), a 3030 box's its height and 60 mm, so 358 x
62
+ 300 x 300 in 2020 (358 mm beams, 358.5 mm uprights) is refused, and 357.5 x 300 x 300 is made. Another profile, or a
63
+ size outside these, is refused by name, before anything is written:
64
+ make the box in range and change its `"inside"`, `"profile"`, `"join"` or `"feet"` by hand, and `cad check` says
65
+ what that needs. `npx cad kit frame/box` writes the
66
+ folder to build it from without the model: the build page, the shopping list, the plates to print, the jigs and each
67
+ beam's cut-and-drill sheet. It does not ask: with no `--size` or `--profile` it makes the default.
package/index.mjs CHANGED
@@ -1,9 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  // npm create rulecad [folder]: a new rulecad workspace with designs to start from (a soap tray, and a box whose lid is
3
3
  // screwed on: a fasten, its holes from v.fixings), then npm install.
4
- // --machine arm | leg start from a whole machine instead: the arm drawn on a sheet (EXAMPLES chapter 12) or a leg on a stand
5
- // (chapter 14), sized when it is made, with its task, bought parts, wires and firmware
6
- // --sheet a5 --accuracy 0.3 (for --machine arm), --robot 1.5 (for --machine leg): the sizes it is made to
4
+ // --machine arm | leg | frame start from a whole machine instead: the arm drawn on a sheet (EXAMPLES chapter 12), a leg
5
+ // on a stand (chapter 14), sized when it is made, with its task, bought parts, wires and firmware;
6
+ // or a box frame of extrusion generated from its inside size, with its checks and its kit
7
+ // --sheet a5 --accuracy 0.3 (for --machine arm), --robot 1.5 (for --machine leg), --size 300x300x350 --profile
8
+ // 2020-misumi-hfs5 (for --machine frame, each profile within the sizes its box checks clean in):
9
+ // the sizes it is made to
7
10
  // --no-install make the files only
8
11
  // --share gist short model links: each model you share is stored in a secret GitHub Gist (needs gh, signed in)
9
12
  // --share long links that carry the whole model (nothing is uploaded; too long for chat on bigger models)
@@ -15,12 +18,46 @@ import readline from 'node:readline/promises';
15
18
  import { fileURLToPath } from 'node:url';
16
19
 
17
20
  const args = process.argv.slice(2), install = !args.includes('--no-install');
18
- const VALUED = new Set(['--share', '--machine', '--sheet', '--accuracy', '--robot']);
21
+ const VALUED = new Set(['--share', '--machine', '--sheet', '--accuracy', '--robot', '--size', '--profile']);
19
22
  const optionValue = (name) => (args.includes(name) ? args[args.indexOf(name) + 1] ?? '' : null);
20
23
  // The folder is the argument that isn't an option, or an option's value
21
24
  const dir = path.resolve(args.find((a, i) => !a.startsWith('--') && !VALUED.has(args[i - 1])) || 'my-designs'), name = path.basename(dir);
22
- const machine = optionValue('--machine'), MACHINES = ['arm', 'leg'];
23
- if (machine !== null && !MACHINES.includes(machine)) { console.error(`--machine is ${MACHINES.join(' or ')} (got "${machine}")`); process.exit(1); }
25
+ const machine = optionValue('--machine'), MACHINES = ['arm', 'leg', 'frame'];
26
+ if (machine !== null && !MACHINES.includes(machine)) { console.error(`--machine is ${MACHINES.slice(0, -1).join(', ')} or ${MACHINES.at(-1)} (got "${machine}")`); process.exit(1); }
27
+ for (const [flag, only] of [['--size', 'frame'], ['--profile', 'frame'], ['--sheet', 'arm'], ['--accuracy', 'arm'], ['--robot', 'leg']]) if (optionValue(flag) !== null && machine !== only) { console.error(`${flag} is for --machine ${only}`); process.exit(1); }
28
+ // The profiles a generated box is made in, each with the join and feet its box checks clean with on a fresh install,
29
+ // and the inside sizes it checks clean in: width and depth (sides) and height, each from its least to its most, in mm.
30
+ // A box grows worse as any side grows (the top front beam sags with the width, and a side push at the top racks it
31
+ // more as it gets taller and wider), so the box is clean wherever its largest corner is; the smallest is set by the
32
+ // fittings (a 3030 box under 100 mm crowds its brackets). The create-rulecad test checks both corners of every one.
33
+ // Found by cad check: 2020 boxes 1400 x 1400 x 700 sway 1.82 mm against 1.87 (blind joins), the top beam at 1600 wide
34
+ // sags 4.38 mm against 4.44; a 3030 box on printed brackets 600 x 600 x 350 sways 1.04 mm against 0.99, 800 x 800 x 300
35
+ // 0.81 against 0.86. Another profile, or a size outside these, is the frame's to make by hand: cad check says what it needs.
36
+ // rise: how much longer an upright is than the inside height (two profile widths, and with blind joins the 18.5 mm
37
+ // the bottom ring rises to clear the feet's tapped ends); its cut length beside the width's and the depth's must be one
38
+ // length or 1 mm apart or more (two cuts at the profile's ±0.5 mm, cad check's frame.cut)
39
+ const FRAME_PROFILES = {
40
+ '2020-misumi-hfs5': { join: 'blind', feet: 'levelling', sides: [50, 1400], height: [50, 600], rise: 58.5, why: 'blind joins (a screw in each end, its head in the other beam\'s slot), printed levelling feet' },
41
+ '2020-openbuilds': { join: 'blind', feet: 'levelling', sides: [50, 1400], height: [50, 600], rise: 58.5, why: 'blind joins, printed levelling feet' },
42
+ '3030-misumi-hfs6': { join: { kind: 'bracket', fitting: 'printed' }, feet: 'foot', sides: [100, 800], height: [100, 300], rise: 60, why: 'printed corner brackets on drop-in nuts, printed feet' },
43
+ };
44
+ const CUT_APART = 1; // mm: two cuts at ±0.5 mm (the profiles' cut_tolerance, MISUMI's "L Dimension Tolerance ±0.5mm")
45
+ // --machine frame's size and profile, refused by name before anything is written
46
+ const frameAsk = machine === 'frame' ? (() => {
47
+ const size = optionValue('--size') ?? '300x300x350', profile = optionValue('--profile') ?? '2020-misumi-hfs5', p = FRAME_PROFILES[profile];
48
+ const inside = /^\d+(\.\d+)?x\d+(\.\d+)?x\d+(\.\d+)?$/i.test(size) ? size.toLowerCase().split('x').map(Number) : null;
49
+ if (!inside) { console.error(`--size is the inside width x depth x height in mm, as 300x300x350 (got "${size}")`); process.exit(1); }
50
+ if (!p) { console.error(`--profile is ${Object.keys(FRAME_PROFILES).join(', ')}: the profiles this box checks clean in (got "${profile}"; for another, make the box and change its "profile", "join" and "feet" by hand)`); process.exit(1); }
51
+ const [w, d, h] = inside, within = ([lo, hi], x) => x >= lo && x <= hi;
52
+ if (!within(p.sides, w) || !within(p.sides, d) || !within(p.height, h)) { console.error(`--size in ${profile} is width and depth ${p.sides.join(' to ')} mm, height ${p.height.join(' to ')} mm: the sizes its box checks clean in (got "${size}"; for another size, make one in range and change its "inside" by hand: cad check says what it needs)`); process.exit(1); }
53
+ // the beams' cut lengths: the width's and the depth's beams are the inside, the uprights the height and the rise
54
+ const cuts = [['width', w], ['depth', d], ['upright', +(h + p.rise).toFixed(3)]];
55
+ for (const [i, [n1, a]] of cuts.entries()) for (const [n2, b] of cuts.slice(i + 1)) {
56
+ const gap = Math.abs(a - b);
57
+ if (gap > 1e-6 && gap < CUT_APART - 1e-9) { console.error(`--size ${size} in ${profile} cuts the ${n1}'s beams at ${a} mm and the ${n2}'s at ${b} mm, ${+gap.toFixed(3)} mm apart: two cuts at ±0.5 mm cannot hold them apart (cad check warns frame.cut). Make them one length or ${CUT_APART} mm apart or more${n2 === 'upright' ? ` (the uprights are the height and ${p.rise} mm)` : ''}`); process.exit(1); }
58
+ }
59
+ return { inside, profile, ...p };
60
+ })() : null;
24
61
  if (fs.existsSync(dir) && fs.readdirSync(dir).length) { console.error(`${dir} isn't empty: name a new folder (npm create rulecad my-designs)`); process.exit(1); }
25
62
 
26
63
  const TEMPLATE = fileURLToPath(new URL('./template/', import.meta.url));
@@ -44,7 +81,16 @@ console.log(`made ${path.relative(process.cwd(), dir) || '.'}: a soap tray and a
44
81
 
45
82
  // A machine: copy it in, and size it to what was asked
46
83
  const SHEETS = { a6: [148, 105], a5: [210, 148], a4: [297, 210] };
84
+ function frameSized() {
85
+ const { inside, profile, join, feet, why } = frameAsk;
86
+ fs.cpSync(fileURLToPath(new URL('./machines/frame/', import.meta.url)), dir, { recursive: true });
87
+ const file = path.join(dir, 'projects/frame/assemblies/box.json'), a = JSON.parse(fs.readFileSync(file, 'utf8'));
88
+ a.title = `Box frame ${inside.join(' x ')}`; Object.assign(a.frame, { inside, profile, join, feet });
89
+ fs.writeFileSync(file, `${JSON.stringify(a, null, 2)}\n`);
90
+ console.log(` a box frame round ${inside.join(' x ')} mm inside, in ${profile}: ${why}: projects/frame/assemblies/box.json`);
91
+ }
47
92
  async function sized() {
93
+ if (machine === 'frame') return frameSized();
48
94
  const arm = machine === 'arm', o = { sheet: optionValue('--sheet'), accuracy: optionValue('--accuracy'), robot: optionValue('--robot') };
49
95
  const asking = process.stdin.isTTY && process.stdout.isTTY && o.sheet === null && o.accuracy === null && o.robot === null;
50
96
  if (asking) {
@@ -82,7 +128,9 @@ async function sized() {
82
128
  }
83
129
  if (machine) {
84
130
  await sized();
85
- fs.appendFileSync(readme, `\n## The machine\n\nA ${machine === 'arm' ? 'two-link arm that draws' : 'leg on a test stand'}, in \`projects/${machine}\`, made by \`--machine ${machine}\`: its task, bought parts, wires and firmware are in the assembly (EXAMPLES chapters 12 and 14 explain every part). \`npx cad check ${machine === 'arm' ? 'arm/arm' : 'leg/stand'}\` first.\n`);
131
+ fs.appendFileSync(readme, machine === 'frame'
132
+ ? '\n## The frame\n\nA box frame of aluminium extrusion in `projects/frame`, made by `--machine frame`. Its assembly, `projects/frame/assemblies/box.json`, asks for it by its inside size (`"frame": { "kind": "box", "inside": [...] }`): the beams, joins, feet and end caps are generated from that when it is built, and a load on its top says what it carries. `npx cad check frame/box` checks it (the joins, the screws, the feet, the cut list, its sag, stress, buckling, racking and lowest mode); `npx cad frame frame/box` says what it expands into; `npx cad kit frame/box` writes the folder to build it from (the plates to print, the cut list and each beam\'s sheet, the screws and bought parts, the build steps).\n'
133
+ : `\n## The machine\n\nA ${machine === 'arm' ? 'two-link arm that draws' : 'leg on a test stand'}, in \`projects/${machine}\`, made by \`--machine ${machine}\`: its task, bought parts, wires and firmware are in the assembly (EXAMPLES chapters 12 and 14 explain every part). \`npx cad check ${machine === 'arm' ? 'arm/arm' : 'leg/stand'}\` first.\n`);
86
134
  }
87
135
 
88
136
  // How models are shared: short links need somewhere to keep the model (a secret Gist); long links carry it
@@ -104,5 +152,5 @@ if (share === 'gist') {
104
152
  : 'short links are on, but the gh command isn\'t installed or signed in: install it from cli.github.com and run gh auth login');
105
153
  } else console.log(`model links carry the whole model${share ? '' : ' (no --share given)'}; for short ones later, add "shorten": "gist" to "targets" in cad.config.json`);
106
154
  if (install) execSync('npm install', { cwd: dir, stdio: 'inherit' });
107
- const start = machine === 'arm' ? 'arm/arm' : machine === 'leg' ? 'leg/stand' : 'home/soap-tray';
108
- console.log(`\n cd ${path.relative(process.cwd(), dir)}\n npx cad check ${start}\n npx cad preview ${start}${machine === 'arm' ? '\n npx cad plot arm/arm projects/arm/drawings/test.svg' : ''}\n\nREADME.md says what's where.`);
155
+ const start = machine === 'arm' ? 'arm/arm' : machine === 'leg' ? 'leg/stand' : machine === 'frame' ? 'frame/box' : 'home/soap-tray';
156
+ console.log(`\n cd ${path.relative(process.cwd(), dir)}\n npx cad check ${start}\n npx cad preview ${start}${machine === 'arm' ? '\n npx cad plot arm/arm projects/arm/drawings/test.svg' : machine === 'frame' ? '\n npx cad kit frame/box' : ''}\n\nREADME.md says what's where.`);
@@ -0,0 +1,14 @@
1
+ {
2
+ "title": "Box frame",
3
+ "kind": "fit",
4
+ "frame": {
5
+ "kind": "box",
6
+ "inside": [300, 300, 350],
7
+ "profile": "2020-misumi-hfs5",
8
+ "join": "blind",
9
+ "feet": "levelling"
10
+ },
11
+ "loads": [
12
+ { "mass": 5, "at": "x3.top@50%", "note": "5 kg set on the middle of the top's front beam: change it to what the box carries" }
13
+ ]
14
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "frame",
3
+ "description": "A box frame of aluminium extrusion, generated from its inside size: its beams, joins, feet and caps, checked, with its kit (cad kit frame/box).",
4
+ "material": "PLA",
5
+ "objects": []
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rulecad",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
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,7 +21,13 @@ 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:
24
+ - For a beam (an aluminium extrusion) the kit has no profile for, write its profile from the maker's spec sheet:
25
+ `npx cad rules draft profile <name>` writes every field as a draft; fill each the sheet gives (its value, `"kind":
26
+ "spec"`, the sheet, page and address as `source`, the date), delete the rest, and run `npx cad rules check <name>`
27
+ until it has no `rules.draft` warning. A section figure warned off its outline (`profile.section.*`) is first a typed
28
+ figure to hold against the sheet; if it is right, add the corner hollows the drawing shows as estimates, or measure
29
+ the section's DXF, and say in your report what is left: the checks use the sheet's figures. Never change the check;
30
+ then `npx cad rules draw <name>` and look at the drawing beside the sheet's. Or measure the maker's model or a DXF of its section:
25
31
  `npx cad measure <beam.stl|section.dxf> --profile <name> --source <url> --licence "…"`. It writes a draft profile
26
32
  set and the section's outline into this workspace's `rules/`. Look at the drawing, check the slot figures against
27
33
  the maker's sheet, and never copy the outline out of the workspace: it is the maker's shape.
@@ -93,6 +99,12 @@ variable says which rule it comes from. Follow these steps; they're what makes a
93
99
  drawn: one axis through the stack, a clearance hole in each part passed, a pilot, insert or nut at the far end, the
94
100
  length chosen from what is sold, thread engaged, the seat under the head and the key's way to it, and `cad list`
95
101
  counts the screws. Report what it finds with its numbers, and fix the part, never the relation, to make it pass.
102
+ - **A frame is beams and joins, never loose boxes.** Each beam is a `"beam"` item of a profile from a rule set (the
103
+ kit's or one in `rules/`, never sizes typed into an object), placed by its ends; each meeting of two beams is a
104
+ declared join, and its drilling, tapping, screws and nuts follow from it: never draw a join's holes or type its
105
+ screws. Every join's stiffness and play is an estimate until the joint rig measures it, so every frame figure that
106
+ rests on one (sag, sway, frequency, the diagonals to accept) is reported as resting on an estimate. The frames guide
107
+ (docs/guides/building-frames.md, on the docs site) walks a profile from its sheet to a checked box.
96
108
  - **Beams are held to each other by a join**, not a fasten: `{ "kind": "blind", "a": "y1.a", "b": "x1.back@120" }`
97
109
  (`npx cad add join …`), `b` the place on the other beam where a's end meets it. A blind or end-tap join taps a's end,
98
110
  drills b and adds its screw to the fasten checks and the list. A bracket, gusset or splice join with `"fitting":
@@ -106,7 +118,32 @@ variable says which rule it comes from. Follow these steps; they're what makes a
106
118
  fitting comes later (`join.fitting`). Move the beam to fix `join.geometry`, never the address, unless the
107
119
  address is what was wrong; `join.stiffness` says whether it rests on an estimate or on the joint rig's
108
120
  measurement (and its date): report it as it says. A `join.drop` is a prediction for a beam held by one join, to
109
- measure and write back with `cad measured`, never a figure to tune.
121
+ measure and write back with `cad measured`, never a figure to tune. `frame.deflection` gives each sag twice, on
122
+ the joins' springs and with the joins rigid: report the first with what it rests on (`refs.restsOn`), never the
123
+ rigid one alone. Say where the frame stands with `"frame": { "supports" }` or fitted feet, not by moving beams.
124
+ `frame.rack` gives the racking stiffness each way and the gain each change (gussets, a brace, a panel) solves to:
125
+ report the stiffness, the gain and the change it advises, and say the push and the joins' springs are estimates.
126
+ `frame.frequency` gives the lowest mode against what the machine excites: report it with its pose, and look at
127
+ `<assembly>.frame-mode.svg` from `cad beams` to see what moves. To choose profiles, give `"frame": { "size": {
128
+ "profiles": [...] } }` and read `frame.size` (or `npx cad frame <project>/<assembly> --size`): report each group's
129
+ profile with the limit that set it and its margin, never pick a profile by hand where the sizing can; write it with
130
+ `--size --write` and check again, as its joins and lengths change. A task on a guide counts the beam's sag (the
131
+ frame's own figure where the frame is solved), straightness and twist in `task.accuracy`: report the biggest term
132
+ as it is named. `frame.heat` (given `"frame": { "heat": { "air": 45 } }`) says how much the frame grows and holds
133
+ each printed fitting to its plastic's softening point: move a failing fitting from the heat or print it in a plastic
134
+ that softens higher, never raise the softening figure. `beam.printable` (given `"frame": { "printed": "petg" }`)
135
+ says which beams could be printed and the margin each misses by: report the margin and what governs it, say it
136
+ rests on estimates (the printed section, creep) until the beam coupon is measured, and name the joins it says need
137
+ changing. A `beam.coupon` sag or break is a prediction to measure on the bench and write back with `cad measured`,
138
+ never a figure to tune; `beam.creep` fails a printed beam held too hard for months: a deeper section or aluminium.
139
+ A beam that needs slots in more than its top face prints standing up from the metal's profile
140
+ (`"printed": { "pose": "standing", "end": "nut" }`): its tapped end takes the thread `beam.end` names, and a foot
141
+ under it takes that `"thread"`. Report each printed beam's pose, grams and the sag `frame.deflection` gives.
142
+ - **A frame for a size starts from a generator**: `"frame": { "kind": "box", "inside": [w, d, h], "profile",
143
+ "join": "blind" }` (also portal, table, gantry, shelf) expands into beams, joins, feet and caps before anything is
144
+ checked. Ask by `inside` for what it must enclose, `outside` for what it must fit in; never work the lengths out by
145
+ hand. Read `frame.generated` for what it made, and `npx cad frame <project>/<assembly> --expand` to write it out
146
+ when it needs changes a generator cannot make, then edit the beams and joins as a hand-drawn frame.
110
147
  - **Beams are cut and drilled by hand from their sheets and jigs**: `npx cad beams <project>/<assembly>` writes a
111
148
  cut-and-drill sheet per mark, and `--jigs` writes the jigs as a plate in `exports/` (a drill guide per distinct
112
149
  hole across a beam, a tap guide per tapped end, a cut-length stop per length, a squaring corner of the hand each square join takes),
@@ -146,10 +183,24 @@ variable says which rule it comes from. Follow these steps; they're what makes a
146
183
  the user, and `cad order` shows them on the step.
147
184
  - **A frame's build is `cad order`**: from bars to a square frame in numbered steps (cut, drill and tap, sides built
148
185
  flat and squared, nuts to load, joins with their torque, the diagonals, then the rest). Give the user its steps and
149
- its diagonals (`frame.square`: each and the difference to accept). If it is refused for a slot's nuts, change the
186
+ its diagonals (`frame.square`: each and the difference to accept, stacked from the cut tolerances and the joins'
187
+ play; `"frame": { "cut": { "tolerance": 1 } }` where the user's saw holds less than the profile's figure). Once
188
+ squared, the difference they measure goes back with `cad measured <ref> frame.square.<beams>=<mm>`. If it is refused for a slot's nuts, change the
150
189
  nut to the kind it names; never reorder the joins to get round it. Where a side is built on the frame, not flat,
151
190
  the build says why; pass that on. Its load and "Slide ... screw into ... head first" steps give each nut and head a
152
191
  way into its slot: pass them on as written. `cad check` counts the same steps.
192
+ - **To hand a build to someone, write its kit**: `npx cad kit <project>/<assembly>` writes
193
+ `exports/<project>/<assembly>-kit/` (the build page as README.md, buy.csv, each plate's 3MF and the jigs', each
194
+ mark's sheet; `--pictures` adds the steps' pictures). It refuses a design whose check fails: fix the failures, never
195
+ hand on a kit of one. `npx cad plates` lays out every printed part by material, with a frame's jigs beside them.
196
+ A new frame project can start from `npm create rulecad my-frame --machine frame --size 300x300x350 --profile
197
+ 2020-misumi-hfs5`.
198
+ - What holds parts with no steel screw is named in the fit's `fastener`, never typed in a note:
199
+ `{ "pin": "snap pin 4x6", "count": 2 }`, `{ "pin": "dowel 3x12", "fit": "press" }`, or
200
+ `{ "magnet": "disc magnet 8x3", "count": 2, "load": 10 }`, with the holes or pockets drawn by `v.fixings.pinHole(...)`
201
+ and `v.fixings.magnetSeat(...)` under the same name. `cad check` then finds and checks them and `cad list` counts
202
+ them. A bolt to print is a fasten's screw with the word printed (`"M8x20 hex printed"`). Snap pins live in
203
+ `v.fixings` now (`v.flexures.snapPin` still draws the same pin); snap hooks and ratchets stay in `v.flexures`.
153
204
  - A fit with `"fastens": true` is for what holds parts without screws (pins, a press, a clip). An older assembly with
154
205
  a holes fit (`{ "holes": "pcb.board", "into": "case.body", … }`) and a fit that fastens the same parts gets a
155
206
  `fasten.suggest` note from `cad check`: `npx cad add fasten <project>/<assembly> --from-fits` puts the fasten in