@rulecad/cad 0.7.57 → 0.7.58

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/EXAMPLES.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [The tutorial](TUTORIAL.md) ends with a wall hook checked against its screw. These examples carry on from there, one
4
4
  for each thing the [README](README.md) describes after that: parts, variants and releases, joints and poses, a model
5
- from elsewhere, an optimised part, a board, a mechanism printed flat, gears, a gearbox, a motor, a robot joint, a machine sized from its task, a bracket screwed on, and a frame of beams with a moving axis. Each is a few files and the commands to run
5
+ from elsewhere, an optimised part, a board, a mechanism printed flat, gears, a gearbox, a motor, a robot joint, a machine sized from its task, a bracket screwed on, a frame of beams with a moving axis, and a case of printed beams as a kit. Each is a few files and the commands to run
6
6
  them. The tests write every file here and run every command, so what you read is what works.
7
7
 
8
8
  They start from a workspace `npm create rulecad my-designs` makes, as the tutorial does, and run in order: later
@@ -3526,7 +3526,7 @@ The project lists the new objects:
3526
3526
 
3527
3527
  The shoulder's bearing is the same `support` with the 6800 named; the elbow's three printed clips are named too, as they are in chapter 12. `joint.moment` puts 0.134 N m of tipping and 5.72 N across the shoulder bearing (24 N equivalent, against its 925 N static rating), and 0.038 N m through the elbow's clips, which FE reads at 1.1 MPa. Neither is close. The moment is small because the tool is held out in the plane the arm turns in: gravity does its work as torque on the motors, not as tipping on the bearing. A person who put an object out in front of the plate instead (the wrist 100 mm further from the wall) would see this moment grow, and the 6800 and the clips are what would need looking at again.
3528
3528
 
3529
- `link.deflection` reads the links as drawn, by finite elements: the upper arm with everything bolted to it, as one piece from its joint's axis out, held at the joint and loaded at its far end with the weight it carries, then the forearm the same way. This is a coarse model: 4 mm cubes through a 12 mm arm, and printed parts bolted together treated as one solid. It says the tool drops 1.8 mm at full stretch, nearly all of it from the upper arm bending in its plane with its own motor at its end. It's an `estimate`, and a generous one: a hand formula on the bare 22 × 12 mm upper arm gives about 0.6 mm at the tool; finer cells (`"cell": 2.5` on the joint's `support`) and a real measurement are both worth doing before believing either. Bench test 17 measures the tool's actual position. It is the largest term in the budget (the arm's own sag under its own weight and motor): the budget here, 2.5 mm, is a gripper's, and a gripper tolerates being a millimetre low. To draw upright, the arm would need its elbow motor off the far end of the upper arm, or a thicker link: that's the second thing a person would change.
3529
+ `link.deflection` reads the links as drawn, by finite elements: the upper arm with everything bolted to it, as one piece from its joint's axis out, held at the joint and loaded at its far end with the weight it carries, then the forearm the same way. This is a coarse model: 4 mm cubes through a 12 mm arm, and printed parts bolted together treated as one solid. It says the tool drops 1.8 mm at full stretch, nearly all of it from the upper arm bending in its plane with its own motor at its end. It's an `estimate`, and a generous one: a hand formula on the bare 22 × 12 mm upper arm gives about 0.6 mm at the tool; finer cells (`"linkCell": 2.5` on the joint's `support`) and a real measurement are both worth doing before believing either. Bench test 17 measures the tool's actual position. It is the largest term in the budget (the arm's own sag under its own weight and motor): the budget here, 2.5 mm, is a gripper's, and a gripper tolerates being a millimetre low. To draw upright, the arm would need its elbow motor off the far end of the upper arm, or a thicker link: that's the second thing a person would change.
3530
3530
 
3531
3531
  `assembly.frequency` puts the lowest mode at about 12 Hz at full stretch, from the same FE stiffness and the mass it carries: slow enough to see, and worth moving gently at the start and end of a motion. The FE's coarseness is why this is said to one significant figure.
3532
3532
 
@@ -6587,7 +6587,10 @@ What the check says, piece by piece:
6587
6587
  detent (0.012 against 0.025 N m). `motor.heat`: the case reaches 53.8 °C at 1.2 A, under PLA's 57 °C.
6588
6588
  `joint.moment`: 556 g carried, the worse bearing takes 2.7 N against an LM8UU's 400 N.
6589
6589
  - `frame.square`: each bay's two diagonals, to measure when building it. The two sides along x have a 260 by 120 mm
6590
- opening: each diagonal 286.36 mm, and a difference of up to 0.91 mm to accept from beams cut to ±0.5 mm.
6590
+ opening: each diagonal 286.36 mm, and a difference of up to 1.08 mm to accept. The two rails' cuts at ±0.5 mm give
6591
+ 0.91 mm of it (2 × 0.5 × 260 / 286.36) and the four blind joins' play 0.17 mm (4 × 0.1 × 120 / 286.36, an
6592
+ estimate), stacked worst case; 0.65 mm root-sum-square. Once it is squared, the difference measured goes back with
6593
+ `cad measured frame/box frame.square.p1-p2-x1-x3=<mm>`.
6591
6594
  - `join.stiffness`: what each join puts at the rail's end when the frame is solved. A blind join is 1.5 N·m/mrad in
6592
6595
  bending and 0.3 in twist, an estimate; a bracket's bending, 0.095 N·m/mrad, is its own by finite elements, and the
6593
6596
  slot nuts and lips are in neither. Both stay estimates until the joint rig (issue 264) measures one.
@@ -6768,3 +6771,418 @@ Five things do not, and their findings say so:
6768
6771
 
6769
6772
  The frame's own sag and sway under the carriage's load, and its lowest frequency, come with the frame checks (issues
6770
6773
  265 to 267).
6774
+
6775
+ ## 17. Printed beams: a small case as a kit
6776
+
6777
+ A case for a Raspberry Pi 4 with every beam printed: no bar to buy, no saw, no tap. The frame is drawn first in
6778
+ aluminium, MISUMI's 2020 (`2020-misumi-hfs5`), and the check is asked which of its beams could be printed in PETG
6779
+ instead. All of them can, by a wide margin, so the case is drawn again with every beam printed: four posts and eight
6780
+ rails printed standing up, so they keep the four slots of MISUMI's section, and the cross beam under the board printed
6781
+ lying down from the kit's printable 2020 (`2020-printed`), whose one slot faces up. Printed brackets hold the corners,
6782
+ printed gussets the cross beam, a 3 mm acrylic panel closes each side, and the feet, end caps, the board's mount and a
6783
+ fan mount all come from the kit's fittings. The frame's sag under the board is reported for both materials. A rail
6784
+ longer than the printer's bed is spliced, a foot drawn for the aluminium post is caught, and the whole case is written
6785
+ out as a kit: one plate to print and a page to build it from.
6786
+
6787
+ ```json projects/case/project.json
6788
+ {
6789
+ "name": "case",
6790
+ "title": "A printed case for a small computer board",
6791
+ "printer": "x1c",
6792
+ "material": "PETG",
6793
+ "objects": []
6794
+ }
6795
+ ```
6796
+
6797
+ PETG rather than PLA: a board in a closed case runs warm, and PETG softens later.
6798
+
6799
+ ### The board
6800
+
6801
+ The board is bought, so it is a rule set: its size, its four mounting holes and their diameter from the Raspberry Pi 4
6802
+ Model B product brief (Raspberry Pi Ltd, April 2024). The brief gives no mass and no board thickness: the mass is what
6803
+ shops list (45 to 50 g, a community figure) and the thickness is the common 1.6 mm board (an estimate). Weigh and
6804
+ measure yours.
6805
+
6806
+ ```json rules/rpi4.json
6807
+ {
6808
+ "_doc": "Raspberry Pi 4 Model B, the board alone, from the maker's product brief. Board in the x-y plane, the USB and Ethernet end at +x, seen from above.",
6809
+ "name": "rpi4",
6810
+ "part": "board",
6811
+ "rules": {
6812
+ "body_width": { "value": 85, "unit": "mm", "rule": "The board's length, along x", "kind": "spec", "source": "Raspberry Pi 4 Model B product brief (Raspberry Pi Ltd, April 2024), Physical specification, https://pip.raspberrypi.com/categories/545-raspberry-pi-4-model-b", "checked": "2026-11-20" },
6813
+ "body_depth": { "value": 56, "unit": "mm", "rule": "The board's width, along y", "kind": "spec", "source": "Raspberry Pi 4 Model B product brief (Raspberry Pi Ltd, April 2024), Physical specification, https://pip.raspberrypi.com/categories/545-raspberry-pi-4-model-b", "checked": "2026-11-20" },
6814
+ "mount_holes": { "value": [-39, -24.5, 19, -24.5, -39, 24.5, 19, 24.5], "unit": "mm", "rule": "The four mounting holes, centres from the board's middle, x then y for each: 3.5 mm in from the end away from the USB sockets and 58 mm on, 3.5 mm in from each long edge and 49 mm apart", "kind": "spec", "source": "Raspberry Pi 4 Model B product brief (Raspberry Pi Ltd, April 2024), Physical specification, https://pip.raspberrypi.com/categories/545-raspberry-pi-4-model-b", "checked": "2026-11-20" },
6815
+ "mount_hole_diameter": { "value": 2.7, "unit": "mm", "rule": "The mounting holes, for M2.5 screws", "kind": "spec", "source": "Raspberry Pi 4 Model B product brief (Raspberry Pi Ltd, April 2024), Physical specification, https://pip.raspberrypi.com/categories/545-raspberry-pi-4-model-b", "checked": "2026-11-20" },
6816
+ "board_thickness": { "value": 1.6, "unit": "mm", "rule": "The board through its mounting holes: the brief does not give it, so the common 1.6 mm board is taken. Measure yours", "kind": "estimate", "source": "The common 1.6 mm FR-4 board; the maker's brief gives no thickness", "checked": "2026-11-20" },
6817
+ "mass": { "value": 0.05, "unit": "kg", "rule": "The board as sold, without a case: shops list 45 to 50 g, and the maker publishes none. Weigh yours", "kind": "community", "source": "Shop listings: Heltec, 50 g, https://heltec.org/?p=81049; othoba.com, 45 g, https://othoba.com/raspberry-pi-4-model-b-4gb-for-high-performance-general-purpose-computer-incorporating-a-quad-core-64-bit-arm-cortex-a72-cpu-dishantech-bd-940248", "checked": "2026-11-20" }
6818
+ }
6819
+ }
6820
+ ```
6821
+
6822
+ ### The case in aluminium
6823
+
6824
+ Up is z, and the case stands on its feet at z = 0. Four posts, `p1` to `p4`, stand 120 mm tall at the corners of a
6825
+ 180 by 170 mm rectangle. Rails join them at 10 mm and at 110 mm up: `x1` to `x4` along x, `y1` to `y4` along y, each
6826
+ placed by its two ends so it runs from post face to post face. `x2` and `x4` run from `p3` to `p4`, right to left: a
6827
+ gusset lies on the side of its two beams that b's direction turns toward a's, so with `x2` drawn that way the gusset at
6828
+ the cross beam's far end lies on top, as the near one does.
6829
+
6830
+ - **The corners.** Every rail is held to its post by a `bracket` join with `"fitting": "printed"`: a corner bracket
6831
+ from `@rulecad/frames`, sized from a 100 N load, on two M4 screws into drop-in nuts. A bracket lies in the corner
6832
+ on the rail's top or bottom face and the post's face, so it needs a slot in both.
6833
+ - **The cross beam.** `m1` runs along y in the middle of the bottom, from `x1` to `x2`, held at each end by a printed
6834
+ `gusset`: a T plate on the top faces of both beams.
6835
+ - **The board.** `pi` is the bought board on a printed mount (`"mount"`) in the middle of `m1`'s top slot, turned so
6836
+ its long side lies across the beam. Its four M2.5 screws go down through its holes into pilots in the mount's bosses;
6837
+ the mount's two M5 screws go into roll-in nuts in the slot.
6838
+ - **The fan.** A printed `fan-mount` for a 40 mm fan on the inner face of the back top rail, `x4`, on two M5 screws.
6839
+ - **The sides.** A 3 mm acrylic `panel` in each side, its clips screwed into the slots that face out. A clip's nut
6840
+ goes into a slot already closed at both ends, so the panels take roll-in nuts (`"nut": "roll-in"`).
6841
+ - **Feet and caps.** A printed `foot` under each post, an M5 screw through it into the post's tapped end, and a
6842
+ printed `end-cap` on each post's top.
6843
+ - **The sag.** `"frame": { "points": ["m1.top@50%"] }` asks for the sag under the board. Nothing is hung there by
6844
+ hand: the board and its mount are items on `m1`, so their mass is where they are.
6845
+ - **Printed instead.** `"printed": "petg"` asks, for each beam, whether it could be printed in PETG.
6846
+
6847
+ ```json projects/case/assemblies/aluminium.json
6848
+ {
6849
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
6850
+ "title": "The case in aluminium",
6851
+ "kind": "fit",
6852
+ "description": "Four posts and two rings of MISUMI 2020, a cross beam under the board, printed brackets at the corners and gussets at the cross beam, a panel in each side, feet and caps, the board on its mount and a fan mount; each beam tried printed in PETG.",
6853
+ "items": [
6854
+ { "id": "p1", "beam": { "profile": "2020-misumi-hfs5", "ops": [{ "op": "tap", "at": "a", "thread": "M5", "depth": 18.5 }] }, "from": [10, 10, 0], "to": [10, 10, 120] },
6855
+ { "id": "p2", "beam": { "profile": "2020-misumi-hfs5", "ops": [{ "op": "tap", "at": "a", "thread": "M5", "depth": 18.5 }] }, "from": [170, 10, 0], "to": [170, 10, 120] },
6856
+ { "id": "p3", "beam": { "profile": "2020-misumi-hfs5", "ops": [{ "op": "tap", "at": "a", "thread": "M5", "depth": 18.5 }] }, "from": [170, 160, 0], "to": [170, 160, 120] },
6857
+ { "id": "p4", "beam": { "profile": "2020-misumi-hfs5", "ops": [{ "op": "tap", "at": "a", "thread": "M5", "depth": 18.5 }] }, "from": [10, 160, 0], "to": [10, 160, 120] },
6858
+ { "id": "x1", "beam": { "profile": "2020-misumi-hfs5" }, "from": [20, 10, 10], "to": [160, 10, 10] },
6859
+ { "id": "x2", "beam": { "profile": "2020-misumi-hfs5" }, "from": [160, 160, 10], "to": [20, 160, 10] },
6860
+ { "id": "y1", "beam": { "profile": "2020-misumi-hfs5" }, "from": [10, 20, 10], "to": [10, 150, 10] },
6861
+ { "id": "y2", "beam": { "profile": "2020-misumi-hfs5" }, "from": [170, 20, 10], "to": [170, 150, 10] },
6862
+ { "id": "x3", "beam": { "profile": "2020-misumi-hfs5" }, "from": [20, 10, 110], "to": [160, 10, 110] },
6863
+ { "id": "x4", "beam": { "profile": "2020-misumi-hfs5" }, "from": [160, 160, 110], "to": [20, 160, 110] },
6864
+ { "id": "y3", "beam": { "profile": "2020-misumi-hfs5" }, "from": [10, 20, 110], "to": [10, 150, 110] },
6865
+ { "id": "y4", "beam": { "profile": "2020-misumi-hfs5" }, "from": [170, 20, 110], "to": [170, 150, 110] },
6866
+ { "id": "m1", "beam": { "profile": "2020-misumi-hfs5" }, "from": [90, 20, 10], "to": [90, 150, 10] },
6867
+ { "id": "foot1", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5" }, "at": "p1.a" },
6868
+ { "id": "foot2", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5" }, "at": "p2.a" },
6869
+ { "id": "foot3", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5" }, "at": "p3.a" },
6870
+ { "id": "foot4", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5" }, "at": "p4.a" },
6871
+ { "id": "cap1", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p1.b" },
6872
+ { "id": "cap2", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p2.b" },
6873
+ { "id": "cap3", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p3.b" },
6874
+ { "id": "cap4", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p4.b" },
6875
+ { "id": "front", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["x1", "p2", "x3", "p1"], "out": [0, -1, 0], "nut": "roll-in" } },
6876
+ { "id": "back", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["x2", "p3", "x4", "p4"], "out": [0, 1, 0], "nut": "roll-in" } },
6877
+ { "id": "left", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["y1", "p4", "y3", "p1"], "out": [-1, 0, 0], "nut": "roll-in" } },
6878
+ { "id": "right", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["y2", "p3", "y4", "p2"], "out": [1, 0, 0], "nut": "roll-in" } },
6879
+ { "id": "pi", "bought": "rpi4", "mount": { "on": "m1.top@65", "turn": 90, "nut": "roll-in" } },
6880
+ { "id": "fan", "fitting": { "kind": "fan-mount", "profile": "2020-misumi-hfs5", "size": 40 }, "at": "x4.back@70" }
6881
+ ],
6882
+ "joins": [
6883
+ { "kind": "bracket", "a": "x1.a", "b": "p1.back@10", "fitting": "printed", "nut": "drop-in" },
6884
+ { "kind": "bracket", "a": "x1.b", "b": "p2.front@10", "fitting": "printed", "nut": "drop-in" },
6885
+ { "kind": "bracket", "a": "x2.a", "b": "p3.front@10", "fitting": "printed", "nut": "drop-in" },
6886
+ { "kind": "bracket", "a": "x2.b", "b": "p4.back@10", "fitting": "printed", "nut": "drop-in" },
6887
+ { "kind": "bracket", "a": "y1.a", "b": "p1.top@10", "fitting": "printed", "nut": "drop-in" },
6888
+ { "kind": "bracket", "a": "y1.b", "b": "p4.bottom@10", "fitting": "printed", "nut": "drop-in" },
6889
+ { "kind": "bracket", "a": "y2.a", "b": "p2.top@10", "fitting": "printed", "nut": "drop-in" },
6890
+ { "kind": "bracket", "a": "y2.b", "b": "p3.bottom@10", "fitting": "printed", "nut": "drop-in" },
6891
+ { "kind": "bracket", "a": "x3.a", "b": "p1.back@110", "fitting": "printed", "nut": "drop-in" },
6892
+ { "kind": "bracket", "a": "x3.b", "b": "p2.front@110", "fitting": "printed", "nut": "drop-in" },
6893
+ { "kind": "bracket", "a": "x4.a", "b": "p3.front@110", "fitting": "printed", "nut": "drop-in" },
6894
+ { "kind": "bracket", "a": "x4.b", "b": "p4.back@110", "fitting": "printed", "nut": "drop-in" },
6895
+ { "kind": "bracket", "a": "y3.a", "b": "p1.top@110", "fitting": "printed", "nut": "drop-in" },
6896
+ { "kind": "bracket", "a": "y3.b", "b": "p4.bottom@110", "fitting": "printed", "nut": "drop-in" },
6897
+ { "kind": "bracket", "a": "y4.a", "b": "p2.top@110", "fitting": "printed", "nut": "drop-in" },
6898
+ { "kind": "bracket", "a": "y4.b", "b": "p3.bottom@110", "fitting": "printed", "nut": "drop-in" },
6899
+ { "kind": "gusset", "a": "m1.a", "b": "x1.back@70", "fitting": "printed", "nut": "drop-in" },
6900
+ { "kind": "gusset", "a": "m1.b", "b": "x2.back@70", "fitting": "printed", "nut": "drop-in" }
6901
+ ],
6902
+ "fasten": [
6903
+ { "screw": "M5 cap", "through": ["foot1"], "into": "p1", "at": ["foot1.b1"], "note": "Foot 1" },
6904
+ { "screw": "M5 cap", "through": ["foot2"], "into": "p2", "at": ["foot2.b1"], "note": "Foot 2" },
6905
+ { "screw": "M5 cap", "through": ["foot3"], "into": "p3", "at": ["foot3.b1"], "note": "Foot 3" },
6906
+ { "screw": "M5 cap", "through": ["foot4"], "into": "p4", "at": ["foot4.b1"], "note": "Foot 4" },
6907
+ { "screw": "M5 button", "through": ["fan"], "into": "x4.back", "at": ["fan.b1", "fan.b2"], "nut": "roll-in", "note": "The fan mount" }
6908
+ ],
6909
+ "frame": { "points": ["m1.top@50%"], "printed": "petg" }
6910
+ }
6911
+ ```
6912
+
6913
+ ```sh
6914
+ npx cad check case/aluminium
6915
+ ```
6916
+
6917
+ The frame checks with nothing failing and nothing warning. Under the board, `m1` sags 0.000352 mm with the joins'
6918
+ springs (`frame.deflection`), against 0.361 mm allowed (its 130 mm span over 360). Then `beam.printable` takes each
6919
+ beam in turn, puts the kit's printable 2020 in its place in PETG, solves the frame again and holds the beam to the
6920
+ frame's sags, its stress and buckling with twice the margin, a creep limit and its sag as it creeps:
6921
+
6922
+ - Every one of the 13 beams can be printed. The least margin of each is from 70 (`x1` and `x2`, on their sag as they
6923
+ creep: they carry the cross beam's ends) to 368 (the bottom side rails); `m1` under the board 82, the posts over 200.
6924
+ - All 13 printed together and solved once more, the least margin is 26.6, on `m1`'s sag as it creeps (0.014 mm), with
6925
+ 438 g of PETG in all.
6926
+ - 14 of the joins need changing to print it that way: the kit's printable 2020 has one slot, in its top face, and a
6927
+ bracket landing on a post's side face, or a panel's clip, needs a slot there.
6928
+
6929
+ So every beam could be either: aluminium, or PETG. What decides how each is printed is how many of its faces need a
6930
+ slot.
6931
+
6932
+ ### Every beam printed
6933
+
6934
+ A beam lying down prints with its layers along it, strong in bending, but only a slot facing up prints without
6935
+ supports, so the kit's printable profiles have one. A beam standing on its end prints its section exactly as drawn,
6936
+ every slot included, but its layers lie across it, so it bends at PETG's strength across its layers, 23 MPa against
6937
+ 34 along them, and its slots' lips hold less. In this case the posts and the rails each need three or four slotted
6938
+ faces: the brackets' and the panels'. They print standing up, from MISUMI's own section, each no taller than the
6939
+ X1C's 256 mm. The cross beam needs its top slot alone, for the gussets and the board's mount, so it lies down.
6940
+
6941
+ - **`"printed"` on a beam.** `{ "pose": "standing", "pull": 50 }` for the posts and rails: `pull` is the design pull
6942
+ on a slot nut. At 100 N, the kit's default, a standing slot's lips hold 1.56 times, under the twice a printed part
6943
+ is sized for; at 50 N they hold 3.07 times. 50 N is a hand pressing on a closed case.
6944
+ - **The posts' ends.** A tapped end of a printed beam becomes a fixing of the print. MISUMI's section has a 4.2 mm
6945
+ bore and names no printed end of its own, so standing up the end takes its screw in the bore's place: an M4 heat-set
6946
+ insert needs 4.95 mm of plastic round its middle and the section has 4, so it takes an M3 captive nut (`"end":
6947
+ "nut"`), slid in from the side 4.5 mm in from the end, its screw up the bore. The foot is drawn for that thread
6948
+ (`"thread": "M3"`), and its screw is an M3.
6949
+ - **The rest** is as in aluminium: the same joins, fittings, panels and board.
6950
+
6951
+ ```json projects/case/assemblies/printed.json
6952
+ {
6953
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
6954
+ "title": "The case, every beam printed",
6955
+ "kind": "fit",
6956
+ "description": "Four posts and two rings of beams, all printed in PETG: those that need four slotted faces standing up from MISUMI's 2020, the cross beam under the board lying down from the kit's printable 2020. Printed brackets at the corners, gussets at the cross beam, a panel in each side, feet and caps, the board on its mount and a fan mount.",
6957
+ "items": [
6958
+ { "id": "p1", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50, "end": "nut" }, "ops": [{ "op": "tap", "at": "a" }] }, "from": [10, 10, 0], "to": [10, 10, 120] },
6959
+ { "id": "p2", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50, "end": "nut" }, "ops": [{ "op": "tap", "at": "a" }] }, "from": [170, 10, 0], "to": [170, 10, 120] },
6960
+ { "id": "p3", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50, "end": "nut" }, "ops": [{ "op": "tap", "at": "a" }] }, "from": [170, 160, 0], "to": [170, 160, 120] },
6961
+ { "id": "p4", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50, "end": "nut" }, "ops": [{ "op": "tap", "at": "a" }] }, "from": [10, 160, 0], "to": [10, 160, 120] },
6962
+ { "id": "x1", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [20, 10, 10], "to": [160, 10, 10] },
6963
+ { "id": "x2", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [160, 160, 10], "to": [20, 160, 10] },
6964
+ { "id": "y1", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [10, 20, 10], "to": [10, 150, 10] },
6965
+ { "id": "y2", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [170, 20, 10], "to": [170, 150, 10] },
6966
+ { "id": "x3", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [20, 10, 110], "to": [160, 10, 110] },
6967
+ { "id": "x4", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [160, 160, 110], "to": [20, 160, 110] },
6968
+ { "id": "y3", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [10, 20, 110], "to": [10, 150, 110] },
6969
+ { "id": "y4", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50 } }, "from": [170, 20, 110], "to": [170, 150, 110] },
6970
+ { "id": "m1", "beam": { "profile": "2020-printed", "material": "petg", "printed": true }, "from": [90, 20, 10], "to": [90, 150, 10] },
6971
+ { "id": "foot1", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5", "thread": "M3" }, "at": "p1.a" },
6972
+ { "id": "foot2", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5", "thread": "M3" }, "at": "p2.a" },
6973
+ { "id": "foot3", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5", "thread": "M3" }, "at": "p3.a" },
6974
+ { "id": "foot4", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5", "thread": "M3" }, "at": "p4.a" },
6975
+ { "id": "cap1", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p1.b" },
6976
+ { "id": "cap2", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p2.b" },
6977
+ { "id": "cap3", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p3.b" },
6978
+ { "id": "cap4", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p4.b" },
6979
+ { "id": "front", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["x1", "p2", "x3", "p1"], "out": [0, -1, 0], "nut": "roll-in" } },
6980
+ { "id": "back", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["x2", "p3", "x4", "p4"], "out": [0, 1, 0], "nut": "roll-in" } },
6981
+ { "id": "left", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["y1", "p4", "y3", "p1"], "out": [-1, 0, 0], "nut": "roll-in" } },
6982
+ { "id": "right", "panel": { "sheet": "acrylic", "thickness": 3, "bay": ["y2", "p3", "y4", "p2"], "out": [1, 0, 0], "nut": "roll-in" } },
6983
+ { "id": "pi", "bought": "rpi4", "mount": { "on": "m1.top@65", "turn": 90, "nut": "roll-in" } },
6984
+ { "id": "fan", "fitting": { "kind": "fan-mount", "profile": "2020-misumi-hfs5", "size": 40 }, "at": "x4.back@70" }
6985
+ ],
6986
+ "joins": [
6987
+ { "kind": "bracket", "a": "x1.a", "b": "p1.back@10", "fitting": "printed", "nut": "drop-in" },
6988
+ { "kind": "bracket", "a": "x1.b", "b": "p2.front@10", "fitting": "printed", "nut": "drop-in" },
6989
+ { "kind": "bracket", "a": "x2.a", "b": "p3.front@10", "fitting": "printed", "nut": "drop-in" },
6990
+ { "kind": "bracket", "a": "x2.b", "b": "p4.back@10", "fitting": "printed", "nut": "drop-in" },
6991
+ { "kind": "bracket", "a": "y1.a", "b": "p1.top@10", "fitting": "printed", "nut": "drop-in" },
6992
+ { "kind": "bracket", "a": "y1.b", "b": "p4.bottom@10", "fitting": "printed", "nut": "drop-in" },
6993
+ { "kind": "bracket", "a": "y2.a", "b": "p2.top@10", "fitting": "printed", "nut": "drop-in" },
6994
+ { "kind": "bracket", "a": "y2.b", "b": "p3.bottom@10", "fitting": "printed", "nut": "drop-in" },
6995
+ { "kind": "bracket", "a": "x3.a", "b": "p1.back@110", "fitting": "printed", "nut": "drop-in" },
6996
+ { "kind": "bracket", "a": "x3.b", "b": "p2.front@110", "fitting": "printed", "nut": "drop-in" },
6997
+ { "kind": "bracket", "a": "x4.a", "b": "p3.front@110", "fitting": "printed", "nut": "drop-in" },
6998
+ { "kind": "bracket", "a": "x4.b", "b": "p4.back@110", "fitting": "printed", "nut": "drop-in" },
6999
+ { "kind": "bracket", "a": "y3.a", "b": "p1.top@110", "fitting": "printed", "nut": "drop-in" },
7000
+ { "kind": "bracket", "a": "y3.b", "b": "p4.bottom@110", "fitting": "printed", "nut": "drop-in" },
7001
+ { "kind": "bracket", "a": "y4.a", "b": "p2.top@110", "fitting": "printed", "nut": "drop-in" },
7002
+ { "kind": "bracket", "a": "y4.b", "b": "p3.bottom@110", "fitting": "printed", "nut": "drop-in" },
7003
+ { "kind": "gusset", "a": "m1.a", "b": "x1.back@70", "fitting": "printed", "nut": "drop-in" },
7004
+ { "kind": "gusset", "a": "m1.b", "b": "x2.back@70", "fitting": "printed", "nut": "drop-in" }
7005
+ ],
7006
+ "fasten": [
7007
+ { "screw": "M3 cap", "through": ["foot1"], "into": "p1", "at": ["foot1.b1"], "note": "Foot 1" },
7008
+ { "screw": "M3 cap", "through": ["foot2"], "into": "p2", "at": ["foot2.b1"], "note": "Foot 2" },
7009
+ { "screw": "M3 cap", "through": ["foot3"], "into": "p3", "at": ["foot3.b1"], "note": "Foot 3" },
7010
+ { "screw": "M3 cap", "through": ["foot4"], "into": "p4", "at": ["foot4.b1"], "note": "Foot 4" },
7011
+ { "screw": "M5 button", "through": ["fan"], "into": "x4.back", "at": ["fan.b1", "fan.b2"], "nut": "roll-in", "note": "The fan mount" }
7012
+ ],
7013
+ "frame": { "points": ["m1.top@50%"] }
7014
+ }
7015
+ ```
7016
+
7017
+ ```sh
7018
+ npx cad check case/printed
7019
+ ```
7020
+
7021
+ It checks with nothing failing and nothing warning, 1102 checks passing:
7022
+
7023
+ - Each post: `beam.printable` says it prints standing on end a with no supports; `beam.end` says end a takes an M3
7024
+ captive nut in its bore's place, with 4 mm of plastic round the screw's line for the nut's corners and a line.
7025
+ - Each foot: an M3x10 cap through the foot's 3 mm floor into the post's nut in its seat (`fasten.end`), the nut
7026
+ 5.5 mm across its flats in a 5.7 mm slot.
7027
+ - Each bracket's and gusset's nut in a slot: in the posts and rails, MISUMI's slot, its thread from 1.2 mm under the
7028
+ face; in `m1`, the printable slot, whose lips slope underneath at 45°, so a drop-in nut, 10 mm wide in its 6.1 mm
7029
+ opening, seats 2 + (10 − 6.1) / 2 = 3.95 mm under the face and its thread runs from 3.15 to 7.25 mm. Each gusset
7030
+ has MISUMI's slot under one arm and the printable slot under the other, so it is drawn for both (`fitting.screw`):
7031
+ 4.6 mm thick, the least at which a length sold fits each, M4x10 into the rails (its tip 5.4 mm in) and M4x12 into
7032
+ `m1` (its tip 7.4 mm in, 0.45 mm short of the floor). Each screw has the 3.2 mm of thread a hex nut's height asks.
7033
+ - The board on its mount: M2.5x8 cap screws, the largest whose 4.5 mm heads sit whole on the board, its holes 3.5 mm
7034
+ from its edges; 6.4 mm of PETG engaged in each pilot.
7035
+ - `frame.deflection`: under the board, `m1` sags 0.009 mm with the joins' springs, 0.007 mm with them rigid, against
7036
+ 0.361 mm. `frame.rack`: 20 N pushed at the top sways it 0.072 mm along x and 0.074 mm along y, against 0.275 mm (its
7037
+ height, 110 mm between the rails, over 400): the panels hold it. `frame.frequency`: the lowest mode 139.7 Hz.
7038
+ - `assembly.order`: it goes together in 47 steps, nothing trapped.
7039
+
7040
+ The sag under the board, both ways:
7041
+
7042
+ | Frame | Sag at `m1.top@50%`, joins' springs | Joins rigid | Allowed |
7043
+ |---|---|---|---|
7044
+ | Aluminium, `case/aluminium` | 0.000352 mm | 0.000223 mm | 0.361 mm |
7045
+ | Printed in PETG, `case/printed` | 0.009 mm | 0.007 mm | 0.361 mm |
7046
+
7047
+ The printed case sags about 26 times as much as the aluminium one: PETG's 1810 MPa along its layers (1540 standing)
7048
+ against the aluminium's 69972 makes each beam 38 to 48 times as soft (with each section's second moment), and the printed brackets' springs, the same in both,
7049
+ make up the rest. Both are far inside the limit. As a check by hand: `m1` alone, pinned at its ends, under the board
7050
+ and its mount at its middle (0.05 + 0.027 kg, 0.756 N) and its own 33.8 g, sags 0.756 × 130³ / (48 × 1810 × 7605) +
7051
+ 5 × 0.00255 × 130⁴ / (384 × 1810 × 7605) = 0.0025 + 0.0007 = 0.0032 mm; the frame's 0.009 mm adds `x1` and `x2`
7052
+ bending under its ends and the joins giving.
7053
+
7054
+ ### Strong enough, and small
7055
+
7056
+ Each printed part is sized from a named load to about twice the margin, where its load sizes it at all:
7057
+
7058
+ | Part | Grams | Load it is sized for | Margin |
7059
+ |---|---|---|---|
7060
+ | Post, standing (× 4) | 26.8 | 50 N pulling a nut out of a slot | 3.07 |
7061
+ | Rail, standing (× 8) | 31.3 along x, 29.1 along y | 50 N pulling a nut out of a slot | 3.07 |
7062
+ | Cross beam, lying | 33.8 | 100 N pulling a nut out of its slot | 4.2 |
7063
+ | Corner bracket (× 16) | 4.5 | 100 N across the rail at its screw | 3.09, by finite elements |
7064
+ | T gusset (× 2) | 9.4 | 100 N in its plane at its farthest screw | 5.97, by finite elements |
7065
+ | Board mount | 27.1 | 50 N on the board at its farthest hole | 4.62 |
7066
+ | Fan mount | 17.5 | 50 N on the fan at its farthest hole | 5.65 |
7067
+ | Panel clip (× 32) | 1.6 | 30 N pushing the panel out | 2.12 |
7068
+ | Foot (× 4) | 4.6 | 250 N down the post | 73.8 |
7069
+ | End cap (× 4) | 1.3 | none: pushed on | |
7070
+
7071
+ The beams are sized by their slots, not their bending: the frame's highest stress is 0.04 MPa, in `x1`, 633 times
7072
+ under PETG's 23 MPa across its layers. The bracket and the clip are the parts their loads size; the
7073
+ mounts are sized by their screws' bosses and the board's and fan's holes, the foot by its counterbore. 593 g in all,
7074
+ 73 parts.
7075
+
7076
+ ### Two mistakes, caught
7077
+
7078
+ A rail longer than the bed. A wider case might take a 300 mm rail, printed lying down:
7079
+
7080
+ ```json projects/case/assemblies/long.json
7081
+ {
7082
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
7083
+ "title": "A 300 mm rail, printed whole",
7084
+ "kind": "fit",
7085
+ "items": [
7086
+ { "id": "r1", "beam": { "profile": "2020-printed", "material": "petg", "printed": true }, "from": [0, 0, 10], "to": [300, 0, 10] },
7087
+ { "id": "cap1", "fitting": { "kind": "end-cap", "profile": "2020-printed" }, "at": "r1.a" },
7088
+ { "id": "cap2", "fitting": { "kind": "end-cap", "profile": "2020-printed" }, "at": "r1.b" }
7089
+ ],
7090
+ "frame": { "supports": { "r1.a": "fixed", "r1.b": "fixed" } }
7091
+ }
7092
+ ```
7093
+
7094
+ `npx cad check case/long` fails on `beam.printable`:
7095
+
7096
+ ```text
7097
+ ✗ r1: profile-2020-printed x 300, printed lying down: 300 mm long, and x1c's bed is 256 mm: splice it in two (splice()), or stand it up if it is no taller than the printer
7098
+ ```
7099
+
7100
+ Spliced where it must be: two halves of 150 mm, end to end, held by a `splice` join with a printed splice plate on
7101
+ their top faces, two M4 screws into drop-in nuts in each half's slot:
7102
+
7103
+ ```json projects/case/assemblies/spliced.json
7104
+ {
7105
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
7106
+ "title": "The 300 mm rail in two halves, spliced",
7107
+ "kind": "fit",
7108
+ "items": [
7109
+ { "id": "r1", "beam": { "profile": "2020-printed", "material": "petg", "printed": true }, "from": [0, 0, 10], "to": [150, 0, 10] },
7110
+ { "id": "r2", "beam": { "profile": "2020-printed", "material": "petg", "printed": true }, "from": [150, 0, 10], "to": [300, 0, 10] },
7111
+ { "id": "cap1", "fitting": { "kind": "end-cap", "profile": "2020-printed" }, "at": "r1.a" },
7112
+ { "id": "cap2", "fitting": { "kind": "end-cap", "profile": "2020-printed" }, "at": "r2.b" }
7113
+ ],
7114
+ "joins": [{ "kind": "splice", "a": "r1.b", "b": "r2.a", "fitting": "printed", "nut": "drop-in" }],
7115
+ "frame": { "supports": { "r1.a": "fixed", "r2.b": "fixed" } }
7116
+ }
7117
+ ```
7118
+
7119
+ ```sh
7120
+ npx cad check case/spliced
7121
+ ```
7122
+
7123
+ Both halves print lying down, and the plate is 4.6 mm thick, 3.7 g, 4.88 times under PETG's strength at 100 N by
7124
+ finite elements. Its thickness is set by its screws, not its load: the nuts seat 3.95 mm down under the halves' sloped
7125
+ lips, so an M4x12 through 4.6 mm reaches 7.4 mm into the slot and has the 3.2 mm of thread asked, where an M4x10
7126
+ through the 4 mm the load needs would have 2.85. Its stiffness, 0.152 N·m/mrad, is its own, the slot nuts and lips
7127
+ left out, an estimate until the joint rig measures one.
7128
+
7129
+ A foot drawn for the aluminium post. The printed post with its foot as the aluminium case had it, an M5 screw for the
7130
+ post's tapped bore:
7131
+
7132
+ ```json projects/case/assemblies/foot.json
7133
+ {
7134
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
7135
+ "title": "A foot drawn for an aluminium post",
7136
+ "kind": "fit",
7137
+ "items": [
7138
+ { "id": "p1", "beam": { "profile": "2020-misumi-hfs5", "material": "petg", "printed": { "pose": "standing", "pull": 50, "end": "nut" }, "ops": [{ "op": "tap", "at": "a" }] }, "from": [10, 10, 0], "to": [10, 10, 120] },
7139
+ { "id": "foot1", "fitting": { "kind": "foot", "profile": "2020-misumi-hfs5" }, "at": "p1.a" },
7140
+ { "id": "cap1", "fitting": { "kind": "end-cap", "profile": "2020-misumi-hfs5" }, "at": "p1.b" }
7141
+ ],
7142
+ "fasten": [{ "screw": "M5 cap", "through": ["foot1"], "into": "p1", "at": ["foot1.b1"], "note": "Foot 1" }]
7143
+ }
7144
+ ```
7145
+
7146
+ `npx cad check case/foot` fails on `fasten.end`, and names the screw that would do:
7147
+
7148
+ ```text
7149
+ ✗ Foot 1, an M5 cap screw: p1's end a is printed with an M3 captive nut in place of a tap, and the screw is M5: use an M3 screw (a printed foot takes it as "thread": "M3")
7150
+ ```
7151
+
7152
+ ### The kit
7153
+
7154
+ ```sh
7155
+ npx cad kit case/printed
7156
+ ```
7157
+
7158
+ `cad kit` checks the case, refuses it if anything fails, and writes `exports/case/printed-kit/`:
7159
+
7160
+ - `README.md`: what the checks say, what to buy (the board, the four panels cut to size, the screws and nuts in
7161
+ packs), what to print, and the build in 47 steps.
7162
+ - `buy.csv`: the same shopping list as a table.
7163
+ - `print/printed-base-1.3mf`: one plate of PETG with every printed part on it, 73 parts and 593 g, about 654 minutes,
7164
+ laid out as each prints: the posts and rails on their ends, the cross beam on its bottom face, the brackets on their
7165
+ sides, the feet and the mounts on their beam sides. It prints clean: no overhang past 45°, nothing in mid-air.
7166
+
7167
+ There is no cut list, no drilling and no jigs: nothing is cut from a bar. The fasteners, as the kit lists them:
7168
+
7169
+ - 40 × M4x10 cap for the brackets and the gussets into the rails, 4 × M4x12 cap for the gussets into `m1`, with 44
7170
+ drop-in nuts.
7171
+ - 32 × M5x10 button, for the panels' clips, and 4 × M5x12 button for the fan mount and the board's mount, with 36
7172
+ roll-in nuts.
7173
+ - 4 × M3x10 cap, with 4 M3 hex nuts, for the feet.
7174
+ - 4 × M2.5x8 cap, for the board.
7175
+
7176
+ ### What rests on estimates
7177
+
7178
+ The board's size and holes, MISUMI's section and the slot nuts come from their makers' figures. These do not, and the
7179
+ findings say so:
7180
+
7181
+ - A printed beam's stiffness and strength: its walls and infill (three walls, 40%), PETG's figures, and across its
7182
+ layers 0.6 of its strength along them where the plastic gives no figure of its own, until the beam coupon (the bench's
7183
+ `beam-test`, MEASURE.md rows 38 and 39) measures them.
7184
+ - The creep limits that `beam.printable` holds a printed beam to, and the sag as it creeps.
7185
+ - Each join's stiffness: the printed brackets' and gussets' own by finite elements, the slot nuts and lips left out.
7186
+ - A slot's hold in plastic, and the 50 N pull the standing beams are sized for.
7187
+ - The board's mass, a shop's figure, and its thickness. The fan is not modelled: its mount is, and its mass is not in
7188
+ the frame's solve.