@rulecad/cad 0.9.0 → 0.11.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 +29 -10
- package/CHANGELOG.md +604 -0
- package/EXAMPLES.md +122 -105
- package/README.md +292 -63
- package/bin/cad.mjs +500 -87
- package/lib/assembly.mjs +486 -134
- package/lib/bays.mjs +124 -0
- package/lib/cache-file.mjs +148 -0
- package/lib/clone.mjs +93 -11
- package/lib/code-text.mjs +28 -0
- package/lib/design-imports.mjs +127 -0
- package/lib/design.mjs +291 -59
- package/lib/designshapes.mjs +142 -0
- package/lib/edit.mjs +29 -5
- package/lib/estimates.mjs +51 -0
- package/lib/fasten.mjs +11 -5
- package/lib/fe-key.mjs +29 -0
- package/lib/fittings.mjs +20 -15
- package/lib/fixings.mjs +17 -4
- package/lib/framebuild.mjs +73 -92
- package/lib/framecheck.mjs +154 -77
- package/lib/framegen.mjs +9 -1
- package/lib/frames.mjs +6 -2
- package/lib/framesize.mjs +45 -82
- package/lib/gait.mjs +17 -7
- package/lib/guides.mjs +84 -50
- package/lib/host.mjs +7 -3
- package/lib/kit.mjs +5 -5
- package/lib/list.mjs +29 -21
- package/lib/live-guard.mjs +18 -8
- package/lib/loads.mjs +35 -23
- package/lib/measured.mjs +740 -99
- package/lib/mesh.mjs +156 -56
- package/lib/motors.mjs +26 -33
- package/lib/names.mjs +15 -0
- package/lib/node-version.mjs +52 -0
- package/lib/optimise.mjs +34 -25
- package/lib/order.mjs +5 -12
- package/lib/parts.mjs +3 -0
- package/lib/picture-servers.mjs +66 -0
- package/lib/power.mjs +14 -7
- package/lib/preview.mjs +12 -25
- package/lib/programs.mjs +113 -0
- package/lib/rules.mjs +2 -1
- package/lib/sandbox-guard.mjs +43 -0
- package/lib/sandbox-hooks.mjs +109 -15
- package/lib/sandbox-lock.mjs +225 -0
- package/lib/sandbox-preload.mjs +2 -2
- package/lib/sandbox-run.mjs +22 -24
- package/lib/sandbox.mjs +345 -42
- package/lib/sheet.mjs +114 -3
- package/lib/targets/gist.mjs +9 -6
- package/lib/versions.mjs +294 -35
- package/lib/workspace.mjs +6 -3
- package/package.json +14 -14
- package/schemas/assembly.schema.json +6 -5
- package/schemas/object.schema.json +1 -1
- 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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,610 @@ print (a hole's diameter, a seat's depth, a part's outline). Each release lists
|
|
|
5
5
|
its reason. A **fasten** is an entry in an assembly's `"fasten"` list: one screwed joint, naming the screw by thread
|
|
6
6
|
and head, the parts it passes through and the part it ends in.
|
|
7
7
|
|
|
8
|
+
## 0.11.0: One bay finder squares a corner-post box's rings; every beam's own sag is checked; the guide budget quotes the solved sag; a belt guide's line and tensioner checks come from @rulecad/frames; AGENTS.md and EXAMPLES give npm create rulecad's options after --; A damaged zip, a 3MF nested too deep and a board or part model over 64 MB are refused in plain words, naming the file and the limit; a stepper's current is set on its driver as the peak per coil; A fit is held to its range by depth, and fails outside it; The overlap check no longer reads a JSCAD seam as an overlap, and a workspace can set its boolean engine; PLA's analysis and fastenings use its strength across its layers; The pages cad serves to take a picture answer only to this computer, as the live views do; a worm's mesh takes the flanks its object draws, and cad check says which flank drives; A design's sandbox stops when cad does; a sandbox or Node too old to run it is said in one sentence; cad never writes, reads or removes a released version through a link in the workspace's .versions folder (security); nothing of a cad command is left running in the workspace once it returns; cad never runs a program found in the workspace when it starts git, gh or the file browser (security)
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `cad order`, the build page, `cad kit` and `frame.square` found a bay only where its four beams joined each other, so
|
|
13
|
+
on a corner-post box (the generated `box`, whose rails meet the posts, never each other) they squared the four
|
|
14
|
+
upright sides and never the top and bottom rings: a box built to the page could lean in plan. One finder
|
|
15
|
+
(`lib/bays.mjs`) now serves `cad check`'s solve, `frame.rack`, `frame.square`, `cad order` and the build page, and it
|
|
16
|
+
follows joins through a post. A ring is never a side built flat (its rails do not meet); it is squared with the rest
|
|
17
|
+
once every join is made, its diagonals set by its four rails' cuts.
|
|
18
|
+
- `frame.deflection` held a beam's sag only at a load, a named point or a guide, so a long rail carrying nothing but
|
|
19
|
+
itself was never held to its span: a 3 m rail of 2020 held at its ends sags about 9.96 mm, against 8.33 mm, with no
|
|
20
|
+
finding. Every beam's worst sag along its length is now held to its span over 360 (or the
|
|
21
|
+
assembly's `frame.limit`): each beam over it fails, and where none is, the beam nearest its limit is said as the one
|
|
22
|
+
pass. The sag is the beam's own bending, measured from the line through where it is held (its supports, and its
|
|
23
|
+
joins to beams that reach a support without passing through it), so a short beam hanging from a long rail is not
|
|
24
|
+
failed for the rail's sag; a beam held at one end keeps its tip's whole drop, whatever hangs from it. `cad frame --size` holds every beam to the same (with `@rulecad/fea`'s new `held`).
|
|
25
|
+
- The sag picture (`<assembly>.frame-sag.svg`, `cad beams`) read its 'at most' figure from the frame's nodes, the beams'
|
|
26
|
+
ends and joins, so it said 0.039 mm for a frame whose rails sag 5 mm in their middles. It now reads every element's
|
|
27
|
+
stations, the worst along any beam.
|
|
28
|
+
- `guide.budget` gave the beam's sag under a rail as the rail's own estimate (0.003 mm on the frames guide's box) while
|
|
29
|
+
`frame.deflection` in the same report gave 0.0494 mm. It is now said after the frame is solved and quotes the
|
|
30
|
+
frame's own figure; the estimate only where the frame is not solved.
|
|
31
|
+
|
|
32
|
+
For someone upgrading: `cad order` on a corner-post box lists two more bays to square in its last squaring step (the
|
|
33
|
+
count of steps does not change); `cad check` gives a `frame.deflection` line for every frame, and fails a long rail
|
|
34
|
+
that sags past its span over 360 on its own weight; `frame.square` gives two more bays, with their own
|
|
35
|
+
`cad measured ... frame.square.<beams>` names; the sag picture's figure grows. No printed size moves.
|
|
36
|
+
|
|
37
|
+
- A belt guide with a tension past the belt's breaking strength (556 N for `gt2-belt-6`) is now refused by name, where
|
|
38
|
+
`cad check` used to run until it ran out of memory.
|
|
39
|
+
|
|
40
|
+
For someone upgrading: nothing changes for a belt guide within the belt's range. No printed size moves.
|
|
41
|
+
|
|
42
|
+
- The `npm create rulecad` commands in AGENTS.md and EXAMPLES.md put `--` before their options (as
|
|
43
|
+
`npm create rulecad my-arm -- --machine arm`); copied as written before, npm kept the options for itself and the
|
|
44
|
+
command made the plain soap-tray workspace.
|
|
45
|
+
|
|
46
|
+
For someone upgrading: nothing to do. No printed size moves.
|
|
47
|
+
|
|
48
|
+
- `cad measure` and `cad match` on a 3MF whose zip is damaged (a size or place in it that points past the file's end)
|
|
49
|
+
gave Node's own `RangeError ... out of range`. Every place and size the zip gives is now held against the file's
|
|
50
|
+
length before it is read, and a wrong one is refused as `part.3mf: a damaged zip file: entry 2 (3D/3dmodel.model)
|
|
51
|
+
runs past the end of the file`: the file, the entry and what is wrong with it. So is an entry that is not where the
|
|
52
|
+
zip's list of files says, a list of files that is not one, and packed data that does not unpack. An entry whose
|
|
53
|
+
packed size ran past the end used to be read with what there was; it is refused too.
|
|
54
|
+
- A 3MF with objects held more than 16 levels deep inside each other was read with the deeper ones silently left out,
|
|
55
|
+
so the model measured smaller than it is. It is now refused, naming the object and the limit (`the 3MF holds object
|
|
56
|
+
1 (3D/3dmodel.model) more than 16 levels deep inside others, the most cad follows`). A 3MF object that holds itself
|
|
57
|
+
was read as 16 copies of what it holds; it is refused as one that has no end.
|
|
58
|
+
- What `cad measure` and `cad match` say of a file they refuse now starts with the file's name, since both take more
|
|
59
|
+
than one file.
|
|
60
|
+
- `cad clone` read a board and each of its parts' 3D models (VRML, STEP) whole, whatever their size, from the board's
|
|
61
|
+
folder or downloaded from its repository or KiCad's library. It now reads up to 64 MB of each: a download is stopped
|
|
62
|
+
there (at once, when the server says its size), a larger board is refused (`the board hw/big.kicad_pcb is more than
|
|
63
|
+
the 64 MB cad clone reads`), and a larger model is left out with a note.
|
|
64
|
+
- `cad clone`'s notes named a model that was left out by the last part of its path, so two of one name in different
|
|
65
|
+
folders read the same. A board's own model is now named by its path in the board's folder (a board read from a file)
|
|
66
|
+
or in its repository (a board from GitHub), and any other by the whole path the board gives (`note: no 3D model for
|
|
67
|
+
hw/lib/usb.wrl: its .wrl file is more than the 64 MB cad clone reads`). A character in that name that doesn't print
|
|
68
|
+
(a bell, an escape code, a mark that turns the writing round) is written as its code, `\u{7}`: two names that
|
|
69
|
+
differed only in one read the same, and one could wipe its own note off the screen.
|
|
70
|
+
- `cad clone` held its 64 MB limit only for a plain file. A board or a model that was a link to a device was read
|
|
71
|
+
until the memory was full, one that was a pipe held `cad clone` for ever, and a folder gave Node's `EISDIR: illegal
|
|
72
|
+
operation on a directory`. Only a file is read now: such a board is refused (`the board b.kicad_pcb is not a file
|
|
73
|
+
(it is a folder, a device or a pipe), so cad clone doesn't read it`) and such a model is left out with a note.
|
|
74
|
+
- A part's model of a few MB can be written to unfold into millions of triangles and fill the memory. `cad clone`
|
|
75
|
+
leaves out a model of more than 2 million triangles with a note that says so (the limit is `@rulecad/pcb`'s, as is
|
|
76
|
+
one of 4 million bracketed lists for a board).
|
|
77
|
+
- `cad measure` and `cad match` gave Node's own words for three files too big or of the wrong kind: a text STL, or a
|
|
78
|
+
3MF's model file, of more text than Node holds (`Cannot create a string longer than 0x1fffffe8 characters`), a file
|
|
79
|
+
of more than 2 GB (`File size (3221225472) is greater than 2 GiB`) and a folder (`EISDIR`). Each is now one plain
|
|
80
|
+
line that names the file: `part.3mf: the 3MF's model file 3D/3dmodel.model is more than 511 MB of text, the most cad
|
|
81
|
+
reads`, `big.stl: more than 2 GB, the most cad reads of a file`, `parts: a folder, not an STL or 3MF file`.
|
|
82
|
+
|
|
83
|
+
For someone upgrading: a 3MF that nests its objects more than 16 deep, holds an object inside itself, or has a zip
|
|
84
|
+
entry cut short used to be read (with parts missing) and is now refused: open it in a slicer and export it again. A
|
|
85
|
+
script that reads `cad measure`'s refusals finds the file's name in front of them, and one that reads `cad clone`'s
|
|
86
|
+
notes finds a longer name for the model. `cad clone` no longer reads a board from a pipe (`<(...)` in a shell):
|
|
87
|
+
write it to a file first. The limits are in `MESH_LIMITS` (`depth: 16`, `download: 64 MB`, `text`: the longest text
|
|
88
|
+
Node holds) beside the others, and `readStl` and `read3mf` take `text` with their other limits. No printed size
|
|
89
|
+
moves.
|
|
90
|
+
|
|
91
|
+
- The driver check passes a stepper's current (its own `current`, else the motor's rated current per phase) to
|
|
92
|
+
`@rulecad/motors` as the peak per coil, as Pololu advises. A TMC2209's trimmer used to be set for that figure as
|
|
93
|
+
RMS, 41% more coil current than an A4988 or a DRV8825 given the same motor; its trimmer voltage now falls by a
|
|
94
|
+
factor of about 1.41, and the check says the RMS beside the peak. A setting past the 2.5 V a TMC2209's trimmer pin
|
|
95
|
+
takes now fails.
|
|
96
|
+
- A geared stepper given no speed (the 28BYJ-48) works at the 120 steps a second its pull-in torque is measured at,
|
|
97
|
+
1.76 rpm, where it used to work at the 600 a second it only starts at unloaded; `@rulecad/motors` now lets its torque
|
|
98
|
+
fall past the measured rate, so the torque margins stay as they were and the speeds and times it reports are a fifth
|
|
99
|
+
of what they were (EXAMPLES.md's wrist Z: 0.23 mm/s, where it said 1.17).
|
|
100
|
+
- EXAMPLES.md's leg (chapter 14) gives the 17HS4401's torque from its maker's 1.7 A: 1.484 N m through 38:1 at 0.5 A,
|
|
101
|
+
2.4 times at the knee and 7.5 at the hip (it said 1.682 N m, 2.8 and 8.5).
|
|
102
|
+
|
|
103
|
+
For someone upgrading: the trimmer voltage `cad check` gives for a TMC2209 changes; a brushless motor's margins fall at
|
|
104
|
+
speed (from `@rulecad/motors`). No printed size moves.
|
|
105
|
+
|
|
106
|
+
- A fit with a negative `min` let two parts overlap by any amount: a 10 mm cube pressed 8 mm into a block passed a
|
|
107
|
+
fit of `min: -0.05`, and the overlap check let it through as well. An overlap is now measured as a depth in mm (the
|
|
108
|
+
volume the two share over the area where they meet) and held to `min`: a press fit may go no deeper than `-min`,
|
|
109
|
+
and the overlap check fails the pair beyond that depth. A negative `max` holds it to at least that depth. A fit's message says "press fit, 0.04 mm deep" only within
|
|
110
|
+
that depth, and "overlap 1 mm deep" beyond it; the finding's `values` keep `overlap` (mm³) with `depth` (mm) beside
|
|
111
|
+
it.
|
|
112
|
+
- A fit whose gap is outside its range now fails (`cad check` exits 1); it was only a warning.
|
|
113
|
+
One put out of range only by an overlap under 0.5 mm³ that JSCAD measured (where Manifold is not installed) stays a
|
|
114
|
+
warning, "may overlap", as the overlap check has it: JSCAD can read the seams its unions and cuts leave as that much.
|
|
115
|
+
- A fit with no `min` lets its two parts touch but not overlap, in the fit's own finding as in the overlap check.
|
|
116
|
+
- A fit whose `min` is above its `max` is refused by name (`fit.range`), and a gap within 1 µm of a bound passes, so a
|
|
117
|
+
gap a design sets exactly is not lost to rounding.
|
|
118
|
+
|
|
119
|
+
- Without Manifold, `cad check` measured an overlap with JSCAD, which counts a volume from the world's origin even for
|
|
120
|
+
faces that enclose nothing. A JSCAD union can leave a flat face of no thickness across a bore where two of its
|
|
121
|
+
solids meet (a gear's top and the drum unioned on), so a gear on the shaft in its bore failed with "overlap by
|
|
122
|
+
39.018 mm³", more the higher it sat, though no material was in the bore. JSCAD's answer is now measured as what its
|
|
123
|
+
faces enclose, with such flat faces left out: one by itself measures nothing, and one beside a real overlap changes
|
|
124
|
+
nothing, so the same gear on a shaft too wide for its bore fails by the true volume.
|
|
125
|
+
- An overlap under 0.5 mm³ that only JSCAD measured is a warning that the parts "may overlap", saying how to measure it
|
|
126
|
+
with Manifold, not a failure. `cad check --sweep` and a gait's sweep say such parts "may hit", and warn where
|
|
127
|
+
nothing else collides. Where JSCAD finds faces that close into no solid and are no flat film, the overlap still
|
|
128
|
+
fails, its volume given as "about", with the same advice. Measured by Manifold, every overlap fails as before.
|
|
129
|
+
|
|
130
|
+
- To make a picture (`cad preview`, and the drawings `cad measure`, `cad match` and others make as PNG), cad serves a
|
|
131
|
+
page from a small web server on this computer for the few seconds Chrome takes to open it. That server answered
|
|
132
|
+
whatever name a request gave it, so a web page open in your browser could in principle have read the part while its
|
|
133
|
+
picture was taken, by pointing a name of its own at this computer (the same fault the live views had). Both picture
|
|
134
|
+
servers now answer only to this computer's own names and addresses (`127.0.0.1`, `localhost`), refuse another site's
|
|
135
|
+
page that posts to them, and may not be shown in another page's frame. A request by any other name is told so
|
|
136
|
+
(status 421) and gets none of the part.
|
|
137
|
+
- A request to the part's picture server for an address that cannot be read (`//`) ended the command with Node's own
|
|
138
|
+
`TypeError: Invalid URL`, so a page that reached the server could stop a picture being made. It is answered "not
|
|
139
|
+
found" now.
|
|
140
|
+
- Once a picture was made, the command waited for every connection still open on that server, and one that had asked
|
|
141
|
+
nothing (a web page can open one without asking for anything, under any name) or had stopped half-way through
|
|
142
|
+
asking was never closed. The command could print its picture and then not end, for as long as the other side kept
|
|
143
|
+
the connection. Every connection is now closed when the picture is made, as the live views do when they stop.
|
|
144
|
+
|
|
145
|
+
For someone upgrading: nothing to change. Pictures come out as before, and no printed size moves.
|
|
146
|
+
|
|
147
|
+
- A cad command killed from outside (a closed terminal, a stopped test or CI job) no longer leaves the design it was
|
|
148
|
+
running going on in its sandbox: a small guard process, started with the first sandboxed design of a command, ends
|
|
149
|
+
every sandboxed process still running once the command has gone, however it went. Before, a design that looped for
|
|
150
|
+
ever kept a processor core busy, and held its memory, until someone stopped it by hand.
|
|
151
|
+
- A sandbox that ends before it has read its work (as it does on Node 22.0 to 22.12) is the `design.sandbox` refusal,
|
|
152
|
+
with its exit code and what it printed, where cad used to stop with Node's own `EPIPE` stack trace. Every refusal of a
|
|
153
|
+
sandbox that stopped without a reply now gives its exit code too.
|
|
154
|
+
- On a Node older than 22.13, cad prints one line, `cad needs Node 22.13 or later; this is Node <version>`, with what
|
|
155
|
+
to do, and exits 1, before anything else loads. Before, only npm's warning on install said so.
|
|
156
|
+
|
|
157
|
+
Upgrading: nothing to change. A command now starts one more small Node process (the guard) when it first runs a design
|
|
158
|
+
sandboxed; it ends with the command. No printed size moves.
|
|
159
|
+
|
|
160
|
+
- cad unpacks a released version of a design (`home/tray@1.2.3`) into the workspace's `.versions` folder to build it,
|
|
161
|
+
on `cad status`, `link`, `show`, `history` and `diff` of a released design, and on `check`, `build`, `values` or
|
|
162
|
+
`export` of a named version. A workspace that came from someone else may hold a `.versions` folder of its own, and a
|
|
163
|
+
link in it (`.versions` itself, a version's folder, a folder in it or one of its files) had cad write files of that
|
|
164
|
+
person's choosing outside the workspace, remove a folder outside named like `tray@1.2.3`, or read a file from
|
|
165
|
+
elsewhere as the release's design. cad now uses nothing under `.versions` that is a link, or a file with a second
|
|
166
|
+
name elsewhere: it stops, names the link, and writes and removes nothing. It is the same guard the `.cache` folder
|
|
167
|
+
has. To go on, look at where the link leads, then remove the `.versions` folder: cad makes it again as it needs it.
|
|
168
|
+
- Each file of a released version is now written whole or not at all, so a run stopped part way through no longer
|
|
169
|
+
leaves a file cut short there that later runs would use as it was.
|
|
170
|
+
- `cad agents` no longer writes `AGENTS.md`, or adds its line to `CLAUDE.md`, when either is a link: it stops and names
|
|
171
|
+
the link.
|
|
172
|
+
|
|
173
|
+
Upgrading: nothing to do. A workspace whose `.versions` holds a link now stops with a message naming it. No printed
|
|
174
|
+
size moves.
|
|
175
|
+
|
|
176
|
+
- On Windows, a workspace's folder can be moved or removed as soon as a cad command returns. A command that built a
|
|
177
|
+
design in the sandbox now waits, before it returns, until the design's process and the small guard process started
|
|
178
|
+
with it have gone, whether it passes, fails or stops on a refusal; and the guard, and each look at a design's
|
|
179
|
+
memory, no longer sit in the workspace's folder at all. Before, the guard ended a moment after its command, and
|
|
180
|
+
Windows refuses to move or remove a folder while a process sits in it: a script that ran `cad check` and removed the
|
|
181
|
+
folder straight after was refused now and then (`EPERM`). A script of your own that builds a design through the
|
|
182
|
+
library waits the same way when it comes to its end.
|
|
183
|
+
|
|
184
|
+
Upgrading: nothing to change. A command that ran a design in the sandbox returns about 7 ms later (measured on a Mac):
|
|
185
|
+
the time its guard takes to go. A command killed from outside is as it was: its guard ends the design's process. No
|
|
186
|
+
printed size moves.
|
|
187
|
+
|
|
188
|
+
- cad started git, `gh` and the file browser (`open`, `explorer`, `xdg-open`) by their names alone, with the workspace
|
|
189
|
+
as their folder. On Windows a program named that way is looked for in that folder before PATH, and on every system a
|
|
190
|
+
PATH with `.` or an empty entry in it looks there too, so a `git.exe` (or `git`) in a workspace that came from someone
|
|
191
|
+
else ran with your full rights, outside the design sandbox, on `cad status`, `link`, `show`, `history`, `diff`,
|
|
192
|
+
`compare`, `release`, or `check` and `build` of a release (`home/tray@1.2.3`). cad now finds each program itself in
|
|
193
|
+
PATH's folders, passing over entries that are not full paths and any folder inside the workspace (npm puts the
|
|
194
|
+
workspace's `node_modules/.bin` on PATH), and starts it by the full path found, never through a shell. When git is
|
|
195
|
+
not found, cad says so in plain words, rather than `spawnSync git ENOENT`.
|
|
196
|
+
- A workspace that comes with its `.git` folder brings git's settings and hooks with it. The `git status` and
|
|
197
|
+
`git write-tree` cad runs before a release (`cad release <project> --all --dry-run` too) started the file system
|
|
198
|
+
monitor, the clean filter and the post-index-change hook that the workspace's `.git/config` and `.git/hooks` named.
|
|
199
|
+
Every git command cad runs to read a workspace now has those switched off (the monitor, hooks, the pager, and each
|
|
200
|
+
filter and diff program git's settings name), and git no longer looks inside a submodule, whose own settings are
|
|
201
|
+
not switched off: edits not committed inside a submodule no longer stop a release, one moved to another commit still
|
|
202
|
+
does. cad refuses to run git, saying why, when it cannot read git's settings in full, or when a filter or diff
|
|
203
|
+
program is named under a name that is not plain UTF-8 text (it could not switch that one off). A release's own commit, tag and push still run as they do by hand,
|
|
204
|
+
with the repository's hooks, filters and signing: the cad README (Programs cad starts) and SECURITY.md say so, and
|
|
205
|
+
what to look at before releasing in a workspace that came from someone else.
|
|
206
|
+
|
|
207
|
+
For someone upgrading: nothing to change, unless git, `gh` or your file browser is only in a folder inside your
|
|
208
|
+
workspace or reached by a relative PATH entry: put it in a folder on PATH outside the workspace. A repository's own
|
|
209
|
+
filters no longer run when cad looks for uncommitted shared code before a release. No printed size moves.
|
|
210
|
+
|
|
211
|
+
### Changed
|
|
212
|
+
|
|
213
|
+
- `belt.line` and `belt.tensioner` are now the checks `@rulecad/frames`'s `beltLayout` makes itself, reported as
|
|
214
|
+
they were, with the same words and verdicts; `belt.tension` stays cad's own, with the carriage's push and weight on
|
|
215
|
+
the belt.
|
|
216
|
+
|
|
217
|
+
- A fit's `min` below -1 mm is refused (`fit.range`), saying to write `"overlap": "allowed"` in its place: a large
|
|
218
|
+
negative `min` was the old way to let two parts overlap. This holds on a fit of any kind (one that measures a gap,
|
|
219
|
+
an `engage`, a `seat` or a `shaft`), since on each a `min` says how deep the two may overlap.
|
|
220
|
+
|
|
221
|
+
For someone upgrading: a fit that only warned now fails `cad check`; replace a `min` below -1 (-2, -30, -100, -1000)
|
|
222
|
+
with `"overlap": "allowed"`; a press fit deeper than its `min` now fails. Fit messages change wording. No printed size
|
|
223
|
+
moves. Round a pin pressed into its hole, the depth reads a little more than the interference (0.33 mm for 0.3 mm round
|
|
224
|
+
a 3 mm pin): a fit drawn exactly at its bound there may need its `min` a little lower. The kit's examples moved with it:
|
|
225
|
+
the arm's servo fits allow its overlap (its model runs about 1.5 mm into the gripper's palm, to be checked), the
|
|
226
|
+
gripper check's horn tips allow theirs and are held to touch, and the launcher's barrel pins are held to their lip.
|
|
227
|
+
|
|
228
|
+
- With the kit's `pla` set now giving its strength across the layers (35 MPa, @rulecad/rules), `cad analyse` and a
|
|
229
|
+
design's analysis read a PLA part against it, the weaker of its two strengths: a safety factor that read 2.6 now reads
|
|
230
|
+
2.33. `fasten` checks and `cad order` torques for screws in PLA fall by about 10% (an M3 cap on a PLA seat: 0.11 N m,
|
|
231
|
+
was 0.12), and a printed M8 bolt in a printed PLA thread breaks at 1014 N, was 1130 N. `cad measured`'s pull bolt
|
|
232
|
+
is predicted at 35 MPa. Printed PLA parts weigh about 1.6% less.
|
|
233
|
+
|
|
234
|
+
Upgrading: a workspace keeps its own copy of `pla.json` until `cad rules update pla` takes the kit's; a PLA part near
|
|
235
|
+
its margin may now warn. No printed size moves.
|
|
236
|
+
|
|
237
|
+
### Added
|
|
238
|
+
|
|
239
|
+
- `"overlap": "allowed"` on a fit: the two parts may overlap by any amount (a rod through a part, an end cap's pegs in
|
|
240
|
+
a beam, a reference part drawn into another). The kit's own generators (guides, motor shafts, seats) use it.
|
|
241
|
+
`cad add fasten --from-fits` keeps it on the fit that fastens, as it keeps a range.
|
|
242
|
+
|
|
243
|
+
- `"engine"` in cad.config.json: `"manifold"` builds every design whose object names no engine with Manifold
|
|
244
|
+
(`"jscad"`, the default, with JSCAD). Without `manifold-3d` installed, designs are built with JSCAD and cad says once
|
|
245
|
+
how to install it. An object's `"engine": "jscad"` keeps it on JSCAD; `CAD_ENGINE` still sets every design for one run.
|
|
246
|
+
Any other value is refused (`engine.unknown`). AGENTS.md says so, in place of "the workspace can switch them to
|
|
247
|
+
Manifold without touching the design".
|
|
248
|
+
|
|
249
|
+
For someone upgrading: in a workspace without Manifold, an overlap under 0.5 mm³ is now a warning in place of a
|
|
250
|
+
failure (in the check and in a sweep), and an overlap measured through a part with a seam face in it reports its true
|
|
251
|
+
volume; the overlap cache is measured again once. Nothing changes where Manifold measures. No printed size moves.
|
|
252
|
+
|
|
253
|
+
- A mesh's `"worm"` takes `"flanks"` (`"printed"` or `"standard"`) and `"overhang"` beside `"diameter"` and `"hand"`:
|
|
254
|
+
the thread as the worm's object gives it to `v.gears.worm`. `@rulecad/gears` now draws a worm to print standing,
|
|
255
|
+
the flank of its thread that faces down laid back to 45°, and `cad check` says which flank then drives and its
|
|
256
|
+
contact ratio (`worm.flanks`, a note; a warning under 1.2). A worm drawn with `flanks: 'standard'` or its own
|
|
257
|
+
`overhang` needs the same in its mesh, or the check speaks of the default thread.
|
|
258
|
+
|
|
259
|
+
For someone upgrading: `cad check` on an assembly with a worm gains the `worm.flanks` line. Nothing is said in an
|
|
260
|
+
assembly of the pose a motor's mount prints in (`mount.printable` in `@rulecad/motors`): that is about the solid
|
|
261
|
+
`v.motors.mount` cuts, and the part's own shape is what the print checks read. No printed size moves through `cad`
|
|
262
|
+
itself; the worm, helical gear and motor mount shapes move with `@rulecad/gears` and `@rulecad/motors`.
|
|
263
|
+
|
|
264
|
+
The worked examples' shoulder (EXAMPLES.md, chapter 11) has stouter posts: each is 2 mm longer outward than it's wide
|
|
265
|
+
(`post_back` in `joint-housing`), over the foot it stands on, 1 g more. With the mount's cone open through its 5 mm
|
|
266
|
+
plate, the round posts left `cad check home/shoulder` reading the motor on its housing 1.9 times inside the fit, under
|
|
267
|
+
the 2 it asks; it reads 2.7 now. If you built that housing from the chapter, take its new listing with the new mount.
|
|
268
|
+
|
|
269
|
+
### Already published
|
|
270
|
+
|
|
271
|
+
- `cad new --frame` refusing frames the kit cannot build, `--estimate`, and `cad frame`'s line with the whole
|
|
272
|
+
frame's size (Hardening 2.43) went out in 0.10.0, but their note was filed late, after that release was made, so
|
|
273
|
+
they are listed under 0.10.0 below. A workspace already on 0.10.0 has them; nothing changes in this release.
|
|
274
|
+
|
|
275
|
+
## 0.10.0: a build follows the files its design imports; slow caches follow their code and libraries, not their comments; the cache is written whole, and only inside the workspace; cad coupons puts the kit's coupons in your workspace, cad measured takes a coupon's figure with no assembly, and --export sends what you measured to the kit; cut lists name each bar's material where a profile comes in more than one, and short ones may buy less; cad fasten's seat check reads the head's bearing face; clip and link stresses follow every edit; the README says snap_clearance is measured; cad measured lists what truly moved, refuses slips, strikes a ledger row, and tables every unsettled figure; releases work below the git root, recover from a failed commit, and keep cad set working; releases record and rebuild from everything a design reads; a corrected kit rule is offered to workspaces holding an older copy; the sandbox's documents say what a design can do on each Node, and cad warns where the network is open; a design can no longer reach Node's own modules through the CommonJS loader (security); object checks report every estimate, shaft seats included, and a reference's holes get no hole compensation; cad applies --set to assemblies, reads the project's printer for minutes, and keeps text as typed; cad new --frame refuses frames the kit cannot build, takes --estimate, and cad frame says the whole frame's size
|
|
276
|
+
|
|
277
|
+
### Fixed
|
|
278
|
+
|
|
279
|
+
- A design may import files of its own project (the starter template's `lid.js` imports `./box.js`), but the build
|
|
280
|
+
cache knew only the design's own file: after a helper was edited, `cad check`, `cad export` and every other command
|
|
281
|
+
used the part as it was before, from `.cache/builds/`, without a word, until that folder was deleted by hand. A kept
|
|
282
|
+
build now lists the files of the project its design imported (and the files those import), with a hash of each, and
|
|
283
|
+
is used only while each reads the same; an edit to any of them rebuilds the design. A design run in the tool's own
|
|
284
|
+
process (a trusted workspace) is loaded afresh when one of its helpers changes, where a program that keeps running
|
|
285
|
+
and builds again (one using the library, an editor's server say) used to keep the helper as it first read.
|
|
286
|
+
`build()` now returns `imports`: those files, as paths inside the workspace.
|
|
287
|
+
- A trusted design that imports a file the tool cannot read as one of the workspace's (a file outside the workspace,
|
|
288
|
+
or one reached through a link that leads out of it) is built afresh each time rather than kept, so it is never
|
|
289
|
+
served stale.
|
|
290
|
+
|
|
291
|
+
For someone upgrading: the first build of each design after the upgrade is made afresh (the cache's format moved on),
|
|
292
|
+
and designs that share a helper rebuild after it is edited. No printed size moves, except where a part was stale.
|
|
293
|
+
|
|
294
|
+
- A lamina's slow stages (its physics, the flood's probe, its frame's finite elements, kept in `.cache/stages`) were
|
|
295
|
+
kept by the code of `@rulecad/flexures` and `@rulecad/fea` only. An upgrade of manifold-3d or `@jscad/modeling`, or
|
|
296
|
+
a change to `@rulecad/fixings` or `@rulecad/gears`, which flexures calls, read results the old code had made. They
|
|
297
|
+
are now kept by those packages' code too (and `@rulecad/shapes`, which fixings calls), and by the installed versions
|
|
298
|
+
of manifold-3d and `@jscad/modeling`.
|
|
299
|
+
- An optimisation's densities (`.cache/densities`) were kept by topopt's code down to its "shapes from results" line,
|
|
300
|
+
but the virtual temperature, which decides every result with `voids: 'prevented'`, was below that line, so a change
|
|
301
|
+
to it kept the old densities. It is now above the line (in `@rulecad/topopt`), and a test holds every function the
|
|
302
|
+
solver calls above it.
|
|
303
|
+
- The same key was a hash of the code with its comments, so rewording a comment threw away minutes of solving. The
|
|
304
|
+
code is now hashed without its comment lines and blank lines (`lib/code-text.mjs`): a comment edit keeps the
|
|
305
|
+
densities, and any change to the code optimises again.
|
|
306
|
+
- A printed fitting's finite-element results (`.cache/fitting`) are kept by all of `@rulecad/fea`'s code as well as
|
|
307
|
+
by `@rulecad/frames`' own key, which now carries a hash of its code in place of a number written by hand.
|
|
308
|
+
|
|
309
|
+
For someone upgrading: the first build of a lamina, the first optimisation of each problem and the first check of
|
|
310
|
+
each printed fitting work their results out again, once, so they are slower. No printed size moves.
|
|
311
|
+
|
|
312
|
+
- Only the build, stage and route caches checked that a file of the workspace's `.cache/` folder really lay inside the
|
|
313
|
+
workspace before writing it. The rest (the remembered overlaps, the gears' contact, the finite elements' results for
|
|
314
|
+
fittings, clips, links and motor mounts, assembly orders, optimised shapes and their densities, recorded runs,
|
|
315
|
+
`links.json` and the links files, the record of `AGENTS.md`) were written through whatever was there: a workspace
|
|
316
|
+
cloned from someone else with `.cache/overlaps.json` as a link to a file elsewhere on your computer had that file
|
|
317
|
+
overwritten by the first `cad check` that found an overlap. Every cache file is now written only where it, and each
|
|
318
|
+
folder on its way down from the workspace, is a plain file and plain folders; where one is a link the result is
|
|
319
|
+
simply not kept (that work is done again next time). `cad link` prints the links where it can't keep them in
|
|
320
|
+
`.cache/links/`.
|
|
321
|
+
- A cache file was written in place, so a run stopped part way through (Ctrl-C, a time limit, a full disc) left it cut
|
|
322
|
+
short, and every later build of that part failed with "Unexpected end of JSON input" until the file was found and
|
|
323
|
+
deleted by hand. Each is now written to a new file beside it and renamed over it, so it is there whole or not at
|
|
324
|
+
all; and a kept file that does not read as JSON is counted as not kept, removed, and made again.
|
|
325
|
+
|
|
326
|
+
For someone upgrading: nothing to do. A workspace whose `.cache/` holds a file cut short by an earlier version mends
|
|
327
|
+
itself on the next run. Each optimised problem (`cad optimise`) is worked out once again after the upgrade, as the code
|
|
328
|
+
that reads and keeps its results is part of what its densities are kept by. No printed size moves.
|
|
329
|
+
|
|
330
|
+
- Where a frame has one profile in two materials (an aluminium and a steel tube of one section), `@rulecad/frames` now
|
|
331
|
+
lists their bars apart. The buy list, the build page and the frame's build steps name each by its profile and
|
|
332
|
+
material, so the two lines can be told apart.
|
|
333
|
+
|
|
334
|
+
- `cad check`'s `fasten.seat` pressure under a head takes the ring out to the head's bearing face (dw, from its
|
|
335
|
+
thread's rule set) that `@rulecad/fixings`' `seating` reads, not its outline or flats. A metric cap, button or hexagon
|
|
336
|
+
head's seat now takes 25 to 55% less, so the most it may be tightened to falls and some seats that passed warn.
|
|
337
|
+
The shelf in EXAMPLES.md's chapter on fixings now tightens its M3 cap screws to 0.12 N m, where it was 0.16.
|
|
338
|
+
|
|
339
|
+
Upgrading: re-check designs whose screws sit on printed seats near their limit. No printed size moves.
|
|
340
|
+
|
|
341
|
+
- `cad check` keeps the finite-element results for a joint's printed clips and for a bent link in `.cache`, as they
|
|
342
|
+
are slow to work out. They were kept under the part's number of triangles and its first one or four triangles, and
|
|
343
|
+
left out the material's Poisson's ratio, so a clip edited without changing those (a thinner neck, a taller tip) was
|
|
344
|
+
given the old clip's stress: a clip made four times thinner kept its pass, where worked out afresh it fails. Each
|
|
345
|
+
result is now kept under a hash of every triangle of the part, the material (stiffness and Poisson's ratio), the
|
|
346
|
+
loads, the cell size and a version, as a motor mount's already was; the three share one way of naming them
|
|
347
|
+
(`lib/fe-key.mjs`).
|
|
348
|
+
|
|
349
|
+
For someone upgrading: the first `cad check` after the upgrade works out each clip, link and motor mount again, once,
|
|
350
|
+
so it is slower. A clip or link that passed from a stale result may now fail or warn; that is its real margin. No
|
|
351
|
+
printed size moves.
|
|
352
|
+
|
|
353
|
+
- `cad measured` paired the findings before and after a measurement by their code and every one of their refs, and a
|
|
354
|
+
fasten's list of screws comes out in another order once its holes change size. On the starter template,
|
|
355
|
+
`cad measured home/lidded-box x1c.hole_comp=0.15` said "nothing the checks say has moved" while the lid's hole had
|
|
356
|
+
gone from 3.5 to 3.55 mm; and where several findings shared a code (a fasten's hole and its slot), one was compared
|
|
357
|
+
with another, so the joint rig's drop listed seven findings that had not moved. Findings are now paired by their code
|
|
358
|
+
and what they are about (the fasten, the fit's two parts, the join, the beam, one screw of several), in the order
|
|
359
|
+
the checks give them.
|
|
360
|
+
- An empty figure (`x1c.fit=`) was written as 0 mm, measured. It is refused.
|
|
361
|
+
|
|
362
|
+
- In a workspace in a folder below its git repository's root (as `examples/bench` is), every release command after
|
|
363
|
+
the first (`cad status`, `history`, `diff`, `link --md`, `release --dry-run`, `export <ref>@<version>`) failed with
|
|
364
|
+
git's "exists, but not" error, because a release's files were read from the repository's root. They are now read
|
|
365
|
+
from the workspace. The check that stops a release past uncommitted shared code (`lib/`, `bin/`) now works there
|
|
366
|
+
too: it never saw those files before.
|
|
367
|
+
- A release whose commit or tag git refused (a pre-commit hook that fails, a tag that can't be signed) left the bumped
|
|
368
|
+
version and changelog entry behind, and running it again wrote the changelog entry twice. Now the version, the
|
|
369
|
+
changelog, what was staged and any commit already made are put back as they were, and the message says, in plain
|
|
370
|
+
words, that nothing was released and what git said. A changelog entry for the same name and version that was
|
|
371
|
+
never committed (left by such a release) is replaced, never repeated; a committed one (an object named as its
|
|
372
|
+
project, released at the same version as the project) is kept.
|
|
373
|
+
- After `cad release <project>` (or `--all`), `cad set <project>` was refused for ever ("version: not allowed here"):
|
|
374
|
+
the release wrote `version` and `release` into `project.json`, which the project schema did not allow. The schema
|
|
375
|
+
now has both fields, and the release writes them into the file as it is laid out, changing nothing else. `cad set
|
|
376
|
+
<project>` leaves them to `cad release` and says so.
|
|
377
|
+
- On Windows (where git writes files with Windows line endings), every design showed as "changed since" its last
|
|
378
|
+
release straight after it was released, and a project release refused to go ahead ("has changes since"): the
|
|
379
|
+
design's code was compared with the release's line by line, endings included. Line endings are no longer counted
|
|
380
|
+
as a change.
|
|
381
|
+
|
|
382
|
+
- A release could not be rebuilt when its design imports a file of its project: after `cad release home/lid` in the
|
|
383
|
+
starter template, `cad check home/lid@0.1.0` (and export, diff and status) failed with "Cannot find module
|
|
384
|
+
.../box.js". A release's folder in `.versions/` now holds its files at the paths they have in the workspace, with the
|
|
385
|
+
files its code imports, so it builds as it did.
|
|
386
|
+
- A release was rebuilt with today's rule sets: `loadRuleSet(name, dir)` read the workspace's copy whatever folder it
|
|
387
|
+
was given, so `cad values home/box@0.1.0` gave the wall from a line width measured since, and `cad diff` and
|
|
388
|
+
`cad status` never saw a rule change. A release now reads its own rule sets, as its tag holds them, for its "uses",
|
|
389
|
+
for `v.fixings` and for `v.frames`, and the project's material and printer as they were.
|
|
390
|
+
- A changed helper, thread set or object read through "uses" left a released part "up to date". `cad status`,
|
|
391
|
+
`cad diff` and `cad release` now compare every file the release read besides the design's own: an edit to one is a
|
|
392
|
+
patch (`projects/home/objects/box.js changed`, `rules/m3.json changed`, `now reads rules/m3.json`), and an object
|
|
393
|
+
read through "uses" is rebuilt for the release as its tag holds it, so a box released wider since asks the lid for a
|
|
394
|
+
release. A design drawn with `v.fixings` reads every rule set in `rules/` (any of them may hold its threads or
|
|
395
|
+
material) and the project's material and printer, so an edit to any of those asks for its release too.
|
|
396
|
+
|
|
397
|
+
- Security: a CommonJS file in a design's project (a `.cjs` file, or a `.js` file Node reads as CommonJS) could load
|
|
398
|
+
Node's own modules past the sandbox's import hook, through `module.constructor._load` or `require.cache`, on every
|
|
399
|
+
Node: it could read every file of the workspace and, before Node 25, send what it read over the network. A design
|
|
400
|
+
added to your workspace from elsewhere could have read your other designs and sent them away when you ran
|
|
401
|
+
`cad check`. Now:
|
|
402
|
+
- No CommonJS file of a design's project is loaded in the sandbox, on any Node. Such a design stops with `designs
|
|
403
|
+
can't load …: it is a CommonJS file (require and module.exports), and a design's files are ES modules (import and
|
|
404
|
+
export)`. A copy of an allowed package kept in the project's own `node_modules` is held the same way.
|
|
405
|
+
- The sandbox's runner shuts the CommonJS loader to Node's own modules before the design loads: a request from a
|
|
406
|
+
file of the design's project, or from code with no file (`eval`, `new Function`, a callback queued onto the
|
|
407
|
+
loader), is refused whatever parent module it names; the tool's own packages still load what they need.
|
|
408
|
+
`module.register` and `module.registerHooks` are taken away, so no import hook can be added past the sandbox's.
|
|
409
|
+
- Node's own modules that reach the network, other programs or workers (`net`, `http`, `https`, `http2`, `tls`,
|
|
410
|
+
`dns`, `dgram`, `tty`, `child_process`, `worker_threads`, `vm`, `inspector` and the rest outside a short list of
|
|
411
|
+
quiet ones such as `fs`, `path`, `url` and `crypto`) are now refused to every caller in the sandbox, the tool's own
|
|
412
|
+
code included, by the import hook and by the CommonJS loader: a design can take the CommonJS loader from an
|
|
413
|
+
allowed package's own CommonJS code, hand it to a package's function as a callback or compile code under a tool
|
|
414
|
+
file's name, and could then load any of them. What it can still load that way reads only what the permission model
|
|
415
|
+
lets the sandbox read. The hook and the loader's lock also no longer read with `String.prototype.startsWith` and
|
|
416
|
+
the like, which a design can change for everyone where the hook runs in its own thread (Node 22.15 on): changing
|
|
417
|
+
them let a design import `node:net` past the hook.
|
|
418
|
+
- `process.loadEnvFile`, `process.execve`, `process.kill` and `process.openStdin` are taken away too.
|
|
419
|
+
- The design's `process.stdout`, `process.stderr`, `process.stdin` and `console` are plain streams: before Node 25
|
|
420
|
+
the real ones are sockets, whose class could connect anywhere. The runner reads its request and writes its reply
|
|
421
|
+
by file descriptor. What a design prints still comes out as before.
|
|
422
|
+
- The sandbox may now read, of the workspace, only the design's own project, the workspace's `package.json` and the
|
|
423
|
+
design's own cache folders: another project's files are out of its reach under Node's permission model too.
|
|
424
|
+
- Before Node 25 a plain design, with no CommonJS anywhere, could reach the network through Node's own web client:
|
|
425
|
+
touching `Headers`, `FormData`, `WebSocket` and the like loads it, and it leaves an agent on `globalThis` that
|
|
426
|
+
connects anywhere. The runner now holds that agent's place before the design loads, with one that refuses, and
|
|
427
|
+
takes those classes away.
|
|
428
|
+
- Node's permission model follows a link wherever it leads, so a link in a design's project could hand it a file of
|
|
429
|
+
another project or of yours elsewhere (one in the project's `node_modules` was not even looked at). Now a link
|
|
430
|
+
anywhere in the project that leads anywhere the sandbox does not read stops the design before it runs, with
|
|
431
|
+
`workspace.outside` and the link's name; a cache folder that holds a link is not read (each kept stage is made
|
|
432
|
+
afresh), and the workspace's `package.json` is not read where it is a link.
|
|
433
|
+
- Before Node 25, cad's note once a run now reads `designs are kept off the network on Node 24 by rulecad alone, not
|
|
434
|
+
by Node itself: use Node 25 or above for designs you did not write`: no way round the tests know of reaches the
|
|
435
|
+
network, but Node's permission model covers it only from Node 25.
|
|
436
|
+
- The README's Sandbox table says the new truth for each Node, and `test/sandbox-loader.test.mjs` tries each way
|
|
437
|
+
round on the Node it runs on.
|
|
438
|
+
|
|
439
|
+
Upgrading: a design whose project holds a CommonJS helper file must rewrite it with `import` and `export` (a `.mjs`
|
|
440
|
+
file, or a `.js` file in a workspace whose `package.json` says `"type": "module"`, as every workspace `npm create
|
|
441
|
+
rulecad` makes does). Nothing else changes; no printed size moves.
|
|
442
|
+
|
|
443
|
+
- `cad check` (and `preview`, `export`, `show`, `link`) on an assembly ignored `--set` without a word, even for names
|
|
444
|
+
that do not exist, so a size tried in an assembly seemed to pass when the check had used the old one. `--set
|
|
445
|
+
<item>.<variable>=<value>` now builds that object item at the value, held to the variable's tweak range as an
|
|
446
|
+
object's `--set` is, and the title says what was set. A name that is not an object item of the assembly, or not one
|
|
447
|
+
of that object's variables, is refused by name (`--set a.nonsense=1: item a (tray) has no variable "nonsense"`).
|
|
448
|
+
`cad list`, `wires`, `beams` and `animate` take `--set` the same way, and an assembly's link says what was set, as an
|
|
449
|
+
object's does (its downloads are named with it). `cad kit`, `plates`, `order`, `frame`, `machine`, `plot` and
|
|
450
|
+
`measured` build the assembly as its file says: they now refuse `--set` by name instead of passing it over.
|
|
451
|
+
- `cad list` (and the kit's README, the plates' and the motors' grams and minutes) estimated print time from the X1C's
|
|
452
|
+
flow whatever printer the project names. It now reads the `print_flow` of the printer the project names
|
|
453
|
+
(`project.json`'s `printer`, else `cad.config.json`'s), as `cad check` does. The total says whose flow it used,
|
|
454
|
+
and says so when it assumed one (12 mm³/s, for a printer whose rule set gives none) or assumed the material's
|
|
455
|
+
density (PLA's 1.25 g/cm³). `--json` adds `totals.printer`, `totals.flow` and, where assumed, `flowAssumed` and
|
|
456
|
+
`totals.density`.
|
|
457
|
+
- `cad set` turned a text variable's value into a number when it looked like one: a keycap legend `007` was saved as
|
|
458
|
+
`7`, and `1e3` was read as 1000. A text, anchor, layout or problem variable now keeps the text as typed; a choice
|
|
459
|
+
keeps the option named (text for a choice of strings, a number for a choice of numbers). `cad add item --object …
|
|
460
|
+
--set` reads the object's variables the same way.
|
|
461
|
+
|
|
462
|
+
For someone upgrading: print-time minutes change for projects on a printer other than the X1C (and the kit's README
|
|
463
|
+
with them); `--set` on an assembly now changes what is built, or is refused. No printed size moves.
|
|
464
|
+
|
|
465
|
+
- `cad new --frame ... --inside abc` was refused as "needs at least 2 entries"; a size that is not numbers is now
|
|
466
|
+
refused saying it is numbers in mm, as 300,300,350.
|
|
467
|
+
- A generated frame (`"frame": { "kind": ... }`) follows `@rulecad/frames`' generators: an `outside` is the whole
|
|
468
|
+
frame's, its feet and end caps with it, so the beams come out smaller; a cube join, or a bracket, gusset, hidden or
|
|
469
|
+
anchor join with no fitting, a slot join on a profile with no slot, and an inside too narrow for a blind or end-tap
|
|
470
|
+
join's taps are refused by name before anything is written, as is a blind join whose hex key cannot reach its head
|
|
471
|
+
(OpenBeam's 1515, which cad check failed at a corner). Frame sizing asks that last question through
|
|
472
|
+
`@rulecad/frames`' `blindKeyBlocked`, the same as before.
|
|
473
|
+
|
|
474
|
+
### Added
|
|
475
|
+
|
|
476
|
+
- `cad coupons` adds `projects/coupons` to a workspace: the fixings coupon, the holds coupon and the slot coupon, two
|
|
477
|
+
assemblies that lay them out (`coupons/fixings-test`, `coupons/slot-test`), and a `MEASURE.md` that says how to
|
|
478
|
+
print and read each row and the command that writes the figure back. The coupons lived only in the repository's
|
|
479
|
+
bench example, so the guide's `cad measured benchmarks/fixings-test` failed in a workspace made by
|
|
480
|
+
`npm create rulecad`. A workspace that has `projects/coupons` already keeps it as it is.
|
|
481
|
+
- `cad measured <name>=<value>` with no assembly (`cad measured x1c.pilot_m3=2.9`) writes a figure measured on a
|
|
482
|
+
coupon the same way as with one, into the workspace's copy of the rule set, marked measured with the date. Its row
|
|
483
|
+
goes in the workspace's own ledger, `ledger.jsonl`, with nothing said to have moved, since there are no checks to run
|
|
484
|
+
either side. `cad history` with no argument lists those rows, and `cad measured --strike <date> <name>` takes one out.
|
|
485
|
+
- `cad measured --export` prints every figure measured in the workspace that the kit does not hold yet as a unified
|
|
486
|
+
diff of the kit's rule sets (`packages/rules/<set>.json`), to send to the kit or apply to a copy of the repository;
|
|
487
|
+
`--json` gives the same as data. A set the kit has no file for is listed apart.
|
|
488
|
+
|
|
489
|
+
- A typed figure of the other sign from the one it replaces, or under half or over twice it (a tenth to ten times, for
|
|
490
|
+
an estimate), is refused as a likely slip of the pen before anything is written; `--force` writes it as it is. A fit
|
|
491
|
+
the coupon bounds by what a fit of its kind can be is held to that bound instead, as before, and a 0 for a figure a
|
|
492
|
+
coupon in the kit measures goes in as typed (the fixings coupon's nut slots start at 0).
|
|
493
|
+
- `cad measured <project>/<assembly> --strike <date> <name>` (or `<name>=<figure>`) takes a row out of the ledger,
|
|
494
|
+
and says what the rule set it went into still holds, since that is a file of its own.
|
|
495
|
+
- `--table` lists every rule the assembly reads that is an estimate, a community figure or a default (it listed
|
|
496
|
+
estimates only, so on the starter template it was empty), with the coupon in the kit that measures each, marked
|
|
497
|
+
where this assembly is that coupon, and the figures a coupon in the assembly measures that the rule set has no
|
|
498
|
+
figure for yet. It has a "Measured by" column, and `--json` gives its rows as data. `assumptions(ref)` in
|
|
499
|
+
`lib/measured.mjs` returns them.
|
|
500
|
+
|
|
501
|
+
For someone upgrading: a figure far from the one it replaces now needs `--force`; the moved list and the table are
|
|
502
|
+
longer. No printed size moves.
|
|
503
|
+
|
|
504
|
+
- A release commits, and its tag names (a line `reads: {…}`), what its build read besides the design's own files: the
|
|
505
|
+
files its code imported, whether it drew with `v.fixings` or `v.frames` (then the workspace's own rule sets those
|
|
506
|
+
read, and the project's `project.json`, are committed with it), and the files of the objects it reads.
|
|
507
|
+
- `build()` returns `reads`, that record; `readTexts(d, reads)` gives the text of each of those files; `inRelease()`
|
|
508
|
+
in `lib/versions.mjs` gives another object as a release has it. `framesContext()` and `fixingsContext()` also return
|
|
509
|
+
the files they read. The build cache's format moved on (a build says whether it used `v.frames`).
|
|
510
|
+
|
|
511
|
+
For someone upgrading: `cad status` may report released parts as changed for the first time, where a helper, a rule
|
|
512
|
+
set or an object they read changed since; release them, or put the file back. A release made before this is rebuilt
|
|
513
|
+
with the files its code imports by a path and with its own rule sets, so an old release exports its own geometry,
|
|
514
|
+
not today's: an exported size moves where a rule was measured again since. The first build of each design after the
|
|
515
|
+
upgrade is made afresh. A release's folder in `.versions/` has a new layout: one written by an earlier version, or from a tag since made
|
|
516
|
+
again, is made afresh.
|
|
517
|
+
|
|
518
|
+
- `cad rules update <set>` brings a workspace's copy of a kit rule set (`rules/<set>.json`) up to the kit's: it takes
|
|
519
|
+
each figure the kit checked after the copy's was, the kit's new rules, and the same figure where the kit says more of
|
|
520
|
+
it (a range, a newer source), and keeps every `measured` figure, every figure checked on or after the kit's date and
|
|
521
|
+
every rule the kit has none of. It prints each change (`cutout: 13.8 → 14`) and what it kept; `--dry-run` writes
|
|
522
|
+
nothing, `--json` gives it as data.
|
|
523
|
+
- `cad rules check` notes `rules.changed` where the kit has a different figure, checked after the copy's, for a rule
|
|
524
|
+
whose copy is not `measured` (before, a corrected kit figure never reached a workspace that had used the set, and the
|
|
525
|
+
check said nothing of it), and `rules.same` where a copy is the kit's set word for word. Notes never fail a set.
|
|
526
|
+
|
|
527
|
+
- Before Node 25, cad says once a run, on stderr, as it runs the first design in the sandbox, that designs are kept
|
|
528
|
+
off the network on your Node by rulecad alone, not by Node itself, and to use Node 25 or above for designs you did
|
|
529
|
+
not write (its words are under Fixed above). Node's permission model covers the network only from Node 25. Nothing
|
|
530
|
+
is said from Node 25 on, nor for a trusted workspace, whose designs run in the tool's own process.
|
|
531
|
+
|
|
532
|
+
- `cad check` now reports each seat a design draws with `v.shapes` for a bought part (`shaftBore`, `bearingSeat`,
|
|
533
|
+
`plainBearing`, `pulleyBore`) as it reports `v.fixings`'s holes: a `seat.drawn` finding saying what the seat was
|
|
534
|
+
drawn to, the fit it rests on and how far that fit is trusted (its kind). A press-fit bore for a 5 mm shaft, drawn
|
|
535
|
+
5.06 mm, rests on `SHAFT_FITS.press`, an estimate nobody has pressed a shaft into yet, and now says so. The findings
|
|
536
|
+
are kept with the build, so a check that reuses a kept build says them too. `@rulecad/shapes` is unchanged.
|
|
537
|
+
- An object's own check now warns when it rests on estimates (`rules.estimate`), as an assembly's check always has:
|
|
538
|
+
the rule-set entries it reads that are estimates, and the seats drawn to an estimated fit. Before, only an assembly
|
|
539
|
+
that held the object said so, although `AGENTS.md` promises that the check flags an estimate. An assembly's warning
|
|
540
|
+
names those seats too: a seat drawn to an estimated printer rule (a bearing pocket on `x1c.press`) is named as that
|
|
541
|
+
rule, to settle with `cad measured`, and one drawn to `SHAFT_FITS.press` by giving the fit that works.
|
|
542
|
+
|
|
543
|
+
- `cad new --frame ... --join cube --estimate` (and `"join": { "kind": "cube", "estimate": true }` in an assembly):
|
|
544
|
+
a frame whose join the kit cannot build yet, made all the same and checked by its estimate.
|
|
545
|
+
- `cad frame` adds a line with the whole frame's size, its feet and end caps fitted, where it is more than the beams'.
|
|
546
|
+
|
|
547
|
+
For someone upgrading: a generated frame asked for by `outside` has shorter uprights (by its feet's and caps' height)
|
|
548
|
+
and, on levelling feet, beams 4 mm shorter across; an assembly whose frame joins cube, or bracket, gusset, hidden or
|
|
549
|
+
anchor with no fitting, is refused until its join says `"estimate": true`. Frames asked for by `inside` keep every size.
|
|
550
|
+
|
|
551
|
+
### Changed
|
|
552
|
+
|
|
553
|
+
- The source a coupon's figure is written with names the coupon's `MEASURE.md` in your workspace
|
|
554
|
+
(`the fixings coupon (projects/coupons/MEASURE.md)`), or says how to get it, never the repository's
|
|
555
|
+
`examples/bench/...` path. A pilot or insert hole measured with no project names "the plastic it was printed in"
|
|
556
|
+
where it said "THE PROJECT'S PLASTIC".
|
|
557
|
+
|
|
558
|
+
For someone upgrading: nothing you have changes until you run `cad coupons` or measure with no assembly. No printed
|
|
559
|
+
size moves.
|
|
560
|
+
|
|
561
|
+
- The cut lists of short frames may buy fewer or shorter bars, as `@rulecad/frames` now packs a list of up to 20 beams
|
|
562
|
+
exactly: the worked example's box (EXAMPLES.md) now buys three 1000 mm bars, 3000 mm of metal, where it bought one
|
|
563
|
+
4000 mm bar.
|
|
564
|
+
|
|
565
|
+
For someone upgrading: bars and their numbering in a cut list may change. No printed size moves.
|
|
566
|
+
|
|
567
|
+
- The README's section on pins and magnets says that `x1c.snap_clearance` is now measured (on the launcher's fit test
|
|
568
|
+
plate) and the other fits remain estimates until the holds coupon measures them. No command changed.
|
|
569
|
+
|
|
570
|
+
For someone upgrading: nothing to do. Snap pin sockets in your checks move with `@rulecad/rules` and
|
|
571
|
+
`@rulecad/fixings`: see their notes.
|
|
572
|
+
|
|
573
|
+
- A release outside a git repository, or where git has no name and email address to commit under, is refused before
|
|
574
|
+
anything is written, saying what to run (`git init`; `git config user.name` and `user.email`), instead of git's own
|
|
575
|
+
error after the version was bumped. `--dry-run` still works without a repository.
|
|
576
|
+
- With `--push`, a push that fails now says the release was made and tagged here and how to push it later.
|
|
577
|
+
- What changes when you upgrade: nothing to do. A project released with an earlier version can be changed with
|
|
578
|
+
`cad set` again. No printed size moves.
|
|
579
|
+
|
|
580
|
+
- The `rules.new` note now points at `cad rules update` rather than at deleting the copy.
|
|
581
|
+
|
|
582
|
+
For someone upgrading: `cad rules check` may show new notes in an older workspace. Run `cad rules update <set>` to take
|
|
583
|
+
the kit's corrections, then check the designs that use the set: a figure the update changes can move a printed size.
|
|
584
|
+
To keep a correction of your own, give it `"kind": "measured"` (or the date you checked it). The kit's own examples
|
|
585
|
+
were brought up to date (their copies identical to the kit's deleted, the rest updated); no printed size in them moved,
|
|
586
|
+
since no figure they share with the kit differed: the bench's printer now has its own `thread_gap`, so its fixings
|
|
587
|
+
coupons no longer note that the X1C's was borrowed.
|
|
588
|
+
|
|
589
|
+
- The README's Sandbox paragraph is now a table of what a design can read, write, import, start and send on Node
|
|
590
|
+
22.13 to 22.14 (where the import hook runs in a worker, so a CommonJS file's `require()` passes it by), Node 22.15
|
|
591
|
+
to 24, and from Node 25, and what holds each. Each row is tried on the Node the tests run on. It says plainly what
|
|
592
|
+
the old paragraph did not: on every Node, a CommonJS file in a design's project can load Node's own modules past
|
|
593
|
+
the import hook and read any file in the folders the sandbox may read (the workspace among them); only Node's
|
|
594
|
+
permission model stops it writing, starting programs and, from Node 25, sending.
|
|
595
|
+
- The list of packages a design may import is the hook's own, `ALLOWED` in `lib/sandbox-hooks.mjs`, everywhere: the
|
|
596
|
+
README, AGENTS.md (which had left out `@rulecad/frames`) and the sandbox's own list of what it may read follow it,
|
|
597
|
+
and a test holds the documents to it.
|
|
598
|
+
|
|
599
|
+
Upgrading: nothing to change. On Node before 25 you see the one-line note on commands that build a design; use Node
|
|
600
|
+
25 or above to run designs you did not write. No printed size moves.
|
|
601
|
+
|
|
602
|
+
- An object that is not printed (`"role": "reference"` or `"board"`: a bought circuit board, drilled by its maker) has
|
|
603
|
+
its `v.fixings` holes drawn to the rule's figure as it stands, with no printer hole compensation: a reference
|
|
604
|
+
board's M2.5 holes are now drawn 2.9 mm (`m2_5.clearance`), where they were 3.0 mm (with `x1c.hole_comp`). The
|
|
605
|
+
fasten check holds a reference's holes to the clearance figure as drilled, as it does a board's.
|
|
606
|
+
- The cad README lists `estimate` and `derived` among the kinds a rule carries.
|
|
607
|
+
|
|
608
|
+
For someone upgrading: object checks may now show a new warning, `uses estimates, not measurements`, and seat
|
|
609
|
+
findings; neither fails a check. Each design is built afresh once after the upgrade (the build cache's format moved
|
|
610
|
+
on). No printed part's size moves: only a reference's holes, which are never printed, are drawn smaller.
|
|
611
|
+
|
|
8
612
|
## 0.9.0: belt spans shared by their lengths; two joins at one end add their springs; generated frames on castors build, with the castors' bolts on the list; unused names and silent error handling tidied, with no change in behaviour; a design that runs for ever or fills memory is stopped, with design.time or design.memory; a fasten fails across air between its parts, warns on thin walls round its far hole, and holds a slot nut's whole length in its slot; feet are checked at the load the frame puts on them; a flat part's analysis reads box, polygon and part supports and loads as cad optimise does; the kit's code is laid out by a formatter, so cached builds are made again once; frame sizing solves each profile it tries on that profile's own join springs; frame.size says which members its stress limit could not check; cad frame --size --write checks the design it would write, and writes nothing that fails; frame.tip, a frame that would tip over; a gear mesh fails when the two gears' teeth sit at different heights along their axes; gear meshes in an assembly are judged where their axes are, with the room under their tips; meshes, zips and board models from elsewhere are limited, and malformed ones refused in plain words; join.drop predicts from the real frame, and skips beams held elsewhere; cad link refuses a model the page would turn away, using model-link's own checks; live views answer only to this computer's own names, and only their own page can stop a run; the motor checks count the weight of the parts a motor moves, and work for slides; needs Node 22.13 or later, the version the kit is tested on; cad check shows printcheck's overhang and hole findings; printed beams are checked for real buckling, sag after creep and softening; what a sandboxed design hands back for the caches is capped, and kept apart from other designs' results; a screw's tightening limit follows one rule with a load and without, a torque given is held against a plastic thread, and screws sharing a load are reckoned at the torque they are all tightened to; strength checks read the stress at a part's surface; links out of the workspace are refused, for designs, rule sets, project files and targets
|
|
9
613
|
|
|
10
614
|
### Fixed
|