@rulecad/cad 0.8.0 → 0.10.0
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/AGENTS.md +45 -16
- package/CHANGELOG.md +724 -0
- package/EXAMPLES.md +61 -54
- package/README.md +376 -98
- package/TUTORIAL.md +2 -2
- package/bin/cad.mjs +2664 -541
- package/lib/animate.mjs +173 -49
- package/lib/assembly.mjs +1883 -435
- package/lib/beams.mjs +256 -52
- package/lib/belts.mjs +66 -15
- package/lib/board-work.mjs +12 -0
- package/lib/bought.mjs +309 -53
- package/lib/buildpage.mjs +179 -29
- package/lib/cache-file.mjs +105 -0
- package/lib/carried.mjs +201 -0
- package/lib/clone.mjs +194 -42
- package/lib/code-text.mjs +28 -0
- package/lib/design-imports.mjs +127 -0
- package/lib/design.mjs +871 -147
- package/lib/designshapes.mjs +142 -0
- package/lib/drive.mjs +187 -63
- package/lib/edit.mjs +922 -192
- package/lib/errors.mjs +16 -3
- package/lib/estimates.mjs +51 -0
- package/lib/explain.mjs +62 -13
- package/lib/fasten.mjs +2708 -507
- package/lib/fe-key.mjs +29 -0
- package/lib/fittings.mjs +721 -122
- package/lib/fixings.mjs +38 -13
- package/lib/framebuild.mjs +790 -175
- package/lib/framecheck.mjs +1901 -368
- package/lib/framegen.mjs +108 -22
- package/lib/frameheat.mjs +225 -42
- package/lib/frameprint.mjs +513 -108
- package/lib/frames.mjs +86 -18
- package/lib/framesize.mjs +719 -120
- package/lib/frametip.mjs +235 -0
- package/lib/gait.mjs +135 -23
- package/lib/grip.mjs +62 -13
- package/lib/guides.mjs +1403 -230
- package/lib/host.mjs +129 -23
- package/lib/inplace.mjs +171 -36
- package/lib/jigs.mjs +360 -78
- package/lib/joins.mjs +697 -118
- package/lib/jsonedit.mjs +88 -26
- package/lib/kept.mjs +84 -0
- package/lib/kit.mjs +439 -69
- package/lib/layout.mjs +2 -1
- package/lib/links.mjs +149 -42
- package/lib/list.mjs +334 -64
- package/lib/live-guard.mjs +68 -0
- package/lib/live-shape.mjs +96 -24
- package/lib/live.mjs +189 -59
- package/lib/loads.mjs +597 -136
- package/lib/machine.mjs +372 -74
- package/lib/magnets.mjs +162 -44
- package/lib/measured.mjs +1080 -117
- package/lib/mesh.mjs +526 -119
- package/lib/meshcmd.mjs +215 -60
- package/lib/motors.mjs +1002 -214
- package/lib/motorsvg.mjs +114 -32
- package/lib/names.mjs +18 -1
- package/lib/optimise.mjs +991 -287
- package/lib/order.mjs +515 -114
- package/lib/panels.mjs +482 -94
- package/lib/parts.mjs +81 -23
- package/lib/pins.mjs +163 -44
- package/lib/plates.mjs +223 -35
- package/lib/player.mjs +37 -9
- package/lib/power.mjs +64 -13
- package/lib/preview.mjs +83 -16
- package/lib/profilemeasure.mjs +572 -129
- package/lib/rules.mjs +17 -6
- package/lib/sandbox-hooks.mjs +179 -27
- package/lib/sandbox-lock.mjs +225 -0
- package/lib/sandbox-preload.mjs +2 -2
- package/lib/sandbox-run.mjs +122 -25
- package/lib/sandbox.mjs +667 -75
- package/lib/schema.mjs +42 -11
- package/lib/seats.mjs +227 -49
- package/lib/services.mjs +261 -52
- package/lib/sheet.mjs +963 -179
- package/lib/slotnuts.mjs +213 -34
- package/lib/targets/gist.mjs +4 -1
- package/lib/targets.mjs +22 -4
- package/lib/task.mjs +376 -79
- package/lib/versions.mjs +285 -39
- package/lib/wires.mjs +228 -45
- package/lib/workspace.mjs +200 -14
- package/package.json +19 -19
- package/schemas/assembly.schema.json +2 -2
- package/schemas/project.schema.json +6 -0
- package/templates/coupons/MEASURE.md +109 -0
- package/templates/coupons/assemblies/fixings-test.json +20 -0
- package/templates/coupons/assemblies/slot-test.json +11 -0
- package/templates/coupons/objects/fixings-coupon.js +88 -0
- package/templates/coupons/objects/fixings-coupon.json +26 -0
- package/templates/coupons/objects/holds-coupon.js +130 -0
- package/templates/coupons/objects/holds-coupon.json +42 -0
- package/templates/coupons/objects/slot-coupon.js +89 -0
- package/templates/coupons/objects/slot-coupon.json +29 -0
- package/templates/coupons/project.json +10 -0
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ measured into rules, an optimised arm, a board, and a mechanism printed flat, ea
|
|
|
24
24
|
```
|
|
25
25
|
rules/ shared facts, one file per set: x1c.json (printer), mx.json (Cherry MX). A set from
|
|
26
26
|
@rulecad/rules is copied here the first time a design uses it: yours to keep and correct
|
|
27
|
+
(cad rules update <set> takes the kit's later corrections; see The workspace)
|
|
27
28
|
projects/<project>/
|
|
28
29
|
project.json name, title, description, default material, printer, objects, filaments (AMS slots)
|
|
29
30
|
(schemas/project.schema.json; written by cad new <project>, changed by cad set <project>)
|
|
@@ -39,6 +40,7 @@ exports/ .preview/ .versions/ .cache/ generated (ignore them in git); .cache/b
|
|
|
39
40
|
```sh
|
|
40
41
|
npx cad rules bathroom/soap-tray # every variable, its rule and source
|
|
41
42
|
npx cad check bathroom/soap-tray --set width=60 # change variables that have a tweak range
|
|
43
|
+
npx cad check bathroom/tray-on-shelf --set tray.width=60 # in an assembly: <item>.<variable>
|
|
42
44
|
npx cad variants keyboard/keycap # named sets of inputs: keyboard/keycap:legend-f
|
|
43
45
|
npx cad compare keyboard/keycap dsa legend-f # two variants (or releases) side by side
|
|
44
46
|
npx cad import-kle layout.json keyboard/mine # a layout from keyboard-layout-editor.com, into layouts/
|
|
@@ -138,6 +140,11 @@ else the current folder:
|
|
|
138
140
|
|
|
139
141
|
- `printer`: the rule set prints are checked against (bed, overhang, layer, bridge, support_gap); a project.json's
|
|
140
142
|
`printer` wins. Either is a rule set's plain name (letters, digits, `-` and `_`; see Variables).
|
|
143
|
+
- `designTimeout` and `designMemory`: optional. How long a design may run in the sandbox, in seconds (3600, an hour, if
|
|
144
|
+
left out), and how much memory its JavaScript may hold, in megabytes (4096). A design past either is stopped with
|
|
145
|
+
`design.time` or `design.memory` (see Sandbox). `CAD_DESIGN_TIMEOUT` and `CAD_DESIGN_MEMORY` set them for one run.
|
|
146
|
+
A value above the default is used once you have trusted the workspace (`cad trust`), as `"sandbox": false` is;
|
|
147
|
+
until then the default holds, so a workspace cloned from elsewhere can't take the limits away by itself.
|
|
141
148
|
- `targets`: optional. `show` puts a model on display: a module of yours, exporting `show({ title, ttl, mesh, card })`
|
|
142
149
|
(lib/targets.mjs describes it): a smart mirror, a second screen, a slicer. `shorten` stores a link's data for
|
|
143
150
|
short links (`gist`: a secret Gist, through the `gh` command). Leave one out and `cad show` says so, and links stay
|
|
@@ -148,13 +155,35 @@ else the current folder:
|
|
|
148
155
|
- Previews need Chrome or Chromium: `$CAD_CHROME`, else the usual install paths.
|
|
149
156
|
- Designs are code: run only designs you trust. Links and rule files are data and never run.
|
|
150
157
|
|
|
158
|
+
### Your copies of the kit's rule sets
|
|
159
|
+
|
|
160
|
+
The first time a design uses one of the kit's rule sets (`x1c`, `m3`, `pla`), cad copies it into `rules/` and from
|
|
161
|
+
then on reads only that copy: the workspace keeps every figure its designs were built on, and your measurements are
|
|
162
|
+
edits to your copy. A later version of the kit may correct a figure or add rules, and the copy keeps what it had until
|
|
163
|
+
you take them. `cad rules check` says when:
|
|
164
|
+
|
|
165
|
+
| Note | What it says | What to do |
|
|
166
|
+
|---|---|---|
|
|
167
|
+
| `rules.changed` | The kit has a different figure for a rule, checked after your copy's was, and your copy's is not `measured` | `cad rules update <set>` |
|
|
168
|
+
| `rules.new` | The kit's set has rules your copy lacks | `cad rules update <set>`, or copy the ones you want by hand |
|
|
169
|
+
| `rules.same` | Your copy is the kit's set word for word: nothing in it is yours | Keep it, or delete it: the next design to use the set copies in the kit's as it is then |
|
|
170
|
+
|
|
171
|
+
`cad rules update <set>` brings `rules/<set>.json` up to the kit's and prints each change: a figure the kit checked
|
|
172
|
+
after your copy's was (`13.8 → 14`), the kit's new rules, and the same figure with more said of it (its range, a newer
|
|
173
|
+
source). It keeps every figure of kind `measured`, every figure you checked on or after the kit's date (your own
|
|
174
|
+
word), and every rule the kit has none of. `--dry-run` prints what it would change and writes nothing; `--json` gives
|
|
175
|
+
it as `{ changed: [{ rule, from, to }], added, refreshed, fields, kept: { measured, newer, own } }`. A figure that
|
|
176
|
+
changes can move a printed size: check the designs that use the set afterwards. So that a correction of yours is never
|
|
177
|
+
taken for an old figure, record it with `"kind": "measured"` (or today's date in `checked`).
|
|
178
|
+
|
|
151
179
|
## Links
|
|
152
180
|
|
|
153
181
|
`cad link <project>/<object>` (and `cad show`) prints three links to the model page (`viewUrl`; a public one by default):
|
|
154
182
|
view the model in a browser, or download its STL or 3MF as soon as the link opens. The model travels in the link's
|
|
155
183
|
fragment, which never reaches the web host, so the public page can open private designs. A link records exactly
|
|
156
184
|
which version it holds (`keyboard/keycap@0.1.0`, or `+changes` if it isn't a release). The page is `@rulecad/viewer`: host your
|
|
157
|
-
own copy anywhere and name it in `viewUrl`.
|
|
185
|
+
own copy anywhere and name it in `viewUrl`. When a workspace names a page other than the kit's own, `cad link` says
|
|
186
|
+
so in one line (on stderr), so that a workspace from elsewhere can't send your links to another site unseen.
|
|
158
187
|
|
|
159
188
|
- **Circuit boards:** a board's link also carries its fab zip, the same one `cad export` writes (Gerbers, drill files,
|
|
160
189
|
parts list, placement; plotted by KiCad where the board needs it). The page offers it as **Download for JLCPCB**. A
|
|
@@ -197,8 +226,13 @@ own copy anywhere and name it in `viewUrl`.
|
|
|
197
226
|
also checks the version; `"macropad/pcb@0.2.0"` reads that release. `cad rules` shows each borrowed number with the
|
|
198
227
|
object and version it came from; two objects can't read each other.
|
|
199
228
|
- `show`: on the rules card `cad show` hands its target (six at most). `interface`: other parts depend on it (versioning will compare these).
|
|
200
|
-
- `tweak: { min, max }`: may be changed with `--set`. Variables without one are fixed by their rule.
|
|
201
|
-
|
|
229
|
+
- `tweak: { min, max }`: may be changed with `--set`. Variables without one are fixed by their rule. On an assembly,
|
|
230
|
+
`--set <item>.<variable>=<value>` builds that object item at the value (`cad check`, `preview`, `export`, `show`,
|
|
231
|
+
`link`, `animate`, `cad list`, `wires` and `beams`); a name that is not one of the assembly's object items and that
|
|
232
|
+
object's variables is refused by name, never passed over. The commands that make a build from the file as written
|
|
233
|
+
(`kit`, `plates`, `order`, `frame`, `machine`, `plot`, `measured`) refuse `--set`: write the value with `cad set`.
|
|
234
|
+
- Inputs that hold names or text, not numbers (the design reads them; expressions can't), all settable with `--set`
|
|
235
|
+
and `cad set`, which keep the text as typed (`legend=007` stays `007`, never the number 7):
|
|
202
236
|
- `choice: ["dsa", "oem"]`: one of a list.
|
|
203
237
|
- `"type": "text"` (with `max`, characters): free text, e.g. a keycap's `legend`.
|
|
204
238
|
- `"type": "anchor"`: one of 9 places on a face, `tl tc tr / ml mc mr / bl bc br`, for placing a legend.
|
|
@@ -215,6 +249,9 @@ own copy anywhere and name it in `viewUrl`.
|
|
|
215
249
|
text so punctuation stays small, each straight stroke thickened to whole print lines, dots drawn round, and ↑ ↓ ← →
|
|
216
250
|
as arrows), `anchor(face, size, at)` (where something goes on a face, by anchor), and `cut(a, b)` (a subtract that
|
|
217
251
|
only touches a's faces near b; JSCAD's own splits every face along b's planes, which can leave slivers far away).
|
|
252
|
+
Its seats for bought parts, `shaftBore`, `bearingSeat`, `plainBearing` and `pulleyBore`, are reported by `cad check`
|
|
253
|
+
as `v.fixings`'s holes are (`seat.drawn`): what each was drawn to, the fit it rests on and that fit's kind (a press
|
|
254
|
+
fit on a shaft is an estimate until it is measured).
|
|
218
255
|
- `v.flexures`: compliant mechanisms (`@rulecad/flexures`): `leaf`, `fixedGuided`, `parallelGuide`, `serpentine`,
|
|
219
256
|
`notchHinge`, `bistable`, `livingHinge` as shapes, each with a `<name>Model(shape, { E })` giving its stiffness and the
|
|
220
257
|
strain at a travel, and `printable(shape, printer, material, model)` for how it prints. Drawn flat: bending along y,
|
|
@@ -226,7 +263,9 @@ own copy anywhere and name it in `viewUrl`.
|
|
|
226
263
|
print, and `engagement`, `seating` and `lengthFor` for first sums. Each reads the workspace's own thread set
|
|
227
264
|
(`rules/m3.json`) before the kit's, the project's printer and (for what a thread is in) its material, so a design
|
|
228
265
|
types no diameter and passes none. `cad check` lists what each call drew and the rule it rests on (`hole.drawn`,
|
|
229
|
-
`counterbore.drawn`, ...).
|
|
266
|
+
`counterbore.drawn`, ...). In an object that is not printed (`"role": "reference"` or `"board"`: a bought circuit
|
|
267
|
+
board, drilled by its maker), a hole is drawn to its rule's figure as it stands, with no hole compensation. A design
|
|
268
|
+
may also import `@rulecad/fixings` itself: then it reads the kit's sets only.
|
|
230
269
|
- `v.frames`: beams and profiles (`@rulecad/frames`): `profileModel` for a profile's figures, slots and faces
|
|
231
270
|
(`v.frames.profileModel('2020-misumi-hfs5').slots['slot-6-misumi'].opening`, to draw a tab that drops into a slot),
|
|
232
271
|
`slotModel`, `beamModel`, `beam` and `outline`. A profile measured into this workspace's `rules/` (`cad measure
|
|
@@ -249,8 +288,11 @@ own copy anywhere and name it in `viewUrl`.
|
|
|
249
288
|
was read from (`projects/p/project.json: the "printer" field "../x" is not a plain name`): a workspace's own files
|
|
250
289
|
cannot make the tool read or write anywhere but where it means to. In `"uses"`, another object is
|
|
251
290
|
`<project>/<object>`, optionally with `:<variant>` and `@<version>`, never a path to a file.
|
|
252
|
-
- Rules carry `kind`: spec (manufacturer), default (slicer), community (rule of thumb)
|
|
253
|
-
|
|
291
|
+
- Rules carry `kind`: spec (manufacturer), default (slicer), community (rule of thumb), estimate (a reasoned guess
|
|
292
|
+
nobody has measured yet), derived (worked out from other figures, such as a board's size read from its design file)
|
|
293
|
+
or measured (your own test print, which beats the rest), plus `source` and `checked`. `cad check` warns
|
|
294
|
+
(`rules.estimate`) when an object or an assembly rests on an estimate: a rule it reads, or a seat drawn to an
|
|
295
|
+
estimated fit (a press-fit `shaftBore`), naming each one to measure.
|
|
254
296
|
|
|
255
297
|
## Versions
|
|
256
298
|
|
|
@@ -260,11 +302,33 @@ Every object has its own semver version, kept as a git tag (`keyboard/keycap@1.2
|
|
|
260
302
|
- **major**: an earlier print may no longer fit. An `interface` variable changed or went away, including through a
|
|
261
303
|
rule it's built from (a new `x1c.hole_comp` widens the slot, so the keycap's slot changes: major).
|
|
262
304
|
- **minor**: something added that doesn't break fits: a new interface variable, a new tweakable option.
|
|
263
|
-
- **patch**: everything else: other variables, the shape's code, rules that don't reach the interface
|
|
305
|
+
- **patch**: everything else: other variables, the shape's code, rules that don't reach the interface, and any other
|
|
306
|
+
file the design reads (below).
|
|
307
|
+
|
|
308
|
+
A release records everything its design is built from, so that it can be rebuilt exactly and any later change to
|
|
309
|
+
one of those files asks for a new release. Its commit holds, and its tag names:
|
|
310
|
+
|
|
311
|
+
- the object's `.js` and `.json`, the rule sets in its `"uses"` and the layout files it can pick;
|
|
312
|
+
- the files of its project that its code imports (the starter template's `lid.js` imports `./box.js`);
|
|
313
|
+
- where it draws with `v.fixings` or `v.frames`, the workspace's own rule sets those read (thread, material and
|
|
314
|
+
profile sets, the printer's, and measured outlines in `rules/outlines/`), and the project's material and printer;
|
|
315
|
+
- the files of the objects it reads through `"uses"` (each one's own files, and what it reads), unless it names a
|
|
316
|
+
release of theirs (`"home/box@1.0.0"`), which is rebuilt from its own tag.
|
|
317
|
+
|
|
318
|
+
A release is rebuilt in `.versions/<project>/<object>@<version>/`, its files at the paths they have in the workspace,
|
|
319
|
+
with the rule sets, imports and other objects of its tag, never today's. `cad status` and `cad diff` compare each of
|
|
320
|
+
those files with the workspace's: a helper edited, a rule set measured again (`rules/m3.json`) or one added that its
|
|
321
|
+
fixings now read is a change to the part (`rules/m3.json changed`, `now reads rules/m3.json`), and a changed object
|
|
322
|
+
it reads counts through the numbers it takes from it. A release made before releases recorded this is rebuilt with
|
|
323
|
+
the files its code imports by a path (`./box.js`), and its rule sets as its tag holds them.
|
|
264
324
|
|
|
265
325
|
A lower `--bump` than the changes need is refused (`--force` overrides). Releases are logged in the project's
|
|
266
326
|
`CHANGELOG.md`. A project release (`cad release keyboard`) records the version of each object, and its bump is the
|
|
267
|
-
biggest of theirs
|
|
327
|
+
biggest of theirs: it writes `version` and `release` (each object's version) into the project's `project.json`, and
|
|
328
|
+
`cad set <project>` goes on working after it. A release is a git commit and tag, so the workspace must be in a git
|
|
329
|
+
repository (it may be a folder of a larger one) with a name and email address set (`git config user.name`, `git config
|
|
330
|
+
user.email`); `cad release` says what to run if either is missing. If git refuses the commit or the tag (a hook that
|
|
331
|
+
fails), the version and changelog are put back as they were, and the release can simply be run again. `cad printed` logs what you printed and how it came out in `prints.jsonl`; `cad history` shows
|
|
268
332
|
releases and prints together.
|
|
269
333
|
|
|
270
334
|
```sh
|
|
@@ -277,6 +341,61 @@ npx cad history keyboard/keycap
|
|
|
277
341
|
npx cad diff keyboard/keycap 1.0.0 1.1.0
|
|
278
342
|
```
|
|
279
343
|
|
|
344
|
+
### Measurements: `cad measured`
|
|
345
|
+
|
|
346
|
+
A figure measured on a test print goes back where the estimate was: `cad measured <project>/<assembly>
|
|
347
|
+
x1c.hole_comp=0.15` writes it into the workspace's copy of the rule set as `measured`, with the date and `--source`,
|
|
348
|
+
runs the assembly's checks before and after, and says what moved: each prediction with its figure before and after,
|
|
349
|
+
and each other finding whose words changed (the lid's hole measures 3.5 mm, now 3.55 mm). A finding is paired with
|
|
350
|
+
itself by its code and what it is about (the fasten, the fit's two parts, the join, the beam), so a fasten whose
|
|
351
|
+
screws come out in another order is still matched. A check's prediction is measured the same way (`c1.drop=0.4`,
|
|
352
|
+
`task.accuracy=0.8`). Each figure goes into the project's ledger, `projects/<project>/ledger.jsonl`, against what was
|
|
353
|
+
predicted; `cad history <project>/<assembly>` shows it.
|
|
354
|
+
|
|
355
|
+
A slip of the pen is refused before anything is written: an empty figure (`x1c.fit=`), a figure of the other sign
|
|
356
|
+
from the one it replaces, and one under half or over twice it (a tenth to ten times, for an estimate, which is a
|
|
357
|
+
guess the measurement is there to correct). A 0 goes in as typed for a figure a coupon in the kit measures, since
|
|
358
|
+
the coupons step either side of the kit's figure and some start at 0 (the fixings coupon's nut slots). A figure that
|
|
359
|
+
really is that far out goes in with `--force`. A figure
|
|
360
|
+
the coupon bounds by what a fit of its kind can be is held to that instead, and a drop or a sag is checked as it is
|
|
361
|
+
read.
|
|
362
|
+
|
|
363
|
+
A row written by mistake comes out of the ledger with `--strike <date> <name>` (`<name>=<figure>` where the ledger
|
|
364
|
+
has that name twice that day). The ledger and the rule set are separate files, so it says what the rule set still
|
|
365
|
+
holds: set that back yourself (`git checkout rules/x1c.json`, or `cad measured` with the right figure).
|
|
366
|
+
|
|
367
|
+
**Coupons.** The kit's test prints come into your workspace with `cad coupons`: it adds `projects/coupons`, with the
|
|
368
|
+
fixings coupon (pilots, insert holes, nut pockets and slots, printed threads), the holds coupon (snap pin sockets,
|
|
369
|
+
pins pressed and slipping, magnet pockets) and the slot coupon (tongues, carriers and printed slots for aluminium
|
|
370
|
+
beams), each with its figure beside every feature, and a `MEASURE.md` that says how to read each row and the command
|
|
371
|
+
that writes it back. A workspace that has the project already keeps it as it is. A coupon's figure needs no assembly:
|
|
372
|
+
`cad measured x1c.pilot_m3=2.9` writes it the same way, keeps its row in the workspace's own ledger, `ledger.jsonl`
|
|
373
|
+
(`cad history` alone shows it, `--strike` takes a row out), and has no checks to run either side; give an assembly
|
|
374
|
+
first to see what it moves there. The source written names the coupon's `MEASURE.md` in your workspace
|
|
375
|
+
(`projects/coupons/MEASURE.md`).
|
|
376
|
+
|
|
377
|
+
**Sending figures to the kit.** `cad measured --export` prints every figure measured in this workspace that the kit
|
|
378
|
+
does not hold yet (or holds as anything but a measurement checked that day or since) as a unified diff of the kit's
|
|
379
|
+
rule sets, `packages/rules/<set>.json`, the rest of each file as the kit has it: `npx cad measured --export >
|
|
380
|
+
measured.diff`, then send it with the printer and plastic to the kit's issues, or apply it to a copy of the repository
|
|
381
|
+
for a pull request. A set the kit has no file for (the joins set, a part of your own) is listed apart, on stderr, to
|
|
382
|
+
send as it is. `--json` gives the same as data.
|
|
383
|
+
|
|
384
|
+
`--table` lists what the assembly still assumes: every rule it reads that is an estimate, a community figure or a
|
|
385
|
+
default, with its figure, the coupon in the kit that measures it (marked where this assembly is that coupon), and how
|
|
386
|
+
to settle it; the figures a coupon in it measures that the rule set has no figure for yet; and each prediction its
|
|
387
|
+
checks make. `--json` gives the same rows as data, and `--out MEASURE.md` keeps the table in that file.
|
|
388
|
+
|
|
389
|
+
```sh
|
|
390
|
+
npx cad measured home/lidded-box --table # what to measure
|
|
391
|
+
npx cad measured home/lidded-box x1c.hole_comp=0.15 --source "fit bar, row 1"
|
|
392
|
+
npx cad measured home/lidded-box x1c.fit=0.5 --force # more than twice the 0.2 it replaces, and right
|
|
393
|
+
npx cad measured home/lidded-box --strike 2026-12-01 x1c.fit
|
|
394
|
+
npx cad coupons # the coupons, in projects/coupons, with MEASURE.md
|
|
395
|
+
npx cad measured x1c.pilot_m3=2.9 # a coupon's figure, with no assembly
|
|
396
|
+
npx cad measured --export > measured.diff # what you measured, to send to the kit
|
|
397
|
+
```
|
|
398
|
+
|
|
280
399
|
## Parts
|
|
281
400
|
|
|
282
401
|
`main()` can return named parts instead of one shape, described in the .json:
|
|
@@ -306,7 +425,9 @@ out. `--part cap` works on one part; `cad preview --explode` moves the parts apa
|
|
|
306
425
|
To fit something someone else made (a maker's connector, a part from a model site), measure their model rather than
|
|
307
426
|
guessing, then check your design against it.
|
|
308
427
|
|
|
309
|
-
`cad measure <model.stl|model.3mf>`
|
|
428
|
+
`cad measure <model.stl|model.3mf>` (and `cad match`) reads a model from anywhere as data, up to 2,000,000 triangles,
|
|
429
|
+
a 3MF's zip up to 512 MB unpacked and its objects placed up to 100,000 times: a file past a limit, a corner that is not
|
|
430
|
+
three numbers, or a 3MF triangle naming a corner its object hasn't got is refused, naming what is wrong. It finds the stretches along the model's longest axis (or `--along y`) where its
|
|
310
431
|
cross-section stays the same, numbers the distinct sections (a section seen again gets the same letter), and describes
|
|
311
432
|
each one: its extent and its height bands, the heights over which it has the same pieces across, split again at steps.
|
|
312
433
|
It draws every distinct section in `.preview/measure/`. `--line 0.6,2.5` reports where a line along the axis is inside
|
|
@@ -384,28 +505,68 @@ other items' variables, so a keycap can sit exactly where its slot meets the swi
|
|
|
384
505
|
`/explain`, `/schema`, `/errors`, `/optimise`, `/rules`, `/workspace`, `/versions`, `/layout`, `/preview`, `/targets`, `/threemf`.
|
|
385
506
|
- **Engines:** designs get `v.ops` (union, subtract, intersect): JSCAD's booleans by default, Manifold's (faster,
|
|
386
507
|
watertight; `npm install manifold-3d`) with `"engine": "manifold"` in the object's JSON or `CAD_ENGINE=manifold`.
|
|
387
|
-
- **Sandbox:** a
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
`
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
508
|
+
- **Sandbox:** a design (a board design's too) runs in a separate Node process under Node's permission model, with
|
|
509
|
+
none of your environment (no tokens), and an import hook on top to keep it to making shapes. What it can do there
|
|
510
|
+
depends on the Node it runs on:
|
|
511
|
+
|
|
512
|
+
| A design … | Node 22.13 to 22.14 | Node 22.15 to 24 | From Node 25 | What holds it |
|
|
513
|
+
|---|---|---|---|---|
|
|
514
|
+
| writes or deletes files | never | never | never | Node's permission model (no `--allow-fs-write`) |
|
|
515
|
+
| starts programs or loads addons | never | never | never | the permission model (no `--allow-child-process` or `--allow-addons`) |
|
|
516
|
+
| starts threads | never | never | never | the permission model (`--allow-worker` only where the hook needs one), and the runner, which shuts Node's modules to the design |
|
|
517
|
+
| reads files | only its project's files and the packages below, by importing them | the same | the same | the import hook, and below it the permission model, which holds a design that finds a way round the hook (through an allowed package's own CommonJS code, say) to the same folders: of the workspace only the design's own project, its `package.json` and the design's own cache folders (never another project; and since the permission model follows a link wherever it leads, a link anywhere in the project, its `node_modules` too, that leads to another project or out of the workspace stops the design before it runs, and a cache folder that holds a link is not read), and the tool, the `node_modules` folders above them and the packages designs use |
|
|
518
|
+
| imports | the packages below and its project's files: never Node's own modules, and never a CommonJS file (`.cjs`, or `require` and `module.exports`) | the same | the same | the import hook, and the runner, which shuts Node's own modules to the CommonJS loader before the design loads; those that reach the network, other programs or workers (`net`, `http`, `dns`, `child_process`, `worker_threads`, `vm` and the rest) load for no one at all, the tool's own code included |
|
|
519
|
+
| sends over the network | no way the tests know of | the same | never | from Node 25 the permission model (no `--allow-net`); before it, rulecad's runner alone (`fetch` and its kin are gone, none of Node's modules that reach the network loads, whoever asks, and the design's standard streams are plain ones with no socket behind them) |
|
|
520
|
+
|
|
521
|
+
The packages a design may import are <!-- ALLOWED -->`@jscad/modeling`, `@rulecad/shapes`, `@rulecad/flexures`,
|
|
522
|
+
`@rulecad/gears`, `@rulecad/motors`, `@rulecad/frames`, `@rulecad/fixings`<!-- /ALLOWED --> (the hook's own list,
|
|
523
|
+
`ALLOWED` in `lib/sandbox-hooks.mjs`), and no `node:` modules by `import` or `require()`. A design and its project's
|
|
524
|
+
files are ES modules (`import` and `export`): a CommonJS file of the project is refused before it runs, with
|
|
525
|
+
`designs can't load …: it is a CommonJS file`, as one could reach Node's own modules past the hook. Before Node 25
|
|
526
|
+
what keeps a design off the network is rulecad's own runner, in the design's own process, not Node: cad says so once
|
|
527
|
+
a run, `designs are kept off the network on Node 24 by rulecad alone, not by Node itself: use Node 25 or above for
|
|
528
|
+
designs you did not write`. Run only designs you trust, as with any code; from Node 25 Node itself holds the
|
|
529
|
+
writing, programs and network rows. (`test/sandbox-docs.test.mjs`, `test/sandbox-loader.test.mjs` and
|
|
530
|
+
`test/sandbox.test.mjs` try the writing, reading, importing, programs and network rows, and the ways round them, on
|
|
531
|
+
the Node they run on; the other rows rest on the Node flags they name.)
|
|
532
|
+
It reads by real paths: a `node_modules` link spelled through another link, as macOS spells its temporary folders
|
|
533
|
+
through `/tmp` and `/var`, is refused by name (make the link with the real path). A link inside the workspace that
|
|
534
|
+
leads out of it (a design's file, a folder of its project or a rule set in `rules/` that is a link to a file
|
|
535
|
+
elsewhere, which a workspace cloned from someone else can hold) is refused before the design runs, and whenever
|
|
536
|
+
rulecad reads one of the workspace's own files, with `workspace.outside` and the link's name, so no file of yours
|
|
537
|
+
elsewhere is read into a build or a model link; a kept result in `.cache/` that is such a link is not read but made
|
|
538
|
+
afresh. To share a file between workspaces, copy it into each, or put it in a package and install that (the
|
|
539
|
+
workspace's own `node_modules` is the packages', and may link anywhere). A target named in cad.config.json is held
|
|
540
|
+
to the same, by its real path. An import of a package must lead inside that package: a file of it is named by its
|
|
541
|
+
path there (`@jscad/modeling/src/primitives/index.js`), never with `..`, `.`, `node_modules`, a backslash, `%` or
|
|
542
|
+
`~`, and the file it finds must be the package's own, as rulecad finds it, or one in the project, so no path or link
|
|
543
|
+
climbs out of it to another file. A file of such a package may in turn import only what that package depends on (its
|
|
544
|
+
own tests' tools are refused).
|
|
545
|
+
It gets its values as data and returns its parts; what it prints
|
|
400
546
|
(`console.log`) comes out on stderr. What comes back is checked before it is used, since the design could have
|
|
401
547
|
written it itself: a reply that is not one rulecad makes stops the build with a `design.sandbox` message, and the
|
|
402
|
-
only files written from a reply are the cache's slow stages, each
|
|
403
|
-
form the cache makes
|
|
404
|
-
(
|
|
548
|
+
only files written from a reply are the cache's slow stages, each in the design's own folder of `.cache/stages/`,
|
|
549
|
+
which no other design reads, under a name of the form the cache makes, and at most 40 of them, 256 MB in all, a
|
|
550
|
+
build (a design that makes more is built all the same, the rest made again next time; a reply that hands back more
|
|
551
|
+
is refused). Each design's folder holds at most 512 MB, and `.cache/stages/` 2 GB in all: past a folder's limit its own
|
|
552
|
+
oldest files go, past the whole cache's the oldest of any design's, so many designs, or one built again and again, can't fill the disk either
|
|
553
|
+
(a stage that goes is worked out again next time). A design may run for an hour (3600 s) and its JavaScript may hold 4096 MB, its process 512 MB
|
|
554
|
+
more in all (Node itself, typed arrays, WebAssembly memory, output not yet sent): past any limit its process is
|
|
555
|
+
stopped and the build fails with `design.time` or `design.memory`, naming the design, so a design that loops for
|
|
556
|
+
ever or fills memory without end can't hang the command or take the machine down with it. What a design sends back
|
|
557
|
+
is kept only up to its memory limit, and what it prints only its last megabyte, so it can't fill the tool's own
|
|
558
|
+
process either. A slow design that needs more raises them in cad.config.json (`"designTimeout"` in seconds,
|
|
559
|
+
`"designMemory"` in megabytes; above the defaults, once the workspace is trusted with `cad trust`) or with
|
|
560
|
+
`CAD_DESIGN_TIMEOUT` and `CAD_DESIGN_MEMORY`, which win. A workspace that trusts its designs sets
|
|
561
|
+
`"sandbox": false` in cad.config.json (or `CAD_TRUST=1`); its designs then run in the tool's own process, without
|
|
562
|
+
either limit. Board designs (`"engine": "pcb"` in the object's JSON) run in the sandbox too, with the board
|
|
405
563
|
engine: the sandbox may then also read `@rulecad/pcb` and the packages it loads, the design reaches the engine only
|
|
406
564
|
as `v.pcb`, and it hands back its board's Circuit JSON, which is checked like the rest of a reply before the tool
|
|
407
|
-
makes the board's solid and files from it
|
|
408
|
-
|
|
565
|
+
makes the board's solid and files from it; the solid and the board's checks are made within the design's time
|
|
566
|
+
and memory limits. The routes the autorouter finds come back the same way and are written
|
|
567
|
+
to the design's own folder of `.cache/routes/`, read back by that board alone, each under a name of the form the
|
|
568
|
+
route cache makes (a route cache you share between workspaces with `RULECAD_ROUTE_CACHE` is read, never written,
|
|
569
|
+
from the sandbox; these folders hold at most 128 MB each, 512 MB in all). A board build takes a little longer for
|
|
409
570
|
it (a second process starts and loads the engine).
|
|
410
571
|
- **Trust, asked once:** what a workspace asks to run outside the sandbox isn't done until you run `cad trust` in it:
|
|
411
572
|
`"sandbox": false` or a target that is a module of its own (in cad.config.json). Only the kit's own targets, by their
|
|
@@ -417,7 +578,8 @@ other items' variables, so a keycap can sit exactly where its slot meets the swi
|
|
|
417
578
|
only its own designs in the tool's process: one from another folder (a path to it, or a link out) is refused. A
|
|
418
579
|
workspace held in memory (`memoryHost`, for tests and later a browser or an editor's server) runs its designs in the
|
|
419
580
|
same sandbox, through the host's `runDesign` (a copy of the design's project in a temporary folder, removed after),
|
|
420
|
-
and in the tool's own process only when `build` is called with `{ trusted: true }`.
|
|
581
|
+
and in the tool's own process only when `build` is called with `{ trusted: true }`. (`test/sandbox.test.mjs`,
|
|
582
|
+
`test/target-trust.test.mjs`, `test/board-trust.test.mjs` and `test/sandbox-limits.test.mjs` try each of these.)
|
|
421
583
|
- **Mistakes are named:** a design that reads a variable that isn't there (`v.widht`) stops with the name it
|
|
422
584
|
probably meant, not a shape drawn from `undefined`; errors in a design carry its file and line.
|
|
423
585
|
- **Units:** `cad check` warns where an expression mixes units (millimetres added to degrees, a sine of a length) or
|
|
@@ -493,15 +655,17 @@ starts and stops. From that the check says:
|
|
|
493
655
|
| Finding | What it checks |
|
|
494
656
|
|---|---|
|
|
495
657
|
| `fasten.holes` | One axis runs from under the head through every part: a hole 0.05 mm or more off it fails, with the distance |
|
|
496
|
-
| `fasten.
|
|
658
|
+
| `fasten.stack` | The parts lie face to face along the screw: walked from under the head, the far face of each is within 0.05 mm of the near face of the next. A gap fails, naming both parts and the gap, as the screw would be lengthened across air and clamp nothing (a part placed wrong). Where a fit between the two gives a range that holds the gap, the gap is meant, and it warns, naming the fit. A spacer that fills a gap is a part in `through`; a beam whose own material fills the gap (its slot's lips, clamped between a rail and a strip of nuts under them) is no gap |
|
|
659
|
+
| `fasten.slot` | Into a beam's slot: each screw over a slot's centre line within its hole's play, square to the face and along the beam, its nut's whole length in the slot: a nut that runs past an end of the beam fails, naming the end (see Fastening into a slot, under Beams) |
|
|
497
660
|
| `fasten.clearance` | Each part passed through has a clearance hole for the thread as drawn on this printer, between the close and the loose figure; it says what the hole measures and what it should be |
|
|
498
661
|
| `fasten.end` | The far end is a pilot, a hole to tap, a thread drawn to print, an insert's hole or a nut's seat of this thread (a pocket on the far face, or a slot across the screw partway along it, as `v.fixings.nutTrap` cuts), or a clearance hole with `nut`; into a motor, one of its own threaded mounting holes |
|
|
499
662
|
| `fasten.length` | The length chosen where none is given: the shortest sold length that fits the stack as measured (into a motor, the longest that stops short of the end of its thread). A given length is checked for reaching the far end, bottoming out in a blind hole (1 mm is kept at the tip) and standing more than a diameter proud |
|
|
663
|
+
| `fasten.wall` | The plastic round the far hole, side by side halfway along its first full-size stretch (where the thread is, not a bore it runs on into), where the screw forms its thread in a printed part or holds in an insert: the thinnest side is held to the thread set's `insert_wall` for an insert, and for a pilot, a tapped or a printed thread to the wall a boss `fixings.boss_diameter` across (twice the screw's diameter, a screw maker's guide) leaves round the hole as drawn. A thinner side warns, naming the side (`+y`) and the wall |
|
|
500
664
|
| `fasten.engagement` | The thread engaged at the far end against the rule for what it is in: the thread's `pilot_depth` or the engagement rule for the project's material, an insert's length, a nut's height; into a motor, its own thread's depth, and at least one diameter (`engagement.steel`, as `motor.mount` holds it). A short one names the length or the depth that would do |
|
|
501
|
-
| `fasten.seat` | The head (or its washer) has a flat seat as wide as itself and square to the screw, read under the head from the part; a countersunk head has a countersink of its angle. It says the force and torque the seat takes on the project's material (
|
|
502
|
-
| `fasten.torque` | A
|
|
665
|
+
| `fasten.seat` | The head (or its washer) has a flat seat as wide as itself and square to the screw, read under the head from the part; a countersunk head has a countersink of its angle. It says the force and torque the seat takes on the project's material and the most to tighten to: half that (`fixings.load_margin`, since the clamp a torque gives scatters by a quarter to a third) within a screw tightened fully, on a joint with a load or without, and for a screw in a thread in plastic the less torque that clamps with half what the thread is estimated to strip at. With `torque` it holds the pressure against the material's strength and names the washer that would bring it within |
|
|
666
|
+
| `fasten.torque` | A `torque` given, held against what it would break. A printed bolt: the clamp it is turned to (T = K d F with steel's nut factor, an estimate for a printed thread) against what the bolt breaks at, about twice over (`fixings.load_margin`); a turn that would break it fails, naming the most to turn it to. A steel screw into a thread made in the part itself (a pilot, a tapped or a printed thread), with a load on the joint or without: its clamp against what the thread is estimated to strip at; past half that it warns and past the whole of it it fails, naming the most to tighten to |
|
|
503
667
|
| `fasten.access` | A key or driver reaches the head along its axis, in the build pose: a cylinder as wide as the key across its corners, as long as its long arm (both from the `hexkey` set, ISO 2936; a hexagon head's socket adds `hexkey.socket_wall`, an estimate), clear of every other part. A part over the head that goes on after the screw passes, with the step it goes on at: `cad order` puts it after. One that must be there first (it comes earlier in the order, it is one of the joined parts, or it is no step at all) fails by name with how far over the head it is; where a ball-end key tilted up to `hexkey.ball_end_tilt` (25°) clears it, it warns instead |
|
|
504
|
-
| `fasten.load` | With `loads` or a motor's torque on the joint: what it holds up (the parts left with no other way to the first item, their masses, the loads hung on them, under the assembly's `gravity`, and the torque of a motor among them), shared between the screws as a group (`screwGroup` of `@rulecad/fixings`: shear by distance from the centroid, pull by a plane through it). The screw that takes the most is held against its proof load, the thread it is in against stripping, and the clamp against slipping, at
|
|
668
|
+
| `fasten.load` | With `loads` or a motor's torque on the joint: what it holds up (the parts left with no other way to the first item, their masses, the loads hung on them, under the assembly's `gravity`, and the torque of a motor among them), shared between the screws as a group (`screwGroup` of `@rulecad/fixings`: shear by distance from the centroid, pull by a plane through it). The screw that takes the most is held against its proof load, the thread it is in against stripping, and the clamp against slipping, at the preload of the one torque all the joint's screws are tightened to (`screwLoad`); where several hold the same margin to the hundredth it says they take the most alike; the margin is how many times the load it holds (for the thread, how many times the preload and the pull together), and under 2 it warns. With no `torque`, it says the torque that leaves the thread twice the preload and the pull, within half what the seat takes, so never more than half what the thread is estimated to strip at, and `cad order` tightens to that. It names the estimates it rests on (the nut factor, a plastic's shear strength, the friction) |
|
|
505
669
|
|
|
506
670
|
Every finding has `at` (under the head) and `between` (head to tip), so the viewer points at the screw. The screws,
|
|
507
671
|
nuts, washers and inserts are placed as reference parts from `@rulecad/fixings`: faint in previews, lifted along
|
|
@@ -557,10 +721,11 @@ draws its hole or pocket from the printer's rules:
|
|
|
557
721
|
|
|
558
722
|
`cad list` lists pins (printed, cut or bought) and magnets (bought) with their grams, and printed bolts among the
|
|
559
723
|
printed parts; `cad order` names each on its step. A fastener given as text (`"fastener": "push pin"`) is listed as
|
|
560
|
-
written, unchecked. The fits these rest on (`x1c.
|
|
561
|
-
`
|
|
562
|
-
|
|
563
|
-
|
|
724
|
+
written, unchecked. The fits these rest on (`x1c.pin_press`, `pin_slip`, `magnet_press`, `magnet_glue`,
|
|
725
|
+
`magnet_crush`, and a plastic's `strength_z`) are estimates until the holds coupon measures them (`x1c.snap_clearance`
|
|
726
|
+
is measured, on the launcher's fit test plate, and the coupon measures it again for your printer):
|
|
727
|
+
`cad coupons` adds it to your workspace with its `MEASURE.md` (rows 40 to 47), and `cad measured
|
|
728
|
+
x1c.pin_press=<figure>` writes the result back, refusing a figure no fit of its kind can be.
|
|
564
729
|
|
|
565
730
|
### Joints and poses
|
|
566
731
|
|
|
@@ -611,7 +776,12 @@ then y, then z, as `rotate` does.
|
|
|
611
776
|
along its x, teeth up +y) and its joint is anchored at its centre, along its axis. The check gives the ratio, the
|
|
612
777
|
contact ratio where the axes are and the centre distance (`mesh.centre`: closer than the gears need eats their backlash, and past it they jam; further adds backlash), the room under the tips (`mesh.tipClearance`, which shifted pairs lose),
|
|
613
778
|
each placed between the two axes, and measures the pair from its drawn teeth (`mesh.backlash`, `mesh.interference`,
|
|
614
|
-
kept in `.cache/gears/`); `--sweep` turns the train and looks for teeth that touch.
|
|
779
|
+
kept in `.cache/gears/`); `--sweep` turns the train and looks for teeth that touch. The centre distance is said
|
|
780
|
+
across the axes, so the check also finds each gear's teeth in its drawn parts (the points on its tip circle, a rack's
|
|
781
|
+
on its tip line) and says how much of the two faces meet along the driver's axis (`mesh.face`, "faces overlap X of
|
|
782
|
+
Y mm", Y the narrower face): 80 % or more passes, 50 to 80 % warns, under 50 % fails, as a gear anchored at the
|
|
783
|
+
wrong height or on the wrong step of a compound gear would. This overlap rule covers spur, internal and rack meshes;
|
|
784
|
+
worms and bevels are placed by their own checks. Both gears' axes sit on
|
|
615
785
|
one part, or on parts held still; planets on a carrier are a `planetary`.
|
|
616
786
|
- **Worms and bevels:** `"worm": true` (or `{ "diameter", "hand" }`) in a mesh makes the driving joint a worm and
|
|
617
787
|
this one its wheel, `teeth` [starts, the wheel's], the axes crossed at right angles; the check says the ratio,
|
|
@@ -655,13 +825,14 @@ then y, then z, as `rotate` does.
|
|
|
655
825
|
An item can be a motor instead of a printed object: `{ "id": "drive", "motor": { "model": "nema17", "drives": "elbow" }, "at": […], "rotate": […] }`. It comes from `@rulecad/motors`, is bought and not printed (a reference, in the assembly but never on a plate), and its anchors (`shaft`, `tip`, `face`, `horn`, `hole1` …) work in joints like any other. `set` changes a figure (`{ "holding_torque": { "value": 0.5, "kind": "measured", "source": "…" } }`), `speed` is the motor's speed (rpm), `margin` how many times over the torque must be (2 by default), `duty` the share of the time it runs.
|
|
656
826
|
|
|
657
827
|
- `"drives"`: the joint it turns, a revolute. The viewer's slider moves in a stepper's steps; a servo brings its range. Whatever follows that joint through a `mesh` or a `planetary` moves with it. `motor.axis` fails if its shaft isn't on the joint's axis.
|
|
658
|
-
- `"loads"` at the top of the assembly
|
|
828
|
+
- What a motor lifts is counted for you: the weight of every part it moves, as drawn (the printed parts by their volume and the project's material, the bought parts, a motor among them, by the mass their rules give), under gravity, which is down (`-z`) unless `"gravity": [0, -1, 0]` says otherwise, and the task's `payload` at its tool. `"loads"` at the top of the assembly add what is not drawn: `{ "mass": 0.2, "at": "forearm.tip" }` (kg, a mass carried at an anchor, whose torque at each joint comes from where the pose puts it), `{ "joint": "elbow", "torque": 0.5 }` (N m) or `{ "joint": "slide", "force": 12 }` (N), each torque or force added the way that makes it worse. Declare only what the drawing leaves out (the payload, a cable's drag): a mass declared for a part that is drawn is counted twice. A mass declared at the task's tool is taken to be its payload, so the two are counted once. The check runs the motor through its range and reports the worst, and each motor finding says what it counted (`counted: the parts' own 605 g, 10 g of payload, gravity down`, and `values.counted`).
|
|
659
829
|
- A compound planetary is a `planetary` with `"output": { "ring", "planet", "teeth" }`: a second ring on the planets' second step, following them in phase.
|
|
660
|
-
- `motor.torque`: what reaches the joint through the gears, against the load: a fail under 1 times, a warning under the margin. It says what its figures rest on. `
|
|
830
|
+
- `motor.torque`: what reaches the joint through the gears, against the load: a fail under 1 times, a warning under the margin. It says what its figures rest on. Its `values.available` and `values.needed` are in the joint's own unit, `values.unit`: N m about a revolute, N along a slide (a lead screw's or a belt's force); `values.shaft` is the torque at the motor's shaft.
|
|
831
|
+
- `motor.accel`: how fast the motor can speed up what it moves, from the same weight: the inertia of the parts and the payload reflected to the motor's shaft through the gears (divided by the ratio squared and the train's efficiency), plus the rotor's, against the torque left once the weight and the declared torques and forces are held. A revolute's is in °/s²; a slide's in mm/s², its mass through the lead's mm per radian (m (lead / 2π)², the usual motion-sizing figure), with gravity along the travel. It fails when the load leaves no torque at all (the joint stalls). A task's `task.time` reads it. `motor.speed`: how fast it moves and how long its range takes. Stages pass on `stageEfficiency` of the power (0.95 a mesh, an estimate).
|
|
661
832
|
- A stepper's torque at speed is worked out at its driver's supply: the volts of the assembly's bought supply item (`supply-12v`, `supply-24v`), or 24 V where it has none. A stepper's torque is flat to its corner speed, 60 V / (2 L I × full steps a turn), and falls as one over the speed past it, so a 17HS4401 at 300 rpm gives 0.269 N m at full current on 12 V against 0.283 on 24 V. `motor.torque` says the volts and the rpm it read (`values.supply`, `values.rpm`).
|
|
662
833
|
- `"have": true` on a motor or bought item marks it as in hand: `cad list` lists it under `Bought, in hand`, apart from what is to buy (and leaves it out of the bought cost), the kit's `buy.csv` gives it the kind `in hand`, and its build page a table of its own. A printed item is refused.
|
|
663
834
|
- `motor.holds`: with the power on (holding torque, or stall torque) and off (detent torque, a built-in gearbox's friction, a worm that locks, gears under 50% efficient, or `"brake": "a ratchet and pawl"` on the joint). Dropping with the power off is a warning: it may be what you want.
|
|
664
|
-
- `motor.mount`: the part a motor is fastened to (a `fasten` into the motor, or a fit that `fastens`), read as drawn: how thick it is at the screw holes against the screws' size, the screws' engagement in the motor's tapped holes (the screws as bought: their length past the plate, held to the motor's `mount_hole_depth`, at least one diameter, `engagement.steel`, or it fails; a motor item's `"screw"` may name a whole screw, `"M3x8 cap"`, to check that one), and the screws' bearing on the plastic under the motor's full torque. Its screws are counted in `cad list` and `cad order` (at the length sold that stays in the motor's thread, with the tool that turns them: a hex key in a cap screw, a socket or spanner on a hexagon head, `"M3x8 hex"`). Then the whole part bent, by FE on the part as drawn (cubes, two across the plate at the screws): the motor's weight at its centre, along `gravity` in the pose it's checked in, and its full torque (the larger of its working and holding torque), both carried into the plate where the screws clamp it. The part is held at the joint that carries it, if one does; else where it meets the printed parts it's fastened to that sit below it; failing both, on its lowest face. It reports how far the shaft's tip moves (against the driven joint's seat, where that is on the same part, since the two move together), against the printer's `fit` clearance (or the motor's `"deflection"` in mm), and the peak stress against the material's `strength`; under 2 times either fails, and says what fixes it: the plate thickness that would do (bending goes with its cube), ribs, or how much stiffer a material would have to be. Cells this coarse read a plate 10 to 20% stiff, and
|
|
835
|
+
- `motor.mount`: the part a motor is fastened to (a `fasten` into the motor, or a fit that `fastens`), read as drawn: how thick it is at the screw holes against the screws' size, the screws' engagement in the motor's tapped holes (the screws as bought: their length past the plate, held to the motor's `mount_hole_depth`, at least one diameter, `engagement.steel`, or it fails; a motor item's `"screw"` may name a whole screw, `"M3x8 cap"`, to check that one), and the screws' bearing on the plastic under the motor's full torque. Its screws are counted in `cad list` and `cad order` (at the length sold that stays in the motor's thread, with the tool that turns them: a hex key in a cap screw, a socket or spanner on a hexagon head, `"M3x8 hex"`). Then the whole part bent, by FE on the part as drawn (cubes, two across the plate at the screws): the motor's weight at its centre, along `gravity` in the pose it's checked in, and its full torque (the larger of its working and holding torque), both carried into the plate where the screws clamp it. The part is held at the joint that carries it, if one does; else where it meets the printed parts it's fastened to that sit below it; failing both, on its lowest face. It reports how far the shaft's tip moves (against the driven joint's seat, where that is on the same part, since the two move together), against the printer's `fit` clearance (or the motor's `"deflection"` in mm), and the peak stress against the material's `strength`; under 2 times either fails, and says what fixes it: the plate thickness that would do (bending goes with its cube), ribs, or how much stiffer a material would have to be. Cells this coarse read a plate 10 to 20% stiff, and the stress is read at the plate's surface (`@rulecad/fea`'s surface stress), about 5% low on two cells across; it's an estimate, said as one. Kept in `.cache/mount`.
|
|
665
836
|
- `motor.heat`: the motor's case against the softening point of the material the project prints in. Too hot says the current to set the driver to; the motor item's `current` set to it is read (the maker's rise at rated current, scaled by the current squared, as the heat is), so the check then passes.
|
|
666
837
|
- A `"shaft": true` fit (or `"press"`) between a motor and what it drives reads the bore from the part as drawn: that it's on the shaft (`shaft.seat`), that its flat is there (`shaft.flat`; the shaft turns to meet it, so where the flat faces doesn't matter), how much of the flat it grips (`shaft.grip`), and, pressed on, the hoop stress in the hub (`shaft.hoop`). `"slide"` holds the bore to a slide fit as printed (`shaft.slide`): the drawn gap less half the printer's `hole_comp` must leave the shaft clear, as a part printed in place needs, since it can't be pressed on.
|
|
667
838
|
- `cad preview --check` of an assembly with a motor writes `<assembly>-check.png`: the same six views, with a label at each joint the motor's torque passes through (what reaches it, and at the loaded joint the margin and whether it holds unpowered). The rest view never carries them.
|
|
@@ -682,7 +853,7 @@ walks one from a spec sheet to a checked box; this section is the reference. In
|
|
|
682
853
|
| `cad new <project>/<assembly> --assembly --frame box --inside 300,300,350 --profile 2020-misumi-hfs5` | A generated frame, expanded and checked as it is made (A frame from a size, below) |
|
|
683
854
|
| `cad set`, `cad move`, `cad remove` | A frame's fields, a beam moved by its ends, a beam taken out (refused, naming them, while joins use it) (Projects and assemblies, by command, above) |
|
|
684
855
|
| `cad frame <project>/<assembly>` | A generated frame's beams and joins (`--expand` writes them out; `--size` chooses the lightest profiles) |
|
|
685
|
-
| `cad check <project>/<assembly>` | The joins, screws and nuts, then the frame solved: `frame.deflection`, `frame.stress`, `frame.buckling`, `frame.rack`, `frame.frequency`, `frame.square`, `frame.heat`, `beam.printable`; `--sweep` slides each guide through its travel |
|
|
856
|
+
| `cad check <project>/<assembly>` | The joins, screws and nuts, then the frame solved: `frame.deflection`, `frame.stress`, `frame.buckling`, `frame.rack`, `frame.tip`, `frame.frequency`, `frame.square`, `frame.heat`, `beam.printable`; `--sweep` slides each guide through its travel |
|
|
686
857
|
| `cad list`, `cad beams` (`--jigs`), `cad order`, `cad plates`, `cad kit` | The cut list and what to buy, a sheet per beam and the jigs, the build from bars to a square frame, the printed parts on plates, and all of it in one folder (Building it, below) |
|
|
687
858
|
| `cad measured <project>/<assembly> frame.square.<bay>=<mm>` | A squared bay's diagonal difference, measured; the joint rig's and the beam coupon's figures the same way |
|
|
688
859
|
|
|
@@ -823,23 +994,35 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
823
994
|
caps it), and `join.stiffness` (the spring each join puts at a's end when the frame is solved, from
|
|
824
995
|
`@rulecad/frames`' `JOIN_STIFFNESS`: every figure an estimate until the joint rig measures it, and the finding says
|
|
825
996
|
which, measured with its date or an estimate).
|
|
826
|
-
- `join.drop` predicts a beam held by one join and nothing else, with a `mass` load on it (on the beam or
|
|
827
|
-
at one of its addresses)
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
997
|
+
- `join.drop` predicts the drop of a beam held by one join and nothing else, with a `mass` load on it (on the beam or
|
|
998
|
+
on an item at one of its addresses). A beam that something else also holds gets none: another join, a support or a
|
|
999
|
+
foot on it, or a fasten, a fit or a joint between it (or an item it carries) and a part it does not carry. Where the
|
|
1000
|
+
frame is solved on supports it is given (`"frame": { "supports" }`, or its feet), the drop is the frame's own: the
|
|
1001
|
+
load alone, with the join's spring, the same figure `frame.deflection` gives for that load alone, and the drop with
|
|
1002
|
+
the join held rigid, so the beam the join hangs from bends and turns in it too. Every other join whose spring comes
|
|
1003
|
+
from the same rule (another blind join, say) moves with it in that solve, as a figure written back moves them all. Where it is not (no supports said),
|
|
1004
|
+
the beam the join hangs from is taken as held along its length, as the joint rig's base beam is clamped to the
|
|
1005
|
+
bench, and only where it lies along the bench (its whole length at the assembly's lowest): the drop is then the
|
|
1006
|
+
beam's own bending, F L³ / 3 E I, and the join turning on its spring k, F L² / k, and the finding says it takes the
|
|
1007
|
+
base beam as held. On any other frame with no supports said the drop is not predicted, and the finding says to give
|
|
1008
|
+
them. It is a prediction `cad measured` takes as `<beam>.drop=<mm>`: it finds the join's spring that gives the drop
|
|
1009
|
+
read from the same model, solving the frame again at each step of a bisection over the spring (at most 80 solves),
|
|
1010
|
+
or from the rig's closed form, k = F L² / (drop less F L³ / 3 E I), and writes it as measured to the rule the spring
|
|
1011
|
+
came from. That is the kind's figure in the workspace's `rules/joins.json` (part `joins`, made from
|
|
1012
|
+
`@rulecad/frames`' estimates the first time: `blind_bending`, `end_tap_twist` and the rest, for a 20 mm profile), a
|
|
1013
|
+
printed fitting's share of its own stiffness by finite elements (`bracket_printed_share`), or a bought fitting's
|
|
1014
|
+
`bending_stiffness`. Its sentence becomes what was measured, and where (the joint rig, or the frame by name), and the
|
|
1015
|
+
drop goes in its source. A drop no more than the beam gives with the join rigid is refused, as is one more than the
|
|
1016
|
+
join could give a million times softer, and a refusal of any value writes nothing, not even the joins set's first
|
|
1017
|
+
copy. A spring is the same in every frame: measure it on the joint rig where you can, as a frame's own drop rests on
|
|
1018
|
+
everything else the frame's solve assumes too. The joint rig in `examples/bench/projects/benchmarks` (MEASURE.md,
|
|
1019
|
+
rows 34 to 37) is built for it, and also measures a slot nut's hold along its slot, written to the nut's own set as
|
|
1020
|
+
`hold_along`.
|
|
838
1021
|
- `cad add join <project>/<assembly> --kind blind --a y1.a --b x1.back@120 [--screw "M5 button"] [--fitting printed]`
|
|
839
1022
|
adds one.
|
|
840
1023
|
|
|
841
1024
|
**The frame solved.** `cad check` solves an assembly that has joins (or a `"frame"`) as a frame of beam elements
|
|
842
|
-
(`@rulecad/fea/frame`) and reports
|
|
1025
|
+
(`@rulecad/fea/frame`) and reports these findings:
|
|
843
1026
|
|
|
844
1027
|
- `frame.solve` says what the model holds: the beams, the nodes (each beam is cut where a join, a mounted item, a
|
|
845
1028
|
load, a named point or a support meets it), where it is held, the poses solved, and each join's spring with what
|
|
@@ -903,7 +1086,12 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
903
1086
|
`estimate` while any join's spring is one, even where the springs change no figure; `measured` when every join's
|
|
904
1087
|
is; `beams` with no joins); the rigid figure is the least the sag can be. The limit is a rail's own parallelism
|
|
905
1088
|
under a guide, else `"frame": { "limit": 0.2 }`, else the task's accuracy, else the beam's span over 360. Over it fails.
|
|
906
|
-
A sag is given in mm to three places, or to three figures under 0.1 mm (0.00123 mm, 0.000352 mm).
|
|
1089
|
+
A sag is given in mm to three places, or to three figures under 0.1 mm (0.00123 mm, 0.000352 mm). Where a beam of
|
|
1090
|
+
the frame is drawn printed, each sag is given after creep too: the frame solved again with the joins' springs, each
|
|
1091
|
+
printed beam bending as if at half its modulus (`PRINTED_DEFAULTS.creep_modulus`, an estimate), under every case but
|
|
1092
|
+
a motor stalled against its stop. The worse of the two is held to the limit, and the finding says so, 'after creep
|
|
1093
|
+
(estimate)' (`values.creep`, `refs.creep`). A printed 2020 cantilever 150 mm long with 4 kg at its middle sags 0.273 mm
|
|
1094
|
+
at first, within its 0.417 mm, and about 0.546 mm after creep: it fails.
|
|
907
1095
|
- `frame.stress`: the largest stress in each beam (axial and bending, from the section moduli) against its alloy's
|
|
908
1096
|
strength, and the bending moment at each join against what its printed fitting takes (its design load at its
|
|
909
1097
|
screw's distance from the corner, times its margin by finite elements). Under 2 times warns, under 1 fails. A join
|
|
@@ -926,6 +1114,22 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
926
1114
|
push by their joins' bending alone. A bay is four beams round a rectangle in one plane, each neighbouring pair
|
|
927
1115
|
joined to each other or both joined to one beam at one place (the top of a corner-post box, whose rails join the
|
|
928
1116
|
posts); its corners are the nodes where their axes cross.
|
|
1117
|
+
- `frame.tip`: whether a frame standing free tips over. A foot stands on a floor, which pushes it up and never pulls it
|
|
1118
|
+
down, but the solve holds each foot both ways, so no sag or sway says a frame would fall. This check takes what the
|
|
1119
|
+
feet give the frame summed, forces and moments (a fixed foot's moment is the floor pulling one side of it down too),
|
|
1120
|
+
which is its weight and what it carries whatever the joins' springs, and takes moments about each edge of the
|
|
1121
|
+
outline round its feet seen from above, each foot at its beam end's axis (a pad standing wider only holds it more).
|
|
1122
|
+
Under its weight alone, in any pose or case, a load that turns it over an edge fails, naming the feet it lifts and
|
|
1123
|
+
how much more its loads turn it than its weight holds it, in N·mm (`values.beyond`).
|
|
1124
|
+
Then each way `frame.rack` pushes it, both senses, the least push at the top that tips it: under `frame.rack`'s
|
|
1125
|
+
push (`"rack": { "load" }`, else `frame.push`, 20 N) it fails, naming the feet it tips over (`refs.on`), the feet
|
|
1126
|
+
that lift (`refs.lifts`), the push's turn and the weight's hold in N·mm (`values.overturning`,
|
|
1127
|
+
`values.restoring`), the push's height above the feet (`values.arm`) and the push that tips it (`values.tips`);
|
|
1128
|
+
else it passes with the same figures. A 2020 box 200 x 200 x 940 weighs 24.8 N and tips at
|
|
1129
|
+
24.8 x 90 / 930 = 2.4 N. `frame.rack` gives that push beside its sway (`values.tips`). A frame held where
|
|
1130
|
+
`"frame": { "supports" }` says is taken as bolted or clamped down, both ways, and is not checked: `frame.tip` says
|
|
1131
|
+
so (info); give it feet to have it checked standing free. Feet in one line (a portal) tip over the ends of the
|
|
1132
|
+
line; across it only their pads would hold it, which the model does not have, and `frame.tip` says so (info).
|
|
929
1133
|
- A panel (not a door) on a bay of the frame is a shear web in the model: one diagonal bar across the bay, free to bend
|
|
930
1134
|
at both corners (a ball at one, pinned at the other, so it carries no twist and nothing in it spins free when the
|
|
931
1135
|
modes split it into pieces), as stiff along it as the sheet in shear in series with its clips' grip. The clips' grip
|
|
@@ -952,14 +1156,23 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
952
1156
|
height. The frame is solved again with that beam printed and every other as it is, and the beam is held to six
|
|
953
1157
|
margins, each 1 where it just holds: every sag the frame checks (each load's point, each named point, each guide)
|
|
954
1158
|
and the beam along its length, against the same limits as `frame.deflection`; its stress against its strength with
|
|
955
|
-
twice the margin;
|
|
1159
|
+
twice the margin; the whole frame's buckling with it printed, solved as `frame.buckling`'s second finding is (each
|
|
1160
|
+
beam cut in four, in the case that squeezes it most) with twice the margin, or within 2% of the frame as drawn where
|
|
1161
|
+
that already buckles under twice its load (Euler's load for the beam alone with both ends pinned is given in words
|
|
1162
|
+
only: a post fixed at its foot and free at its top buckles at a quarter of it, and the whole frame's solve takes that
|
|
1163
|
+
in; where that solve is not found, the beam is taken free to sway at one end, at that quarter); its stress against
|
|
1164
|
+
the creep limit; every sag again with the
|
|
956
1165
|
beam's modulus at half (`PRINTED_DEFAULTS.creep_modulus`, an estimate), its sag as it creeps; and where the task's
|
|
957
1166
|
moves shake the frame, its lowest mode at twice their rate. The least is the beam's margin. Where the frame as drawn
|
|
958
1167
|
already misses a sag (`frame.deflection` fails there in the beams' own material), that is no fault of printing: there
|
|
959
1168
|
the printed beam is held to the drawn frame's own sag and 2% more, so it misses only where printing it makes that
|
|
960
|
-
sag worse, and the frame's finding names each such point (`refs.missed`)
|
|
961
|
-
|
|
962
|
-
|
|
1169
|
+
sag worse, and the frame's finding names each such point (`refs.missed`), saying where `frame.deflection` fails too
|
|
1170
|
+
and where it does not look: it checks the load points, named points and guides, not each beam along its length. A
|
|
1171
|
+
beam that holds says so (pass), with its pose and grams; one that does not says it needs its own material and the
|
|
1172
|
+
margin it misses by, `1 / margin`, and on what (info: a design choice, not a fault). A beam drawn printed is tried as
|
|
1173
|
+
it is drawn, in its own plastic, and stays printed: one that misses says so, and that a deeper section, a shorter
|
|
1174
|
+
span or a metal beam would hold. A 2020 post 400 mm tall fixed at its foot with 30 kg on its top, tried in PLA,
|
|
1175
|
+
buckles at about 315 N against its 295 N, 0.53 of the twice wanted: it misses. It also names the joins that would need changing: a
|
|
963
1176
|
blind, end-tap or anchor join screws into the beam's end, where a printed beam has an insert, and a join on a face
|
|
964
1177
|
other than the top lands where a printed beam is closed; a bracket or a gusset on its top slot takes either. Then
|
|
965
1178
|
the beams that hold alone are printed together and solved once more, any that miss together put back the worst
|
|
@@ -990,6 +1203,7 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
990
1203
|
| Sag limit with nothing tighter | span / 360 | International Building Code, Table 1604.3, floor members under live load (as reproduced in 780 CMR 1604.3) |
|
|
991
1204
|
| Beam stress | \|N\| / A + \|My\| / Wy + \|Mz\| / Wz | Beam theory; the section moduli from the profile's rule set |
|
|
992
1205
|
| A beam in compression | P = π² E I / L² (both ends pinned) | Euler's column; Roark's Formulas for Stress and Strain, 7th ed., table 15.1, case 1a |
|
|
1206
|
+
| A post fixed at its foot, free at its top (beam.printable, where the frame's buckling is not found) | P = π² E I / (2 L)², a quarter of the pinned load | Roark's Formulas for Stress and Strain, 7th ed., table 15.1, case 1b; else the whole frame's buckling factor |
|
|
993
1207
|
| A printed fitting's moment | design load × its distance from the corner × its margin | The fitting's own finite-element margin at its design load, scaled linearly |
|
|
994
1208
|
| The solve | Timoshenko beam elements, end springs condensed out | `@rulecad/fea/frame` (its README lists its sources) |
|
|
995
1209
|
| Sway limit with nothing tighter | height / 400 | ASCE/SEI 7-22, Commentary to Appendix C, CC.2.2: drift limits in common use are 1/600 to 1/400 of the height |
|
|
@@ -1003,12 +1217,12 @@ address stands for the faces near it, as `item@anchor` does (`"within"`, 10 mm b
|
|
|
1003
1217
|
| A bay's diagonal difference to accept (frame.square) | Σ t × span / d over the beams that set the opening, plus Σ s × span / d over its joins; root-sum-square beside it | The derivative of d = √(w² + h²) with a side, ∂d/∂w = w / d; stacked as an arm's error budget stacks its joints |
|
|
1004
1218
|
| A join's play s (frame.square) | 0.1 to 0.3 mm by kind; end-tap 0.25 mm | `JOIN_PLAY` in `@rulecad/frames`, estimates; end-tap is half ISO 273's medium clearance for M5 (5.5 mm) |
|
|
1005
1219
|
| A beam's twist at the tool | twist per metre × length × π / 180 × the tool's distance from the beam's axis | The profile's `twist_per_metre` (MISUMI's JIS special grade figure for its 2020 HFS5) |
|
|
1006
|
-
| A frame's growth (frame.heat) | α L ΔT, α
|
|
1220
|
+
| A frame's growth (frame.heat) | α L ΔT, α each beam's material's `expansion` | The material's set: Hydro's EN AW-6063, 6060 and 6005A sheets (23.5, 23.4, 23.3e-6 /K), item's (23.6), EN 1993-1-1 for S275 (12), the figures quoted from ASM's pages for 6061, 7075, 304 and Ti-6Al-4V (community); the plastics' are estimates (no maker's sheet gives one: PLA 68, PETG 60, ABS and ASA 90, TPU 150, PAHT-CF 23e-6 /K). Where a set gives none, 23.4e-6 /K, 6063's (FRAME_HEAT.expansion, community) |
|
|
1007
1221
|
| A printed beam's creep limit | 0.15 × its strength for its pose | Waseem et al. (2020), Polymers 12, 2962: printed PLA held at 0.3 of its strength broke in 1.2 to 2.3 hours; half that share an estimate |
|
|
1008
1222
|
| A printed beam's sag as it creeps | the frame solved with its modulus × 0.5 | An estimate (`PRINTED_DEFAULTS.creep_modulus`), until a sustained load on the beam coupon measures it |
|
|
1009
1223
|
| The beam coupon's sag, between two bars L apart | F L³ / (48 E I) | Roark's Formulas for Stress and Strain, table 8.1, case 1e (simply supported, load at the middle) |
|
|
1010
1224
|
| The beam coupon's modulus and strength | E × sag predicted / sag measured; stress of its own weight + stress per kg × kg at break | The solve is linear in E and in the load |
|
|
1011
|
-
| A printed fitting's softening | the plastic's heat deflection temperature, ISO 75 at 0.45 MPa, warned within 10 °C | The plastic's set (`pla.softening` 57 °C, `petg.softening` 69 °C, Bambu's data sheets); the 10 °C an estimate |
|
|
1225
|
+
| A printed fitting's or beam's softening | the plastic's heat deflection temperature, ISO 75 at 0.45 MPa, warned within 10 °C | The plastic's set (`pla.softening` 57 °C, `petg.softening` 69 °C, Bambu's data sheets; `abs.softening` 100 °C, Polymaker's PolyLite ABS sheet); the 10 °C an estimate |
|
|
1012
1226
|
|
|
1013
1227
|
A worked check: a 2020 shelf frame, legs 400 mm, a 600 mm front beam joined blind to the legs 390 mm up, 5 kg at its
|
|
1014
1228
|
middle, sags 0.215 mm by hand with the joins rigid (a beam whose ends turn with the corners the legs and the side
|
|
@@ -1046,6 +1260,9 @@ a brace in both bays that way about 240 times ("frame checks: an open cube racks
|
|
|
1046
1260
|
not only the nearest: a head between the nuts and an end closed further along closes that way as much as the end,
|
|
1047
1261
|
and the finding names each, with an item placed at that end (`foot1 off until then`). Where joins close both ways,
|
|
1048
1262
|
the check fails and names the nut of that thread that goes in through the opening (`give "nut": "drop-in"`).
|
|
1263
|
+
Each nut takes its length of the slot, half either side of its screw (the nut set's `length`): two nuts whose
|
|
1264
|
+
lengths overlap, or a nut that runs under the head of a blind join in that slot (the head taken at its width), fail by name with how far, and a nut
|
|
1265
|
+
that runs past the beam's end fails as `fasten.slot`.
|
|
1049
1266
|
- `frame.preload`: nuts with a way in that a join closes and no way that stays open (the other end capped by an item
|
|
1050
1267
|
placed there, such as a foot) go in before that join is made. The finding names the beam, the slot, the end, the
|
|
1051
1268
|
nuts and the join, and `cad order` and the build page list them as the step before the one that makes it
|
|
@@ -1068,9 +1285,11 @@ a brace in both bays that way about 240 times ("frame checks: an open cube racks
|
|
|
1068
1285
|
cuts and joins allow passes, more warns that the bay leans. The build page's bays carry the same figures.
|
|
1069
1286
|
- `frame.heat`, where the assembly gives `"frame": { "heat": { "air": 45, "built": 20, "heaters": [{ "name": "bed",
|
|
1070
1287
|
"at": [150, 150, 60], "temperature": 60, "reach": 40 }] } }`: the frame grows from the air it was built in (`built`,
|
|
1071
|
-
20 °C where left out) to the air it runs in by its
|
|
1072
|
-
span of its beams each way
|
|
1073
|
-
|
|
1288
|
+
20 °C where left out) to the air it runs in by its material's expansion, ΔL = α L ΔT, for each beam and for the
|
|
1289
|
+
span of its beams each way, the span at the largest of its beams' figures (α from the alloy's or plastic's set,
|
|
1290
|
+
`expansion`, which every set of the kit's metals and plastics gives; else 23.4e-6 /K for 6063, a community figure).
|
|
1291
|
+
A frame of one material grows alike every way, so it stays square; one of several says how far its beams grow apart
|
|
1292
|
+
over the longest. Each printed fitting, and each printed beam, is held to its plastic's
|
|
1074
1293
|
`softening` (the heat deflection temperature its set gives, ISO 75 at 0.45 MPa) at the air's temperature, or a
|
|
1075
1294
|
heater's where its drawn parts come within the heater's `reach` of its middle: over it fails, within 10 °C of it
|
|
1076
1295
|
warns (`FRAME_HEAT.margin`, an estimate), and the rest pass in one finding naming the nearest. Bad input is refused by
|
|
@@ -1078,8 +1297,9 @@ a brace in both bays that way about 240 times ("frame checks: an open cube racks
|
|
|
1078
1297
|
- A blind or end-tap join's head on a slot's lips: `fasten.seat` gives what the lips take, the head's circle less the
|
|
1079
1298
|
strip of the opening across it (A = π D² / 4 - 2 (c √(R² - c²) + R² asin(c / R)), R half the head, c half the opening), at the beam alloy's strength, and the torque for that force (T = K d F, the nut
|
|
1080
1299
|
factor an estimate), or the screw tightened fully where that is less. An M5 button head on a MISUMI 6 mm slot:
|
|
1081
|
-
17.9 mm² of al6n01-t5 at 205 MPa takes 3677 N, 3.68 N m
|
|
1082
|
-
|
|
1300
|
+
17.9 mm² of al6n01-t5 at 205 MPa takes 3677 N, 3.68 N m, and it is tightened to half that, 1.83 N m at most
|
|
1301
|
+
(`fixings.load_margin`: a torque's clamp scatters by a quarter to a third). The lips' bending is not counted: an
|
|
1302
|
+
estimate, until the joint rig (issue 264) measures one.
|
|
1083
1303
|
|
|
1084
1304
|
### A frame from a size
|
|
1085
1305
|
|
|
@@ -1102,12 +1322,14 @@ screws, the cut list, the frame checks, the build page) sees a hand-drawn frame.
|
|
|
1102
1322
|
joint `gantry`, with the poses `gantry-front` and `gantry-back`) or `shelf` (a box with `"shelves"` rings between,
|
|
1103
1323
|
default 1, spacing its height into equal clear bays). Beams across x are `x1`, `x2` .., along y `y1` .., by ring
|
|
1104
1324
|
from the bottom. The frame's outside starts at the origin.
|
|
1105
|
-
- `"inside"` is the clear volume it encloses, `[width, depth, height]` in mm; `"outside"` is the volume
|
|
1106
|
-
in
|
|
1325
|
+
- `"inside"` is the clear volume it encloses, `[width, depth, height]` in mm; `"outside"` is the volume the whole
|
|
1326
|
+
frame must fit in, its feet and end caps with it, so its beams come out smaller by what those add (refused on castor
|
|
1327
|
+
plates, whose castor is not drawn). Give one, as numbers. A portal takes `[width, height]`. `cad frame` says the
|
|
1328
|
+
whole frame's size, its feet and caps fitted, beside the beams'. A table's height is the clear height under its ring, a gantry's
|
|
1107
1329
|
under its side beams.
|
|
1108
1330
|
- `"profile"`: one square profile for every beam (2020, 3030, 4040 ..). A profile of two cells (2040) is refused:
|
|
1109
1331
|
its beams would face differently by how they lie.
|
|
1110
|
-
- `"join"` sets the corners, as a kind or `{ "kind", "fitting", "screw", "nut" }`. With a join against a face (`blind`,
|
|
1332
|
+
- `"join"` sets the corners, as a kind or `{ "kind", "fitting", "screw", "nut", "estimate" }`. With a join against a face (`blind`,
|
|
1111
1333
|
`end-tap`, `bracket`, `gusset`, `hidden`, `anchor`) the upright beams run through, top to bottom, and every other
|
|
1112
1334
|
beam butts against their faces, so it is shorter than the outside span it closes by the profile's width at each
|
|
1113
1335
|
end. With `cube` every beam butts into a corner node and is as long as the inside it bounds. A box round 300 x 300
|
|
@@ -1119,12 +1341,20 @@ screws, the cut list, the frame checks, the build page) sees a hand-drawn frame.
|
|
|
1119
1341
|
takes the first of `drop-in`, `roll-in`, `hammer` and `t-bolt` the kit has for the profile's slot (drop-in on
|
|
1120
1342
|
MISUMI's 2020, roll-in on item's 4040); `"nut"` names one of them, and `slide-in` is refused. A printed gusset lies
|
|
1121
1343
|
on the face of its upright that looks out of the frame (its join's `"face"`), so it never lands where the corner's
|
|
1122
|
-
third beam butts.
|
|
1123
|
-
|
|
1344
|
+
third beam butts. A join the kit cannot build is refused by name, saying what is missing: `cube` (its three-way
|
|
1345
|
+
corner comes with a later release), and `bracket`, `gusset`, `hidden` or `anchor` with no fitting (a printed one,
|
|
1346
|
+
or a bought set by name). `"estimate": true` (`cad new ... --estimate`) makes it all the same, each join warning
|
|
1347
|
+
`join.fitting` that no fitting is drawn, as a hand-drawn join does. A join that holds by slots is refused on a
|
|
1348
|
+
profile with none (a tube, a bar, an angle), and a blind or end-tap join on an inside too narrow for the taps at
|
|
1349
|
+
both ends of its butting beams (37 mm in 2020).
|
|
1124
1350
|
- A gantry's outside height is its inside plus three widths: the two rings and `g`, which lies on the top side beams
|
|
1125
1351
|
between the uprights' tops, its top level with theirs.
|
|
1126
|
-
- `"feet"`: `foot`, `levelling
|
|
1127
|
-
|
|
1352
|
+
- `"feet"`: `foot`, `levelling` or `stacking` (printed), a bought foot's set by name, or a printed castor plate,
|
|
1353
|
+
`{ "kind": "castor", "holes": [100, 40], "thread": "M6" }` (the castor's bolt holes' spacing and bolts from its
|
|
1354
|
+
maker's drawing, and `"top"`, its top plate's thickness, 3 mm where left out, an estimate), under the upright beams'
|
|
1355
|
+
lower ends; `"castor"` alone is refused, naming holes and thread. A castor plate's four bolts, with their nuts and
|
|
1356
|
+
the washers their seat on the plastic needs, go on `cad list`, and its `fitting.seat` finding gives the torque to
|
|
1357
|
+
tighten them to. A printed foot, levelling foot, castor plate or stacking foot is screwed into its upright's end: the end is
|
|
1128
1358
|
tapped as the foot's model says (an M5 tap 18.5 mm deep in 2020) and a `fasten` holds it (an M5x16 cap screw), so
|
|
1129
1359
|
the tap is on the sheet, the screw on the list and its step in the build. Where the join drills the uprights
|
|
1130
1360
|
(`blind`, `end-tap`, `hidden`, `anchor`: an access or clearance hole at the bottom ring's centre line), the bottom
|
|
@@ -1133,7 +1363,9 @@ screws, the cut list, the frame checks, the build page) sees a hand-drawn frame.
|
|
|
1133
1363
|
beside its body (`cad plates`, `cad list`) and screwed in by hand. `"caps"`: the other open ends take printed end caps (`true`, the default), a bought end cap's
|
|
1134
1364
|
set by name, or nothing (`false`, and `join.end` names them).
|
|
1135
1365
|
- `"braces"`: the upright sides (`front`, `back`, `left`, `right`) whose corners are stiffened against racking: each
|
|
1136
|
-
|
|
1366
|
+
corner of that side keeps the join asked for and gains a printed corner bracket beside it, on drop-in nuts, so
|
|
1367
|
+
bracing a side only stiffens it (where the join is a printed bracket already, that bracket is drawn braced; a
|
|
1368
|
+
bracket join that is bought, or not chosen yet, is refused with braces). `"panels"`: `{ "sheet", "thickness", "sides" }`,
|
|
1137
1369
|
one sheet over each side named (every side with a bay by default), on drop-in nuts.
|
|
1138
1370
|
- Refused by name, before anything is built: no size or both, a size that leaves no room for the beams, a profile
|
|
1139
1371
|
that is not square, a join no generator arranges (mitre, splice, pivot, a printed node), a blind join on a profile
|
|
@@ -1181,17 +1413,25 @@ joins' springs, the loads and mounted items):
|
|
|
1181
1413
|
table's four legs are one group and each pair of rails another.
|
|
1182
1414
|
- Joins that fit: a design is only solved where every join of a grouped beam still goes together with the profiles
|
|
1183
1415
|
chosen. A blind join needs a bore in a's end and a slot in b's face whose opening passes the bore's screw and holds
|
|
1184
|
-
its button head under the lips, the head no wider than the slot is under them
|
|
1416
|
+
its button head under the lips, the head no wider than the slot is under them, and a straight hex key that reaches
|
|
1417
|
+
the head through the access hole across b (OpenBeam's slot floor, slanting down to a narrow groove, stops a 2 mm
|
|
1418
|
+
key short of an M3 head in its own slot); an end-tap join a bore in a's end,
|
|
1185
1419
|
and a cap head wider than the opening of a slot on b's far face; a bought fitting must fit both profiles (its set's
|
|
1186
|
-
`fitting.fit`). A printed fitting is drawn for the profiles it joins
|
|
1420
|
+
`fitting.fit`). A printed fitting is drawn for the profiles it joins; a pair of profiles it cannot be drawn for is a
|
|
1421
|
+
join that does not go together. A group whose next lighter profile breaks a
|
|
1187
1422
|
join says so as what set it ("set by a join": with 1515-openbeam, an M5 screw from a 2040's bore does not pass
|
|
1188
1423
|
OpenBeam's 3.2 mm slot opening).
|
|
1189
1424
|
- Racking: where the assembly gives `"frame": { "rack" }` or `"limits": { "rack": mm }`, each way across the side
|
|
1190
1425
|
push `frame.rack` uses, alone and with no weight, is a case of its own, and the sway at each top node is held to
|
|
1191
1426
|
the limit `frame.rack` uses (or `limits.rack`). A way nothing holds the frame (one plane on pinned feet) is said and
|
|
1192
|
-
left out: a brace or fixed feet hold it, not a profile.
|
|
1193
|
-
|
|
1194
|
-
|
|
1427
|
+
left out: a brace or fixed feet hold it, not a profile. A frame that racks on its joins' bending may meet the limit
|
|
1428
|
+
with no profile in the list: the sizing then gives the nearest and says racking is what it misses.
|
|
1429
|
+
- Join springs follow the profile: each profile tried is solved on the springs its own joins would have, worked out
|
|
1430
|
+
as `cad check` works them out for a frame drawn in it. A blind or end-tap join's estimate grows as the cube of its
|
|
1431
|
+
beam's width over 20 mm (a 4040's is eight times a 2020's); a bought fitting keeps its set's own figures; a printed
|
|
1432
|
+
fitting is drawn again for the new profiles and its stiffness found by finite elements. Each is worked out once a
|
|
1433
|
+
pair of profiles. So a frame whose sag rests on its joins (a cantilever, an open frame) is not sized down onto a
|
|
1434
|
+
heavier profile's stiffer joins, nor refused a heavier profile on a lighter one's softer joins.
|
|
1195
1435
|
- `"limits"`: in place of the checks' own. Left out, each is the check's: the sag at each load, named point and guide
|
|
1196
1436
|
as `frame.deflection` holds it (a guide's rail parallelism, `frame.limit`, the task's accuracy, else the span over
|
|
1197
1437
|
360; a load that moves with a joint anywhere along its beam), each beam's stress with the joins' springs and with
|
|
@@ -1202,7 +1442,12 @@ joins' springs, the loads and mounted items):
|
|
|
1202
1442
|
- `"by"`: `mass`. No profile set in the kit gives a price per metre yet, so `cost` is refused by name.
|
|
1203
1443
|
|
|
1204
1444
|
`cad check` gives `frame.size`: each group's profile, its mass, the limit that set it and how many times inside that
|
|
1205
|
-
limit it stands.
|
|
1445
|
+
limit it stands. The stress limit cannot reach a member with no strength or no section modulus: each join's rigid
|
|
1446
|
+
link, each panel, a beam whose alloy gives no strength. Those it passed over are said once, as
|
|
1447
|
+
`frame.size.unchecked` (info): `the stress limit does not reach 12 join links (no strength and no section modulus):
|
|
1448
|
+
their stress is not checked by the sizing` (`frame.stress` holds each join's moment against its fitting's strength, where the kit gives one);
|
|
1449
|
+
`--size` prints the same under its limits, and `--json` lists them as `unchecked`. `cad frame <project>/<assembly>
|
|
1450
|
+
--size` prints the table:
|
|
1206
1451
|
|
|
1207
1452
|
```
|
|
1208
1453
|
sized: 3.348 kg of grouped beams (drawn 2.74 kg), 14 designs solved (every design ranked by mass)
|
|
@@ -1225,12 +1470,17 @@ beam's end that butts against a face moves with that face as the other beam chan
|
|
|
1225
1470
|
join at an end that now has two bores (a 2040) becomes a join a bore. A drawn beam whose new depth would stand past
|
|
1226
1471
|
the end of the beam it meets (a rail flush with its legs' tops, now a 2060) moves along that beam by as much, so its
|
|
1227
1472
|
face there stays where it was, if the move fits at its other end too; where it does not, nothing is written and the
|
|
1228
|
-
refusal names the join and the beam. Otherwise beams keep their lines.
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1473
|
+
refusal names the join and the beam. Otherwise beams keep their lines. A printed foot on a beam's end takes the new
|
|
1474
|
+
profile's end bore: its tap and its fasten's screw are worked out again from the foot for that profile (a 1515's M3,
|
|
1475
|
+
not the 2020's M5 it was drawn with). Where every beam already has the profile chosen for it, nothing is written, and a
|
|
1476
|
+
generated frame stays generated. Before it writes, `--write` checks the design it would write as `cad check` does (with
|
|
1477
|
+
`--dry-run` too), and writes nothing that would fail: it names the failing checks, the first of them in full, so fix
|
|
1478
|
+
what they name or leave the profile that breaks them out of the list. The sizing holds each join to its slot (the
|
|
1479
|
+
screw through the opening, the head under the lips, and a blind join's hex key able to reach the head through its
|
|
1480
|
+
access hole); the check holds every screw, nut, length and seat.
|
|
1481
|
+
|
|
1482
|
+
What it rests on: the joins' springs are estimates until the joint rig measures them, each worked out for the
|
|
1483
|
+
profiles tried; the sizing solves the drawn layout, with each beam's line where it is drawn, so a figure on the
|
|
1234
1484
|
written frame differs a little (the table in HFS5, its 2040 rails lowered 10 mm to keep its top level, sags 0.87 mm
|
|
1235
1485
|
at a long rail's middle as sized and 0.83 mm as written). With 512 designs or fewer every one is ranked by mass and the first that meets the limits is the
|
|
1236
1486
|
lightest; with more, the search goes by steps and lands near the lightest. Racking (`frame.rack`) is not a sizing
|
|
@@ -1249,7 +1499,14 @@ limit: it is a bay's to brace, not a beam's to thicken.
|
|
|
1249
1499
|
|
|
1250
1500
|
Once an assembly is checked, these say how to make it. They all read the assembly itself, so they can't disagree with it.
|
|
1251
1501
|
|
|
1252
|
-
- `cad
|
|
1502
|
+
- `cad list <project>/<assembly>`: what to buy (bought parts, fixings, wire, the cut list) and what to print, each
|
|
1503
|
+
printed part's grams and an estimate of its minutes from its volume and the printer's `print_flow`: the printer the
|
|
1504
|
+
project names (`project.json`'s `printer`, else `cad.config.json`'s), as `cad check` reads it. The total says whose
|
|
1505
|
+
flow it used, and says so where it assumed one (a printer whose rule set gives no `print_flow`: 12 mm³/s) or the
|
|
1506
|
+
material's density (a material with no rule set: PLA's 1.25 g/cm³). `--json` gives the same as `totals.printer`,
|
|
1507
|
+
`totals.flow`, `flowAssumed` and `densityAssumed`.
|
|
1508
|
+
|
|
1509
|
+
- `cad order <project>/<assembly>`: the order it goes together in, each step with the part and what fastens it. A `fasten` names its screws on the step where its parts are both there, with the key that turns them and how tight: its `torque`, or half what the seat under the head takes, held for a screw in a thread in plastic to half what the thread is estimated to strip at (`2. bracket goes on: bracket fastened to base (2 × M3x10 cap) with a 2.5 mm hex key, to 0.12 N m at most (half what the seat takes)`); `--json` gives each as `{ fit, fastener, count, key, tighten: { torque, given } }` (with `thread: true` where the thread sets the torque, `load: true` where the joint's load does), and the build page shows the same. What is not a screw (pins, a clip) is named on a fit that fastens: `"fastener": "push pin", "count": 2` puts it on the shopping list and the step. `--preview` writes a picture of each step to `.preview/`: what's there, and the new part held off along the way it goes on. The order is found by taking the assembly apart, so a part goes in after what it's fastened into, a bearing before its shaft, and a nut trapped by a wall before the neighbour that traps it. A part goes on along a straight line that clears everything already there; which line comes from the part as drawn.
|
|
1253
1510
|
- `cad order` on a **frame** (an assembly with `joins`) gives its build from bars to a square frame, in numbered steps:
|
|
1254
1511
|
1. **Cut** the beams: each mark's count and length, the bars to buy and the cuts on each (the cut list).
|
|
1255
1512
|
2. **Drill and tap** each mark as its cut-and-drill sheet shows (each mark's work and its sheet's file).
|
|
@@ -1282,7 +1539,7 @@ Once an assembly is checked, these say how to make it. They all read the assembl
|
|
|
1282
1539
|
Every screw is reached in this order: what stands over a screw (`fasten.access`, or a fit's `access`) goes on
|
|
1283
1540
|
after the step that drives it. Where a side built flat would break that, the side is built on the frame instead;
|
|
1284
1541
|
where no build does, it is refused with the screw and what stands over it. It ends with the tightening of each
|
|
1285
|
-
kind of join (`blind (16 joins, M5x12 button with a 3 mm hex key):
|
|
1542
|
+
kind of join (`blind (16 joins, M5x12 button with a 3 mm hex key): 1.83 N m`). A slide-in nut in a stretch of slot
|
|
1286
1543
|
that joins close at both ends (`frame.nut`) is shut in by whichever of the two joins is made second, in any order:
|
|
1287
1544
|
the build is refused, naming the slot, the nuts, the two joins, and the nut that goes in through the opening
|
|
1288
1545
|
(`frame/box: x1's top slot: 2 slide-in nuts (...) for plate would be shut in between the blind join of x1.a to
|
|
@@ -1379,7 +1636,7 @@ slotted face, its holes read from its own rule set (@rulecad/frames' README, Ser
|
|
|
1379
1636
|
printed carrier strip in the slot under the rail instead: a `nut-carrier` fitting item `<id>-nuts`, one hex nut
|
|
1380
1637
|
under each hole, slid in from the beam's end. The rail's screws go into its nuts as a fasten, and `cad list` counts
|
|
1381
1638
|
the strip with its grams and each nut once. An MGN7 cut to 200 mm on a 2020 takes a 189 mm strip of 9.3 g of PLA,
|
|
1382
|
-
thirteen M2x8 cap screws and thirteen M2 hex nuts; each nut holds about
|
|
1639
|
+
thirteen M2x8 cap screws and thirteen M2 hex nuts; each nut holds about 905 N straight out of the slot (an estimate
|
|
1383
1640
|
until tested). Where no carrier fits the slot either, `guide.fit` fails and says why.
|
|
1384
1641
|
- Each carriage (`"carriages"`, 1 by default) is a bought item `<id>-carriage-1`, ... on its own sliding joint
|
|
1385
1642
|
`<id>-1`, ... along the beam, from 0 to its travel: its share of the rail less its length with its seals. The
|
|
@@ -1497,10 +1754,15 @@ the rest by addresses (`examples/bench` `axes/x-belt` is one, written by the edi
|
|
|
1497
1754
|
- `belt.length` gives the path by the belt's pitch line, the length to cut it (whole teeth that stretch to the path at
|
|
1498
1755
|
the tension) and to buy, rounded up to whole metres (`cad list` shows `gt2-belt-6 x 1000 mm`). `belt.tension` holds
|
|
1499
1756
|
each span, with the push and the weight along the travel, between the belt's least static tension and its rated
|
|
1500
|
-
tension.
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1757
|
+
tension. The motor holds the pulley, so the carriage hangs between the pulley's span a and the idler's span b, each
|
|
1758
|
+
as stiff as one over its length, and a push F changes span a by F b / (a + b) and span b by F a / (a + b): half each
|
|
1759
|
+
only with the two spans equal. The check walks the travel for where the spans differ most (on the kit's layouts, the
|
|
1760
|
+
travel's start, near the motor, where span a is short and takes most of the push), and says where the carriage is
|
|
1761
|
+
then, which span it is, both lengths and its share; `values.at` is that place, mm along the beam. On the bench's X
|
|
1762
|
+
axis span a takes 92% of the push there. `belt.rub` fails a run that rubs the beam, the rail, the carriage, the
|
|
1763
|
+
clamp or anything else on the carriage (by its box) anywhere through the travel, naming the run, the part and where;
|
|
1764
|
+
for a part on the carriage it gives the `height` that clears it by 1 mm. Its pass says how far the return run passes
|
|
1765
|
+
over the carriage's top (3.4 mm for an MGN12H on a 2020), the room a part on the carriage's free holes has under it.
|
|
1504
1766
|
`belt.line` fails an idler off the pulley's line past 0.25° (an estimate). `belt.tensioner` says where the block
|
|
1505
1767
|
must slide along its slot to tension the belt as cut, and fails when the slot has no room left there, saying how
|
|
1506
1768
|
much shorter or longer to cut it. `belt.stretch` gives the belt's stretch under the push, the term `belt stretch` in
|
|
@@ -1600,6 +1862,11 @@ dropped, and `cad check` tests the part for one piece and nothing starting in mi
|
|
|
1600
1862
|
`cad optimise <project>/<problem> --watch [port]` runs it afresh and serves a live view at `http://127.0.0.1:8090/`:
|
|
1601
1863
|
the densities as they change (a 3D part as a surface you can turn, and from three sides), a chart of its compliance and how much it still changes, with a scrubber to look back at any earlier step, its run time and time left, the machine it runs on, and a button that stops the run. It shows the end for ten minutes after the run finishes.
|
|
1602
1864
|
It listens on this computer only. To watch from elsewhere, reach it through a private network such as Tailscale.
|
|
1865
|
+
The page answers only when it is opened by one of this computer's own names (`localhost`) or by an address written
|
|
1866
|
+
out in numbers (`http://100.101.102.103:8090/`, a Tailscale address), and only the page itself can stop the run: a
|
|
1867
|
+
web page from another site can't read the view or press its button. To open it by another name, such as a Tailscale
|
|
1868
|
+
name, give that name with `--allow-host` (`--watch --allow-host my-laptop`; several names may be given, or one
|
|
1869
|
+
`--allow-host` with names separated by commas).
|
|
1603
1870
|
|
|
1604
1871
|
Every run is kept to watch again. `cad optimise` writes `.preview/<project>/<problem>-run.html`: the same page,
|
|
1605
1872
|
reading its steps from the file, so it opens with no server and can be sent to someone. Drag the slider or the chart
|
|
@@ -1727,13 +1994,19 @@ they bend. To check a final shape, give the analysis a smaller `cell`:
|
|
|
1727
1994
|
|
|
1728
1995
|
The part is then analysed on those cells and again on cells a quarter bigger. For each load case, `cad check`
|
|
1729
1996
|
reports:
|
|
1730
|
-
- **Stiffness and its change:** under 5% from the bigger cells and it has settled; more, and the cells
|
|
1997
|
+
- **Stiffness and its change (`fea.settled`):** under 5% from the bigger cells and it has settled; more, and the cells
|
|
1998
|
+
are too big. With `min_safety`, the peak stress must move under 5% too, as cells can be fine enough for the
|
|
1999
|
+
stiffness while the stress is still some percent out.
|
|
1731
2000
|
- **Members too thin for the cells:** a warning when more than 5% of the part lies in members under four cells
|
|
1732
2001
|
thick (what an opening of two cells takes away), where a cell's stiffness is a rough figure: use a smaller cell.
|
|
1733
2002
|
- **Peak stress, where it is, and the safety factor:** against the material's strength (its weaker one across a
|
|
1734
2003
|
print's layers, where the rule set has `strength_z`), and its fatigue strength where it has one. With
|
|
1735
|
-
`min_safety`, a case below it fails.
|
|
1736
|
-
|
|
2004
|
+
`min_safety`, a case below it fails. The stress is read at the part's surface (`@rulecad/fea`'s surface stress),
|
|
2005
|
+
where bending puts its peak: within a few percent of beam theory on members four cells thick or more. (Read at the
|
|
2006
|
+
cells' centres, half a cell inside, it came out 10 to 30% low, and a PLA cantilever beam theory puts at 2.6 times
|
|
2007
|
+
under its strength passed `min_safety` 3.) Peak stress at a sharp inside corner, or beside a support or load held
|
|
2008
|
+
at a few points, keeps rising as cells shrink, so read it with its change: give a corner a fillet, and a support
|
|
2009
|
+
or load the area it really acts on.
|
|
1737
2010
|
- **The largest movement anywhere, and where.**
|
|
1738
2011
|
|
|
1739
2012
|
A report goes in `.preview/` (`<object>-report-<problem>.md`, and `.json`), with what the analysis doesn't cover. A
|
|
@@ -1797,8 +2070,13 @@ placed parts in `.cache/overlaps.json`, keyed by each part's build and placement
|
|
|
1797
2070
|
about 10 s, and a re-check after an edit measures only what the edit moved. The build cache keeps its 800 most
|
|
1798
2071
|
recently used builds, keyed by what a build is made from: the design's code, its values resolved, its parts' names
|
|
1799
2072
|
and roles, the rule sets and the tool's own code; a rule's words, a label or the version change nothing it builds,
|
|
1800
|
-
so they don't start one.
|
|
1801
|
-
|
|
2073
|
+
so they don't start one. The files of its project a design imports (the starter lid's `./box.js`, and whatever those
|
|
2074
|
+
import) are part of what it is made from: a kept build lists them, and is used only while each reads as it did, so an
|
|
2075
|
+
edit to a shared helper rebuilds every design that imports it. (A package a design imports, such as
|
|
2076
|
+
`@jscad/modeling`, is not followed that way: it changes with an install, and the tool's own packages are in the key.)
|
|
2077
|
+
A lamina mechanism's slow stages (its physics, a flooded frame's probe) are kept apart in
|
|
2078
|
+
a folder of each design's own in `.cache/stages/`, keyed by their own inputs and by what works them out (the code of
|
|
2079
|
+
`@rulecad/flexures` and the packages it calls, and the installed manifold-3d and `@jscad/modeling`), so a build that changes only what comes after them (a strap, a check)
|
|
1802
2080
|
takes minutes rather than the twenty a launcher's physics takes; the design's sandbox reads them and hands back what
|
|
1803
2081
|
it made for the tool to write. `CAD_NO_CACHE=1` computes everything afresh (and keeps it).
|
|
1804
2082
|
|