create-rulecad 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +16 -0
  2. package/index.mjs +54 -3
  3. package/machines/arm/projects/arm/assemblies/arm.json +103 -0
  4. package/machines/arm/projects/arm/drawings/test.svg +1 -0
  5. package/machines/arm/projects/arm/firmware/arm/arm.ino +149 -0
  6. package/machines/arm/projects/arm/objects/base.js +18 -0
  7. package/machines/arm/projects/arm/objects/base.json +41 -0
  8. package/machines/arm/projects/arm/objects/bridge.js +15 -0
  9. package/machines/arm/projects/arm/objects/bridge.json +32 -0
  10. package/machines/arm/projects/arm/objects/clip.js +9 -0
  11. package/machines/arm/projects/arm/objects/clip.json +20 -0
  12. package/machines/arm/projects/arm/objects/forearm.js +20 -0
  13. package/machines/arm/projects/arm/objects/forearm.json +44 -0
  14. package/machines/arm/projects/arm/objects/holder.js +23 -0
  15. package/machines/arm/projects/arm/objects/holder.json +50 -0
  16. package/machines/arm/projects/arm/objects/horn.js +9 -0
  17. package/machines/arm/projects/arm/objects/horn.json +17 -0
  18. package/machines/arm/projects/arm/objects/housing.js +22 -0
  19. package/machines/arm/projects/arm/objects/housing.json +39 -0
  20. package/machines/arm/projects/arm/objects/output.js +12 -0
  21. package/machines/arm/projects/arm/objects/output.json +28 -0
  22. package/machines/arm/projects/arm/objects/pen.js +9 -0
  23. package/machines/arm/projects/arm/objects/pen.json +17 -0
  24. package/machines/arm/projects/arm/objects/planet.js +9 -0
  25. package/machines/arm/projects/arm/objects/planet.json +20 -0
  26. package/machines/arm/projects/arm/objects/speck.js +5 -0
  27. package/machines/arm/projects/arm/objects/speck.json +17 -0
  28. package/machines/arm/projects/arm/objects/spindle.js +17 -0
  29. package/machines/arm/projects/arm/objects/spindle.json +34 -0
  30. package/machines/arm/projects/arm/objects/sun.js +10 -0
  31. package/machines/arm/projects/arm/objects/sun.json +22 -0
  32. package/machines/arm/projects/arm/objects/upper.js +34 -0
  33. package/machines/arm/projects/arm/objects/upper.json +73 -0
  34. package/machines/arm/projects/arm/project.json +19 -0
  35. package/machines/arm/projects/arm/send.mjs +70 -0
  36. package/machines/arm/rules/arm.json +44 -0
  37. package/machines/leg/projects/leg/assemblies/stand.json +101 -0
  38. package/machines/leg/projects/leg/objects/bridge.js +15 -0
  39. package/machines/leg/projects/leg/objects/bridge.json +32 -0
  40. package/machines/leg/projects/leg/objects/carriage.js +14 -0
  41. package/machines/leg/projects/leg/objects/carriage.json +34 -0
  42. package/machines/leg/projects/leg/objects/clip.js +9 -0
  43. package/machines/leg/projects/leg/objects/clip.json +20 -0
  44. package/machines/leg/projects/leg/objects/collar.js +11 -0
  45. package/machines/leg/projects/leg/objects/collar.json +19 -0
  46. package/machines/leg/projects/leg/objects/foot.js +11 -0
  47. package/machines/leg/projects/leg/objects/foot.json +21 -0
  48. package/machines/leg/projects/leg/objects/housing.js +22 -0
  49. package/machines/leg/projects/leg/objects/housing.json +39 -0
  50. package/machines/leg/projects/leg/objects/output.js +12 -0
  51. package/machines/leg/projects/leg/objects/output.json +28 -0
  52. package/machines/leg/projects/leg/objects/pad.js +14 -0
  53. package/machines/leg/projects/leg/objects/pad.json +27 -0
  54. package/machines/leg/projects/leg/objects/planet.js +9 -0
  55. package/machines/leg/projects/leg/objects/planet.json +20 -0
  56. package/machines/leg/projects/leg/objects/scale.js +5 -0
  57. package/machines/leg/projects/leg/objects/scale.json +15 -0
  58. package/machines/leg/projects/leg/objects/shin.js +17 -0
  59. package/machines/leg/projects/leg/objects/shin.json +35 -0
  60. package/machines/leg/projects/leg/objects/speck.js +5 -0
  61. package/machines/leg/projects/leg/objects/speck.json +17 -0
  62. package/machines/leg/projects/leg/objects/spindle.js +17 -0
  63. package/machines/leg/projects/leg/objects/spindle.json +34 -0
  64. package/machines/leg/projects/leg/objects/sun.js +10 -0
  65. package/machines/leg/projects/leg/objects/sun.json +22 -0
  66. package/machines/leg/projects/leg/objects/thigh.js +29 -0
  67. package/machines/leg/projects/leg/objects/thigh.json +53 -0
  68. package/machines/leg/projects/leg/objects/tie.js +10 -0
  69. package/machines/leg/projects/leg/objects/tie.json +19 -0
  70. package/machines/leg/projects/leg/project.json +21 -0
  71. package/machines/leg/rules/leg.json +42 -0
  72. package/package.json +6 -1
  73. package/template/AGENTS.md +41 -6
@@ -0,0 +1,44 @@
1
+ {
2
+ "_doc": "The drawing arm's own figures: its reach, its stack of parts, and what its error budget assumes until the bench measures it. Examples chapter 12 explains each.",
3
+ "name": "arm",
4
+ "rules": {
5
+ "sheet_w": {"value": 210, "unit": "mm", "rule": "An A5 sheet's long side, across the arm's front", "kind": "spec", "source": "ISO 216", "checked": "2026-11-09"},
6
+ "sheet_h": {"value": 148, "unit": "mm", "rule": "An A5 sheet's short side, away from the arm", "kind": "spec", "source": "ISO 216", "checked": "2026-11-09"},
7
+ "near": {"value": 70, "unit": "mm", "rule": "From the shoulder's axis to the sheet's near edge: past the base and the pen holder's width", "kind": "default", "source": "EXAMPLES.md chapter 12", "checked": "2026-11-09"},
8
+ "upper": {"value": 160, "unit": "mm", "rule": "Shoulder to elbow: with the forearm, the shortest pair that keeps the far corner at 88% of full stretch (the speed check's slowest point) and folds to the near edge", "kind": "default", "source": "EXAMPLES.md chapter 12", "checked": "2026-11-09"},
9
+ "fore": {"value": 115, "unit": "mm", "rule": "Elbow to pen: as short as the reach allows, because the elbow's error swings through it", "kind": "default", "source": "EXAMPLES.md chapter 12", "checked": "2026-11-09"},
10
+ "play_shoulder": {"value": 0.02, "unit": "°", "rule": "The shoulder's play at its output with the bias spring taking up the gear backlash", "kind": "estimate", "source": "A target, not a measurement: bench test 14 in projects/benchmarks/MEASURE.md settles it", "checked": "2026-11-09"},
11
+ "play_elbow": {"value": 0.02, "unit": "°", "rule": "The elbow's play, the same gearbox and bias", "kind": "estimate", "source": "A target, not a measurement: bench test 14", "checked": "2026-11-09"},
12
+ "twist_shoulder": {"value": 0.01, "unit": "°", "rule": "The shoulder's gear train twisting under the pen's drag and the bias", "kind": "estimate", "source": "A guess: bench test 15", "checked": "2026-11-09"},
13
+ "twist_elbow": {"value": 0.01, "unit": "°", "rule": "The elbow's gear train twisting, the same", "kind": "estimate", "source": "A guess: bench test 15", "checked": "2026-11-09"},
14
+ "deflection": {"value": 0.02, "unit": "mm", "rule": "The links bending sideways at the pen under its drag, from beam formulas", "kind": "estimate", "source": "0.3 N of drag on the forearm and holder as cantilevers: bench test 17 measures the whole budget at once", "checked": "2026-11-09"},
15
+ "drag": {"value": 0.3, "unit": "N", "rule": "A pen's drag on paper, about, pulled sideways at the tip", "kind": "estimate", "source": "A hand guess from a pen on a spring scale: measure yours", "checked": "2026-11-09"},
16
+ "shoulder_torque": {"value": 0.2, "unit": "N m", "rule": "What the shoulder must do at the task's speed and accel: the pen's drag at 240 mm, the arm's inertia and the bias", "kind": "estimate", "source": "Drag 0.07 N m + inertia about 0.03 N m + the rubber band's bias 0.1 N m", "checked": "2026-11-09"},
17
+ "elbow_torque": {"value": 0.08, "unit": "N m", "rule": "What the elbow must do: the pen's drag at 110 mm, the forearm's inertia and the bias", "kind": "estimate", "source": "Drag 0.03 N m + inertia 0.01 N m + the rubber band's bias 0.04 N m", "checked": "2026-11-09"},
18
+ "foot": {"value": 6, "unit": "mm", "rule": "The base plate's thickness", "kind": "default", "source": "Stiff enough for four M5 screws", "checked": "2026-11-09"},
19
+ "room": {"value": 2, "unit": "mm", "rule": "Air between the shoulder motor's back and the base plate", "kind": "default", "source": "Design", "checked": "2026-11-09"},
20
+ "motor17": {"value": 40, "unit": "mm", "rule": "The 17HS4401's body length", "kind": "community", "source": "nema17 variant 17HS4401 (https://market.samm.com/17hs4401-nema17-step-motor-en)", "checked": "2026-11-09"},
21
+ "face": {"value": "foot + room + motor17", "unit": "mm", "rule": "The shoulder motor's mounting face above the bench: the base's height", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
22
+ "plate": {"value": 5, "unit": "mm", "rule": "The shoulder housing's plate: enough for M3 screws into a NEMA 17 (1.5 × their size)", "kind": "default", "source": "Chapter 11's housing", "checked": "2026-11-09"},
23
+ "gear": {"value": 8, "unit": "mm", "rule": "Each gear stage's face", "kind": "default", "source": "Chapter 11's gearbox", "checked": "2026-11-09"},
24
+ "ring_gap": {"value": 0.4, "unit": "mm", "rule": "Between the fixed ring and the output ring", "kind": "default", "source": "Chapter 11's gearbox", "checked": "2026-11-09"},
25
+ "flange": {"value": 5, "unit": "mm", "rule": "The output ring's flange: thick enough for four M3 screws to bite", "kind": "default", "source": "Design", "checked": "2026-11-09"},
26
+ "output_top": {"value": "face + plate + gear + ring_gap + gear + flange", "unit": "mm", "rule": "Top of the shoulder's output flange above the bench", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
27
+ "disc": {"value": 3, "unit": "mm", "rule": "The spindle's disc, on the flange", "kind": "default", "source": "Design", "checked": "2026-11-09"},
28
+ "bridge_gap": {"value": 0.6, "unit": "mm", "rule": "Between the spindle's disc and the bridge above it", "kind": "default", "source": "Design", "checked": "2026-11-09"},
29
+ "bridge": {"value": 7, "unit": "mm", "rule": "The bridge's thickness: the 5 mm bearing and a 2 mm ledge", "kind": "default", "source": "Design", "checked": "2026-11-09"},
30
+ "bridge_low": {"value": "output_top + disc + bridge_gap", "unit": "mm", "rule": "The bridge's underside above the bench", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
31
+ "arm_gap": {"value": 0.5, "unit": "mm", "rule": "Between the bridge's top and the upper arm's underside", "kind": "default", "source": "Design", "checked": "2026-11-09"},
32
+ "arm": {"value": 12, "unit": "mm", "rule": "The upper arm's thickness, a plate over the elbow too: about 1.7 mm of sag under its load at 8 mm thick, 0.5 mm at 12", "kind": "default", "source": "The cantilever formula in EXAMPLES.md chapter 12", "checked": "2026-11-09"},
33
+ "switch_pitch": {"value": 9.5, "unit": "mm", "rule": "Between the endstop's two screw holes", "kind": "estimate", "source": "endstop-10t85 in @rulecad/rules: the set has words among its figures, so an object can't read it through uses", "checked": "2026-11-09"},
34
+ "bearing_bore": {"value": 10, "unit": "mm", "rule": "The 6800's bore", "kind": "spec", "source": "bearing-6800 in @rulecad/rules (NTN)", "checked": "2026-11-09"},
35
+ "bearing_outer": {"value": 19, "unit": "mm", "rule": "The 6800's outside diameter", "kind": "spec", "source": "bearing-6800", "checked": "2026-11-09"},
36
+ "bearing_width": {"value": 5, "unit": "mm", "rule": "The 6800's width", "kind": "spec", "source": "bearing-6800", "checked": "2026-11-09"},
37
+ "boss": {"value": 11.5, "unit": "mm", "rule": "The forearm's boss, so the bar passes under the elbow's clips", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
38
+ "elbow_flange": {"value": "bridge_low + bridge + arm_gap - gear - ring_gap - gear - flange", "unit": "mm", "rule": "The elbow output flange's underside, where the forearm bolts on: the upper arm's underside less the elbow's stack", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
39
+ "fore_low": {"value": "elbow_flange - boss", "unit": "mm", "rule": "The forearm bar's underside above the bench", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
40
+ "fore_mid": {"value": "fore_low + arm_mid", "unit": "mm", "rule": "The holder's bolts, level with the middle of the forearm", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
41
+ "arm_mid": {"value": 4, "unit": "mm", "rule": "Half the forearm's 8 mm thickness", "kind": "default", "source": "The stack", "checked": "2026-11-09"},
42
+ "press": {"value": 1, "unit": "mm", "rule": "How far below the paper the pen tip sits at rest, so the leaf spring presses it down", "kind": "default", "source": "Sets the pen force through the guide's stiffness", "checked": "2026-11-09"}
43
+ }
44
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/assembly.schema.json",
3
+ "title": "A leg on a test stand",
4
+ "kind": "fit",
5
+ "description": "One leg on a carriage that rides up two rods: it stands and steps against a kitchen scale. The body's frame is the world: the hip at the origin, the ground at the scale's top.",
6
+ "uses": ["leg"],
7
+ "items": [
8
+ { "id": "foot1", "object": "foot", "at": ["0 - leg.rod_x", "0 - leg.rod_y", "0 - leg.stance - leg.foot_r - leg.scale_h"] },
9
+ { "id": "carriage", "object": "carriage", "rotate": [90, 0, 0] },
10
+ { "id": "lm1", "bought": "lm8uu", "at": ["0 - leg.rod_x", "0 - leg.rod_y", "0 - carriage.boss_long / 2"] },
11
+ { "id": "lm2", "bought": "lm8uu", "at": ["leg.rod_x", "0 - leg.rod_y", "0 - carriage.boss_long / 2"] },
12
+ { "id": "m1", "motor": { "model": "17HS4401", "drives": "hd", "speed": 200, "duty": 0.3, "driver": "d1", "current": 0.5, "microsteps": 8 } },
13
+ { "id": "housing", "object": "housing", "rotate": [-90, 0, 0] },
14
+ { "id": "sun", "object": "sun" },
15
+ { "id": "carrier", "object": "speck" },
16
+ { "id": "p1", "object": "planet" }, { "id": "p2", "object": "planet" }, { "id": "p3", "object": "planet" },
17
+ { "id": "output", "object": "output" },
18
+ { "id": "spindle", "object": "spindle" },
19
+ { "id": "bridge", "object": "bridge", "at": [0, "leg.bridge_low", 0], "rotate": [-90, 0, 0] },
20
+ { "id": "b1", "bought": "bearing-6800", "at": [0, "leg.bridge_low + leg.bridge - leg.bearing_width", 0], "rotate": [-90, 0, 0] },
21
+ { "id": "thigh", "object": "thigh" },
22
+ { "id": "m2", "motor": { "model": "nema14", "drives": "kd", "speed": 200, "duty": 0.3, "driver": "d2", "current": 0.5, "microsteps": 8 } },
23
+ { "id": "esun", "object": "sun", "set": { "tip": 11.7 } },
24
+ { "id": "ecarrier", "object": "speck" }, { "id": "ering", "object": "speck" },
25
+ { "id": "ep1", "object": "planet" }, { "id": "ep2", "object": "planet" }, { "id": "ep3", "object": "planet" },
26
+ { "id": "eoutput", "object": "output" },
27
+ { "id": "clip1", "object": "clip" }, { "id": "clip2", "object": "clip" }, { "id": "clip3", "object": "clip" },
28
+ { "id": "shin", "object": "shin" },
29
+ { "id": "pad", "object": "pad" },
30
+ { "id": "rod1", "bought": "rod-8", "set": { "length": "leg.rod_long" }, "at": ["0 - leg.rod_x", "0 - leg.rod_y", "0 - leg.stance - leg.foot_r - leg.scale_h + leg.foot_block - leg.foot_socket"] },
31
+ { "id": "rod2", "bought": "rod-8", "set": { "length": "leg.rod_long" }, "at": ["leg.rod_x", "0 - leg.rod_y", "0 - leg.stance - leg.foot_r - leg.scale_h + leg.foot_block - leg.foot_socket"] },
32
+ { "id": "foot2", "object": "foot", "at": ["leg.rod_x", "0 - leg.rod_y", "0 - leg.stance - leg.foot_r - leg.scale_h"] },
33
+ { "id": "tie", "object": "tie", "at": [0, "0 - leg.rod_y", 76] },
34
+ { "id": "collar1", "object": "collar", "rotate": [0, 0, 180], "at": ["0 - leg.rod_x", "0 - leg.rod_y", "0 - carriage.boss_long / 2 - leg.stop_drop - collar1.high"] },
35
+ { "id": "collar2", "object": "collar", "at": ["leg.rod_x", "0 - leg.rod_y", "0 - carriage.boss_long / 2 - leg.stop_drop - collar2.high"] },
36
+ { "id": "scale", "object": "scale", "at": [0, 5, "0 - leg.stance - leg.foot_r - leg.scale_h"] },
37
+ { "id": "d1", "bought": "drv8825", "at": [240, -30, -180] },
38
+ { "id": "d2", "bought": "drv8825", "at": [240, 0, -180] },
39
+ { "id": "shield", "bought": "cnc-shield-v3", "at": [240, 0, -190] },
40
+ { "id": "psu", "bought": "supply-24v", "variant": "LRS-50-24", "at": [300, 150, -190] }
41
+ ],
42
+ "joints": [
43
+ { "id": "m1_on", "type": "fixed", "parent": "housing.motor", "child": "m1.face" },
44
+ { "id": "hd", "type": "revolute", "parent": "housing.axis", "child": "sun.axis", "min": -6200, "max": 200, "label": "Hip motor" },
45
+ { "id": "turn", "type": "revolute", "parent": "housing.axis", "child": "carrier.axis", "min": -6200, "max": 200 },
46
+ { "id": "s1", "type": "revolute", "parent": "carrier.a", "child": "p1.axis", "min": -30000, "max": 30000 },
47
+ { "id": "s2", "type": "revolute", "parent": "carrier.b", "child": "p2.axis", "min": -30000, "max": 30000 },
48
+ { "id": "s3", "type": "revolute", "parent": "carrier.c", "child": "p3.axis", "min": -30000, "max": 30000 },
49
+ { "id": "hip", "type": "revolute", "parent": { "item": "housing", "at": [0, 0, "leg.plate + leg.gear + leg.ring_gap"], "axis": [0, 0, 1] }, "child": "output.axis", "min": 30, "max": 150, "label": "Hip", "support": { "bearings": ["b1"] } },
50
+ { "id": "spindle_on", "type": "fixed", "parent": "output.flange", "child": "spindle.down" },
51
+ { "id": "thigh_on", "type": "fixed", "parent": "spindle.seat", "child": "thigh.hub" },
52
+ { "id": "m2_on", "type": "fixed", "parent": "thigh.motor", "child": "m2.face" },
53
+ { "id": "kd", "type": "revolute", "parent": "thigh.knee", "child": "esun.axis", "min": -5900, "max": 180, "label": "Knee motor" },
54
+ { "id": "ering_on", "type": "fixed", "parent": "thigh.knee", "child": "ering.axis" },
55
+ { "id": "eturn", "type": "revolute", "parent": "thigh.knee", "child": "ecarrier.axis", "min": -5900, "max": 180 },
56
+ { "id": "es1a", "type": "revolute", "parent": "ecarrier.a", "child": "ep1.axis", "min": -30000, "max": 30000 },
57
+ { "id": "es2a", "type": "revolute", "parent": "ecarrier.b", "child": "ep2.axis", "min": -30000, "max": 30000 },
58
+ { "id": "es3a", "type": "revolute", "parent": "ecarrier.c", "child": "ep3.axis", "min": -30000, "max": 30000 },
59
+ { "id": "knee", "type": "revolute", "parent": "thigh.output", "child": "eoutput.axis", "min": 0, "max": 150, "label": "Knee", "support": { "clips": ["clip1", "clip2", "clip3"], "pitch": 74 } },
60
+ { "id": "c1_on", "type": "fixed", "parent": "thigh.clip1", "child": "clip1.post" },
61
+ { "id": "c2_on", "type": "fixed", "parent": "thigh.clip2", "child": "clip2.post" },
62
+ { "id": "c3_on", "type": "fixed", "parent": "thigh.clip3", "child": "clip3.post" },
63
+ { "id": "shin_on", "type": "fixed", "parent": "eoutput.flange", "child": "shin.hub" },
64
+ { "id": "pad_on", "type": "fixed", "parent": "shin.pad", "child": "pad.axis" }
65
+ ],
66
+ "planetary": [
67
+ { "sun": "sun", "carrier": "carrier", "ring": "housing", "planets": ["p1", "p2", "p3"], "drive": "sun", "module": 1, "teeth": [18, 18, 54], "output": { "ring": "output", "planet": 21, "teeth": 57 } },
68
+ { "sun": "esun", "carrier": "ecarrier", "ring": "ering", "planets": ["ep1", "ep2", "ep3"], "drive": "sun", "module": 1, "teeth": [18, 18, 54], "output": { "ring": "eoutput", "planet": 21, "teeth": 57 } }
69
+ ],
70
+ "fits": [
71
+ { "a": "m1", "b": "housing", "fastens": true, "min": -0.1, "note": "The hip motor, on its four screws, its boss seated in the plate's pocket" },
72
+ { "a": "m1", "b": "sun", "shaft": true, "note": "The shaft in the sun" },
73
+ { "a": "m2", "b": "esun", "shaft": true, "note": "The knee motor's shaft in its sun" },
74
+ { "a": "m2", "b": "thigh", "fastens": true, "min": -0.1, "note": "The knee motor, on its four screws" },
75
+ { "a": "housing", "b": "carriage", "fastens": true, "min": 0, "note": "The housing, screwed to the carriage's face" },
76
+ { "a": "bridge", "b": "housing", "fastens": true, "min": 0, "note": "The bridge, on the housing's posts" },
77
+ { "a": "b1", "b": "bridge", "seat": "press", "note": "The 6800 in its seat" },
78
+ { "a": "ecarrier", "b": "ering", "min": -1, "note": "Two specks: neither is printed" },
79
+ { "a": "lm1", "b": "carriage", "fastens": true, "min": -0.5, "note": "The bushing, pressed in its pocket" },
80
+ { "a": "lm2", "b": "carriage", "fastens": true, "min": -0.5, "note": "The bushing, pressed in its pocket" },
81
+ { "a": "rod1", "b": "lm1", "fastens": true, "min": -1000, "note": "The bushing rides the rod: the carriage is free to rise and is held on the rods" },
82
+ { "a": "rod2", "b": "lm2", "fastens": true, "min": -1000, "note": "The bushing rides the rod" },
83
+ { "a": "rod1", "b": "foot1", "fastens": true, "min": -1000, "note": "The rod in its socket" },
84
+ { "a": "rod2", "b": "foot2", "fastens": true, "min": -1000, "note": "The rod in its socket" },
85
+ { "a": "rod1", "b": "tie", "fastens": true, "min": -1000, "note": "The rod through the tie" },
86
+ { "a": "rod2", "b": "tie", "fastens": true, "min": -1000, "note": "The rod through the tie" },
87
+ { "a": "rod1", "b": "collar1", "fastens": true, "min": -1000, "note": "The stop clamped on the rod" },
88
+ { "a": "rod2", "b": "collar2", "fastens": true, "min": -1000, "note": "The stop clamped on the rod" },
89
+ { "a": "pad", "b": "shin", "min": -2, "note": "The pad on the foot's disc" },
90
+ { "a": "pad", "b": "scale", "min": -0.5, "note": "The foot stands on the scale" },
91
+ { "a": "d1", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" },
92
+ { "a": "d2", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" }
93
+ ],
94
+ "wires": [
95
+ { "id": "hip_wire", "from": "m1.connector", "to": "shield.X", "via": ["carriage.cable"], "gauge": "awg24", "colour": "black, red, green, blue", "connectors": ["JST-XH 4 pin", "screw terminal"] },
96
+ { "id": "knee_wire", "from": "m2.connector", "to": "shield.Y", "via": ["thigh.cable", "carriage.cable"], "gauge": "awg24", "colour": "black, red, green, blue", "connectors": ["JST-XH 4 pin", "screw terminal"] },
97
+ { "id": "power", "from": "psu.terminals", "to": "shield.top", "gauge": "awg22", "colour": "red, black", "conductors": 2, "current": 2, "connectors": ["Ring terminal", "Screw terminal"], "note": "24 V into the shield's motor terminals" }
98
+ ],
99
+ "gait": { "legs": ["shin.tip"], "pattern": { "duty": 0.6, "phase": [0] }, "stride": "leg.stride", "lift": "leg.lift", "period": 2, "height": "leg.stance", "mass": "leg.share", "clearance": 12 },
100
+ "poses": { "standing": { "hd": -5587.7, "kd": -2236 } }
101
+ }
@@ -0,0 +1,15 @@
1
+ // A three-armed plate over the gearbox, the bearing's seat in the middle.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder, cuboid } = jscad.primitives
4
+ const { rotateZ } = jscad.transforms
5
+
6
+ export function main (v) {
7
+ const posts = [v.p1, v.p2, v.p3].map((a) => a * v.rad), at = (a) => [v.post_r * Math.cos(a), v.post_r * Math.sin(a)]
8
+ const hub = cylinder({ radius: v.hub / 2, height: v.thick, center: [0, 0, v.thick / 2], segments: v.segments * 2 })
9
+ const arms = posts.map((a) => rotateZ(a, cuboid({ size: [v.post_r, v.lobe, v.thick], center: [v.post_r / 2, 0, v.thick / 2] })))
10
+ const lobes = posts.map((a) => cylinder({ radius: v.lobe / 2, height: v.thick, center: [...at(a), v.thick / 2], segments: v.segments }))
11
+ const seat = v.shapes.bearingSeat({ bore: v.bore, outer_diameter: v.outer, width: v.width }, { fit: 'press', relief: v.relief, through: true, printer: v.x1c, at: [0, 0, v.thick], into: '-z', lead: 0 })
12
+ const screws = posts.map((a) => cylinder({ radius: v.screw / 2, height: v.thick + 1, center: [...at(a), v.thick / 2], segments: v.segments }))
13
+ const heads = posts.map((a) => cylinder({ radius: v.head / 2, height: v.head_depth + 1, center: [...at(a), v.thick - (v.head_depth - 1) / 2], segments: v.segments }))
14
+ return v.ops.subtract(v.ops.union(hub, arms, lobes), seat, screws, heads)
15
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "bridge",
4
+ "title": "Bridge: the 6800's seat",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m3"],
7
+ "engine": "manifold",
8
+ "orientation": "Upside to the sky, as it goes on: the pocket opens upward and its ledge prints flat",
9
+ "description": "Three arms across the housing's posts, holding the bearing that takes the output's tipping load.",
10
+ "anchors": {
11
+ "seat": {"at": [0, 0, "thick - width"], "axis": [0, 0, 1]},
12
+ "under": {"at": [0, 0, 0], "axis": [0, 0, 1]}
13
+ },
14
+ "variables": {
15
+ "thick": {"value": "leg.bridge", "unit": "mm", "rule": "The bearing's width and a ledge", "interface": true},
16
+ "bore": {"value": "leg.bearing_bore", "unit": "mm", "rule": "The 6800's bore"},
17
+ "outer": {"value": "leg.bearing_outer", "unit": "mm", "rule": "The 6800's outside"},
18
+ "width": {"value": "leg.bearing_width", "unit": "mm", "rule": "The 6800's width"},
19
+ "relief": {"value": "thick - width", "unit": "mm", "rule": "Through the ledge, so the seat prints without a bridge"},
20
+ "hub": {"value": 34, "unit": "mm", "rule": "Round the pocket, three lines and more of wall"},
21
+ "post_r": {"value": 37, "unit": "mm", "rule": "On the housing's posts"},
22
+ "lobe": {"value": 12, "unit": "mm", "rule": "Each arm's width"},
23
+ "p1": {"value": 30, "unit": "°", "rule": "First post"},
24
+ "p2": {"value": 150, "unit": "°", "rule": "Second post"},
25
+ "p3": {"value": 270, "unit": "°", "rule": "Third post"},
26
+ "rad": {"value": 0.017453293, "rule": "Radians in a degree"},
27
+ "screw": {"value": "m3.clearance + x1c.hole_comp", "unit": "mm", "rule": "M3 clearance"},
28
+ "head": {"value": "m3.head + 2 * x1c.fit + x1c.hole_comp", "unit": "mm", "rule": "The screw head's counterbore"},
29
+ "head_depth": {"value": "m3.head_height + x1c.layer", "unit": "mm", "rule": "A socket head's height, sunk, so the thigh passes over"},
30
+ "segments": {"value": 64, "rule": "Round enough"}
31
+ }
32
+ }
@@ -0,0 +1,14 @@
1
+ // A round hub for the hip, arms out to two bushing bosses, the hip's face down on the bed.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder, cuboid, roundedRectangle } = jscad.primitives
4
+ const { extrudeLinear } = jscad.extrusions
5
+
6
+ export function main (v) {
7
+ const arms = cuboid({ size: [v.half_w * 2, v.arm_w, v.plate], center: [0, 0, v.plate / 2] })
8
+ const hub = cylinder({ radius: v.hub, height: v.plate, center: [0, 0, v.plate / 2], segments: v.segments * 2 })
9
+ const bosses = [-1, 1].map((s) => cuboid({ size: [v.boss_x * 2, v.boss_long, v.boss_h], center: [s * v.rod_x, 0, v.boss_h / 2] }))
10
+ const window = extrudeLinear({ height: v.plate + 1 }, roundedRectangle({ size: [v.cut, v.cut], roundRadius: v.corner, segments: v.segments }))
11
+ const feet = [v.a1, v.a2, v.a3].map((a) => a * v.rad).map((a) => cylinder({ radius: v.pilot / 2, height: v.plate + 1, center: [v.feet_r * Math.cos(a), 0 - v.feet_r * Math.sin(a), v.plate / 2], segments: v.segments }))
12
+ const pockets = [-1, 1].map((s) => v.shapes.lm8uuPocket(v.lm8uu, { printer: v.x1c, at: [s * v.rod_x, 0 - v.boss_long / 2, v.rod_y], into: '+y', through: true }))
13
+ return v.ops.subtract(v.ops.union(arms, hub, bosses), window, feet, pockets)
14
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "carriage",
4
+ "title": "Stand carriage: the leg's mount on two rods",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m3", "lm8uu"],
7
+ "engine": "manifold",
8
+ "orientation": "The hip's face on the bed, the bosses up; each bearing pocket is a teardrop across the layers",
9
+ "description": "A plate on two LM8UU bushings. The hip housing screws to its face and the hip's motor goes through its middle. It rides up the rods as the foot pushes, so the scale reads the leg.",
10
+ "anchors": {
11
+ "hip": {"at": [0, 0, 0], "axis": [0, 0, -1], "ref": [1, 0, 0]},
12
+ "cable": {"at": ["half_w", 0, 0], "axis": [0, 0, -1]}
13
+ },
14
+ "variables": {
15
+ "plate": {"value": 8, "unit": "mm", "rule": "The plate's thickness: three M3 screws bite here and carry the leg into the bushings"},
16
+ "feet_r": {"value": 37, "unit": "mm", "rule": "The housing's three feet", "interface": true},
17
+ "hub": {"value": 46, "unit": "mm", "rule": "The plate's round middle: past the feet, for the screws"},
18
+ "arm_w": {"value": 24, "unit": "mm", "rule": "The arms' width, out to the bosses"},
19
+ "half_w": {"value": "leg.rod_x + boss_x", "unit": "mm", "rule": "To the far side of a boss"},
20
+ "boss_x": {"value": 11, "unit": "mm", "rule": "Half a boss's width"},
21
+ "boss_long": {"value": 26, "unit": "mm", "rule": "A boss along the rod: 24 mm of bushing and a 2 mm wall with the rod's hole at the far end"},
22
+ "boss_h": {"value": "leg.rod_y + boss_x", "unit": "mm", "rule": "Up from the face, past the bushing"},
23
+ "rod_x": {"value": "leg.rod_x", "unit": "mm", "rule": "Each rod"},
24
+ "rod_y": {"value": "leg.rod_y", "unit": "mm", "rule": "The rods' distance behind the face"},
25
+ "cut": {"value": 44.5, "unit": "mm", "rule": "The motor's way through: a NEMA 17 and 1.1 mm each side"},
26
+ "corner": {"value": 3, "unit": "mm", "rule": "Round the corners of the motor's window"},
27
+ "pilot": {"value": 2.9, "unit": "mm", "rule": "M3 self-tapped into the plate, from the housing", "kind": "community"},
28
+ "a1": {"value": 90, "unit": "°", "rule": "The housing's first foot"},
29
+ "a2": {"value": 210, "unit": "°", "rule": "Second"},
30
+ "a3": {"value": 330, "unit": "°", "rule": "Third"},
31
+ "rad": {"value": 0.017453293, "rule": "Radians in a degree"},
32
+ "segments": {"value": 48, "rule": "Round enough"}
33
+ }
34
+ }
@@ -0,0 +1,9 @@
1
+ // A flat tab screwed to a post, its nose over the flange.
2
+ import jscad from '@jscad/modeling'
3
+ const { cuboid, cylinder } = jscad.primitives
4
+ const { subtract } = jscad.booleans
5
+
6
+ export function main (v) {
7
+ const tab = cuboid({ size: [v.reach + v.back, v.wide, v.thick], center: [(v.back - v.reach) / 2, 0, v.thick / 2] })
8
+ return subtract(tab, cylinder({ radius: v.hole / 2, height: v.thick + 1, center: [0, 0, v.thick / 2], segments: v.segments }))
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "clip",
4
+ "title": "Retaining clip",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "m3"],
7
+ "orientation": "Flat on the bed",
8
+ "description": "Holds the knee's output ring from dropping off its posts.",
9
+ "anchors": {
10
+ "post": {"at": [0, 0, 0], "axis": [0, 0, 1], "ref": [1, 0, 0]}
11
+ },
12
+ "variables": {
13
+ "reach": {"value": 6, "unit": "mm", "rule": "In over the flange's edge, 4 mm"},
14
+ "back": {"value": 4, "unit": "mm", "rule": "Round the post"},
15
+ "wide": {"value": 8, "unit": "mm", "rule": "As wide as the post and a little"},
16
+ "thick": {"value": 3, "unit": "mm", "rule": "Fifteen layers"},
17
+ "hole": {"value": "m3.clearance + x1c.hole_comp", "unit": "mm", "rule": "M3 clearance"},
18
+ "segments": {"value": 24, "rule": "Small round hole"}
19
+ }
20
+ }
@@ -0,0 +1,11 @@
1
+ // A ring with a slot and a screw across it, closing round the rod. The screw's hole is a teardrop across the layers.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder, cuboid } = jscad.primitives
4
+
5
+ export function main (v) {
6
+ const ring = cylinder({ radius: v.outer / 2, height: v.high, center: [0, 0, v.high / 2], segments: v.segments * 2 })
7
+ const hole = cylinder({ radius: v.bore / 2, height: v.high + 1, center: [0, 0, v.high / 2], segments: v.segments })
8
+ const slot = cuboid({ size: [v.outer / 2 + 1, v.slot, v.high + 1], center: [(v.outer / 2 + 1) / 2, 0, v.high / 2] })
9
+ const screw = v.shapes.teardropHole({ d: v.screw, length: v.outer, at: [v.screw_out, 0 - v.outer / 2, v.high / 2], into: '+y', through: true })
10
+ return v.ops.subtract(ring, hole, slot, screw)
11
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "collar",
4
+ "title": "Rod collar: the carriage's stop",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m3"],
7
+ "engine": "manifold",
8
+ "orientation": "Flat on the bed, the rod's hole upright, the clamp's slot through one side",
9
+ "description": "Set on a rod under the carriage: the carriage drops onto it when the foot lifts, so the foot really leaves the scale.",
10
+ "variables": {
11
+ "bore": {"value": "leg.rod_d + x1c.hole_comp", "unit": "mm", "rule": "The rod"},
12
+ "outer": {"value": 22, "unit": "mm", "rule": "Round the rod, wall enough to take the screw"},
13
+ "high": {"value": 10, "unit": "mm", "rule": "Along the rod"},
14
+ "slot": {"value": 1.5, "unit": "mm", "rule": "The slot the clamp screw closes"},
15
+ "screw": {"value": "m3.clearance + x1c.hole_comp", "unit": "mm", "rule": "The clamp's M3, across the slot: its hole a teardrop"},
16
+ "screw_out": {"value": 8, "unit": "mm", "rule": "The screw, clear of the rod"},
17
+ "segments": {"value": 48, "rule": "Round enough"}
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ // A block with a rod's socket in the top and a bolt through each end.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder, roundedRectangle } = jscad.primitives
4
+ const { extrudeLinear } = jscad.extrusions
5
+
6
+ export function main (v) {
7
+ const block = extrudeLinear({ height: v.thick }, roundedRectangle({ size: [v.long, v.wide], roundRadius: v.corner, segments: v.segments }))
8
+ const socket = cylinder({ radius: v.socket / 2, height: v.depth + 1, center: [0, 0, v.thick - v.depth + (v.depth + 1) / 2], segments: v.segments })
9
+ const bolts = [-1, 1].map((s) => cylinder({ radius: v.bolt / 2, height: v.thick + 1, center: [s * v.bolt_x, 0, v.thick / 2], segments: v.segments }))
10
+ return v.ops.subtract(block, socket, bolts)
11
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "foot",
4
+ "title": "Stand foot block",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m5"],
7
+ "engine": "manifold",
8
+ "orientation": "Flat on the bed, the rod's socket opening up",
9
+ "description": "Holds a rod upright, and bolts to the bench through two holes.",
10
+ "variables": {
11
+ "long": {"value": 36, "unit": "mm", "rule": "Along the bench: the rod and a bolt each side"},
12
+ "wide": {"value": 26, "unit": "mm", "rule": "Across: the socket and the bolts"},
13
+ "thick": {"value": "leg.foot_block", "unit": "mm", "rule": "The socket's depth and a floor"},
14
+ "socket": {"value": "leg.rod_d + x1c.hole_comp", "unit": "mm", "rule": "The rod, a press into the printed bore"},
15
+ "depth": {"value": "leg.foot_socket", "unit": "mm", "rule": "How far the rod goes in"},
16
+ "bolt": {"value": "m5.clearance", "unit": "mm", "rule": "To the bench"},
17
+ "bolt_x": {"value": 12, "unit": "mm", "rule": "The bolts, either side of the rod"},
18
+ "corner": {"value": 4, "unit": "mm", "rule": "The block's corners, rounded"},
19
+ "segments": {"value": 48, "rule": "Round enough"}
20
+ }
21
+ }
@@ -0,0 +1,22 @@
1
+ // The motor plate with the fixed ring and posts standing on it. The motor bolts underneath, its shaft up through the middle.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder, cylinderElliptic } = jscad.primitives
4
+ const { translate } = jscad.transforms
5
+
6
+ export function main (v) {
7
+ const motor = v.motors.motorModel('17HS4401')
8
+ const at = (r, a) => [r * Math.cos(a), r * Math.sin(a)]
9
+ const posts = [v.p1, v.p2, v.p3].map((a) => a * v.rad), feet = [v.f1, v.f2, v.f3].map((a) => a * v.rad)
10
+ const plate = cylinder({ radius: v.rim / 2, height: v.plate, center: [0, 0, v.plate / 2], segments: v.ring_segments })
11
+ const ring = translate([0, 0, v.plate], v.gears.internal({ module: v.module, teeth: v.teeth, width: v.gear, rim: v.rim }))
12
+ const lobes = [...posts, ...feet].map((a) => cylinder({ radius: v.lobe / 2, height: v.plate, center: [...at(v.post_r, a), v.plate / 2], segments: v.segments }))
13
+ const joins = [...posts, ...feet].map((a) => jscad.transforms.rotateZ(a, jscad.primitives.cuboid({ size: [v.post_r - v.rim / 2 + 2, v.lobe, v.plate], center: [(v.post_r + v.rim / 2 - 2) / 2, 0, v.plate / 2] })))
14
+ const uprights = posts.map((a) => cylinder({ radius: v.post / 2, height: v.post_high + v.plate, center: [...at(v.post_r, a), (v.post_high + v.plate) / 2], segments: v.segments }))
15
+ const pilots = posts.map((a) => cylinder({ radius: v.pilot / 2, height: v.pilot_depth, center: [...at(v.post_r, a), v.plate + v.post_high - v.pilot_depth / 2], segments: v.segments }))
16
+ const screws = feet.map((a) => cylinder({ radius: v.screw / 2, height: v.plate + 1, center: [...at(v.column_r, a), v.plate / 2], segments: v.segments }))
17
+ const heads = feet.map((a) => cylinder({ radius: v.head / 2, height: v.head_depth, center: [...at(v.column_r, a), v.plate - v.head_depth / 2], segments: v.segments }))
18
+ // the pocket for the motor's boss would be bridged across: a 45° cone from its roof up through the plate needs no bridge
19
+ const hole = v.motors.mountModel(motor, { plate: v.plate, counterbore: true }), rise = v.plate - hole.pocketDepth
20
+ const roof = cylinderElliptic({ height: rise + 1, startRadius: [hole.pocket / 2, hole.pocket / 2], endRadius: [hole.pocket / 2 - rise - 1, hole.pocket / 2 - rise - 1], center: [0, 0, hole.pocketDepth + (rise + 1) / 2], segments: v.segments })
21
+ return v.ops.subtract(v.ops.union(plate, ring, lobes, joins, uprights), v.motors.mount(motor, { plate: v.plate, counterbore: true }, v.ops), pilots, screws, heads, roof)
22
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "housing",
4
+ "title": "Shoulder housing and fixed ring",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m3"],
7
+ "engine": "manifold",
8
+ "orientation": "The motor plate on the bed, the ring and posts up",
9
+ "anchors": {
10
+ "axis": {"at": [0, 0, "plate"], "axis": [0, 0, 1]},
11
+ "motor": {"at": [0, 0, 0], "axis": [0, 0, 1], "ref": [1, 0, 0]}
12
+ },
13
+ "variables": {
14
+ "plate": {"value": "leg.plate", "unit": "mm", "rule": "The motor plate", "interface": true},
15
+ "gear": {"value": "leg.gear", "unit": "mm", "rule": "The fixed ring's face: strong enough for the motor's whole torque"},
16
+ "rim": {"value": 62, "unit": "mm", "rule": "Round the 54-tooth ring, three lines and more of wall"},
17
+ "module": {"value": 1, "unit": "mm", "rule": "The gears'"},
18
+ "teeth": {"value": 54, "rule": "The fixed ring"},
19
+ "post_r": {"value": 37, "unit": "mm", "rule": "Three posts outside the output ring", "interface": true},
20
+ "post": {"value": 7, "unit": "mm", "rule": "Each post's diameter"},
21
+ "post_high": {"value": "leg.bridge_low - 0 - plate", "unit": "mm", "rule": "From the plate to under the bridge", "interface": true},
22
+ "pilot": {"value": 2.9, "unit": "mm", "rule": "An M3 screw self-tapped", "kind": "community"},
23
+ "pilot_depth": {"value": 8, "unit": "mm", "rule": "For an M3 × 16 through the bridge"},
24
+ "column_r": {"value": 37, "unit": "mm", "rule": "Over the base's columns"},
25
+ "lobe": {"value": 12, "unit": "mm", "rule": "The plate reaches out over each column"},
26
+ "screw": {"value": "m3.clearance + x1c.hole_comp", "unit": "mm", "rule": "M3 clearance, down into the column"},
27
+ "head": {"value": "m3.head + 2 * x1c.fit + x1c.hole_comp", "unit": "mm", "rule": "The screw head's counterbore"},
28
+ "head_depth": {"value": "m3.head_height + x1c.layer", "unit": "mm", "rule": "A socket head's height, sunk"},
29
+ "segments": {"value": 64, "rule": "Round enough"},
30
+ "ring_segments": {"value": 96, "rule": "Smooth to the eye and to the gear"},
31
+ "rad": {"value": 0.017453293, "rule": "Radians in a degree"},
32
+ "p1": {"value": 30, "unit": "°", "rule": "First post"},
33
+ "p2": {"value": 150, "unit": "°", "rule": "Second post"},
34
+ "p3": {"value": 270, "unit": "°", "rule": "Third post"},
35
+ "f1": {"value": 90, "unit": "°", "rule": "First foot, over a column"},
36
+ "f2": {"value": 210, "unit": "°", "rule": "Second foot"},
37
+ "f3": {"value": 330, "unit": "°", "rule": "Third foot"}
38
+ }
39
+ }
@@ -0,0 +1,12 @@
1
+ // The output ring, drawn as it prints: its flange on the bed, the teeth standing on it; it goes on upside down.
2
+ import jscad from '@jscad/modeling'
3
+ const { cylinder } = jscad.primitives
4
+ const { translate } = jscad.transforms
5
+
6
+ export function main (v) {
7
+ const flange = cylinder({ radius: v.rim / 2, height: v.top, center: [0, 0, v.top / 2], segments: v.ring_segments })
8
+ const ring = translate([0, 0, v.top], v.gears.internal({ module: v.module, teeth: v.teeth, width: v.width, rim: v.rim }))
9
+ const holes = Array.from({ length: v.bolts }, (_, k) => cylinder({ radius: v.pilot / 2, height: v.top + 1, center: [v.bolt * Math.cos(k * v.quarter), v.bolt * Math.sin(k * v.quarter), v.top / 2], segments: v.segments }))
10
+ const middle = cylinder({ radius: v.middle / 2, height: v.top + 1, center: [0, 0, v.top / 2], segments: v.ring_segments })
11
+ return v.ops.subtract(v.ops.union(flange, ring), holes, middle)
12
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "output",
4
+ "title": "Output ring and flange",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg", "m3"],
7
+ "engine": "manifold",
8
+ "orientation": "The flange on the bed, the teeth standing on it",
9
+ "description": "Printed flange down and fitted upside down: the same part on the shoulder and the elbow.",
10
+ "anchors": {
11
+ "axis": {"at": [0, 0, "top + width"], "axis": [0, 0, -1]},
12
+ "flange": {"at": [0, 0, 0], "axis": [0, 0, -1]}
13
+ },
14
+ "variables": {
15
+ "top": {"value": "leg.flange", "unit": "mm", "rule": "The flange, printed on the bed", "interface": true},
16
+ "width": {"value": "leg.gear", "unit": "mm", "rule": "The output ring's face"},
17
+ "rim": {"value": 66, "unit": "mm", "rule": "Round the 57-tooth ring"},
18
+ "module": {"value": 1, "unit": "mm", "rule": "The gears'"},
19
+ "teeth": {"value": 57, "rule": "The output ring"},
20
+ "pilot": {"value": 2.9, "unit": "mm", "rule": "An M3 screw self-tapped into the flange", "kind": "community"},
21
+ "middle": {"value": 15, "unit": "mm", "rule": "A hole in the middle for the motor's shaft to come up in"},
22
+ "bolt": {"value": 20, "unit": "mm", "rule": "Radius of the bolt circle", "interface": true},
23
+ "segments": {"value": 24, "rule": "Small holes"},
24
+ "ring_segments": {"value": 96, "rule": "Smooth to the eye and to the gear"},
25
+ "quarter": {"value": 1.57079633, "rule": "The bolts, a quarter turn apart, in radians"},
26
+ "bolts": {"value": 4, "rule": "Four"}
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ // A C of TPU, printed lying down: its bore has a 45° ridge that snaps into the foot's groove, and ribs across its tread.
2
+ import jscad from '@jscad/modeling'
3
+ const { polygon, cuboid } = jscad.primitives
4
+ const { translate, rotateZ } = jscad.transforms
5
+ const { extrudeRotate } = jscad.extrusions
6
+
7
+ export function main (v) {
8
+ const mid = v.width / 2, r = v.inner - v.grip, g = v.ridge
9
+ const arc = v.sweep * v.rad
10
+ const ring = extrudeRotate({ segments: v.segments, startAngle: -arc / 2 - Math.PI / 2, angle: arc }, polygon({ points: [[r, 0], [v.outer, 0], [v.outer, v.width], [r, v.width], [r, mid + g], [r - g, mid], [r, mid - g]] }))
11
+ const n = v.ribs
12
+ const cuts = Array.from({ length: n }, (_, k) => rotateZ(-arc / 2 - Math.PI / 2 + (arc * (k + 1)) / (n + 1), cuboid({ size: [v.rib_d * 2, v.rib_w, v.width + 1], center: [v.outer, 0, mid] })))
13
+ return v.ops.subtract(ring, cuts)
14
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "pad",
4
+ "title": "Grip pad",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c", "leg"],
7
+ "engine": "manifold",
8
+ "material": "TPU",
9
+ "orientation": "On one flat side: a C with its tread across the layers. TPU, 95A: PLA on a kitchen scale would slip",
10
+ "description": "A printed tread that snaps round the foot's disc, its inner ridge in the disc's groove. It takes the ground's push and bends a little under it.",
11
+ "anchors": {
12
+ "axis": {"at": [0, 0, 0], "axis": [0, 0, 1], "ref": [1, 0, 0]}
13
+ },
14
+ "variables": {
15
+ "width": {"value": 14, "unit": "mm", "rule": "The foot's width, the disc's", "interface": true},
16
+ "inner": {"value": "leg.foot_r - 3", "unit": "mm", "rule": "The disc's radius"},
17
+ "outer": {"value": "leg.foot_r", "unit": "mm", "rule": "Out to the tread"},
18
+ "grip": {"value": 0.05, "unit": "mm", "rule": "How much the pad's bore is under the disc: TPU stretches, and it stays on"},
19
+ "ridge": {"value": 1, "unit": "mm", "rule": "The ridge in the groove, 45°"},
20
+ "sweep": {"value": 200, "unit": "°", "rule": "Round the disc: past half way, so it snaps on and stays"},
21
+ "rad": {"value": 0.017453293, "rule": "Radians in a degree"},
22
+ "ribs": {"value": 11, "rule": "Cuts across the tread, each a little more edge on the ground"},
23
+ "rib_w": {"value": 1.2, "unit": "mm", "rule": "Each cut's width: three lines of 0.4"},
24
+ "rib_d": {"value": 1, "unit": "mm", "rule": "Each cut's depth, a third of the pad's thickness"},
25
+ "segments": {"value": 64, "rule": "Round enough"}
26
+ }
27
+ }
@@ -0,0 +1,9 @@
1
+ // A planet in two steps, in one piece, printed with the wider step on the bed.
2
+ import jscad from '@jscad/modeling'
3
+ const { translate } = jscad.transforms
4
+
5
+ export function main (v) {
6
+ const high = v.gears.spur({ module: v.module, teeth: v.high, width: v.width })
7
+ const low = translate([0, 0, v.width], v.gears.spur({ module: v.module, teeth: v.low, width: v.width, chamfer: v.low_chamfer }))
8
+ return v.ops.union(high, low)
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "planet",
4
+ "title": "Stepped planet",
5
+ "version": "0.1.0",
6
+ "uses": ["x1c"],
7
+ "engine": "manifold",
8
+ "orientation": "The wider step on the bed",
9
+ "anchors": {
10
+ "axis": {"at": [0, 0, "width * 2 + gap"], "axis": [0, 0, -1]}
11
+ },
12
+ "variables": {
13
+ "gap": {"value": 0.3, "unit": "mm", "rule": "Clear of the motor plate"},
14
+ "module": {"value": 1, "unit": "mm", "rule": "The gears'"},
15
+ "low": {"value": 18, "rule": "On the sun and the held ring"},
16
+ "high": {"value": 21, "rule": "On the output ring"},
17
+ "width": {"value": 8, "unit": "mm", "rule": "Each stage"},
18
+ "low_chamfer": {"value": 0.25, "unit": "mm", "rule": "The top step's tooth tips slanted in at their root, so they do not overhang the step below"}
19
+ }
20
+ }
@@ -0,0 +1,5 @@
1
+ // A block where the scale goes: the foot stands on its top.
2
+ import jscad from '@jscad/modeling'
3
+ const { cuboid } = jscad.primitives
4
+
5
+ export function main (v) { return cuboid({ size: [v.side, v.side, v.high], center: [0, 0, v.high / 2] }) }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://jonibach.github.io/rulecad/schemas/object.schema.json",
3
+ "name": "scale",
4
+ "title": "Kitchen scale (not printed)",
5
+ "version": "0.1.0",
6
+ "role": "reference",
7
+ "uses": ["leg"],
8
+ "anchors": {
9
+ "top": {"at": [0, 0, "high"], "axis": [0, 0, 1]}
10
+ },
11
+ "variables": {
12
+ "side": {"value": 120, "unit": "mm", "rule": "The platform: a common 5 kg kitchen scale. Measure yours", "kind": "estimate"},
13
+ "high": {"value": "leg.scale_h", "unit": "mm", "rule": "Its height"}
14
+ }
15
+ }