Last active
December 13, 2018 02:06
-
-
Save jarondl/23d5c35453761601bcc67c8f962a1180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R1 = 17; | |
R2 = 12; | |
R3 = 2.5; | |
// Minimal thickness in hole | |
H0 = 1; | |
// Height of bars | |
H1 = 4; | |
// Height of circle | |
H2 = 6; | |
// Extra hole padding | |
E = 0.5; | |
// L is the distance between wheels, | |
// Full width will be L + 2 * H2 | |
L = 45; | |
// Number of bars | |
N = 4; | |
// Width of bar | |
A = 3.5; | |
$fa=1; | |
$fs = 0.01; | |
// Radius of intersection of bars. | |
rr = A/(2*sin(90/N)); | |
module wheel() { | |
intersection(){ | |
cylinder(h=3*L, r=R1, center=true); | |
union() { | |
translate([0,0,H1]) | |
cylinder(h=H2-H1, r1=rr, r2=R3); | |
difference(){ | |
cylinder(h=H2, r=2*R1); | |
cylinder(h=3*L, r=R2, center=true); | |
} | |
for(n=[0:N]){ | |
translate([0,0,H1/2]) | |
rotate([0, 0, 180*n/N]) | |
cube([A, 2*R1, H1], center=true); | |
} | |
} | |
} | |
} | |
module wheel_axle(with_axle) { | |
if (with_axle) { | |
union() { | |
wheel(); | |
cylinder(h=L+2*H2, r=R3); | |
} | |
} else { | |
difference() { | |
wheel(); | |
translate([0,0,H0]) | |
cylinder(h=2*H2-H0,r=R3+E); | |
} | |
} | |
} | |
union(){ | |
wheel_axle(true); | |
translate([0, 2*R1+2, 0]) | |
wheel_axle(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment