3dprint/tire/tire_81.6_50.scad

99 lines
2.9 KiB
OpenSCAD
Raw Normal View History

2014-06-04 11:46:57 +04:00
// LEGO-like tire 81.6x50... Dunno where it's 81.6, it's 84 in fact...
// (c) Vitaliy Filippov 2014, license: CC-BY-SA 3.0
$fn=60;
R=42; // outer radius
2014-06-05 13:56:39 +04:00
R_I=26.5; // innermost radius
B=2.5; // width of edge for the rim
B_W=1.6; // thickness of edge for the rim
B_P=4; // position of edge for the rim
2014-06-04 11:46:57 +04:00
W=50; // tire width
N_L=4; // number of lateral protectors
2014-06-05 13:56:39 +04:00
N_A=10; // number of angular protectors
2014-06-04 11:46:57 +04:00
2014-06-05 20:03:44 +04:00
rim();
tire();
module rim() {
translate([0, 0, B_P-2-0.2]) color([0.5, 0.5, 1]) {
difference() {
union() {
cylinder(r=R_I-0.2, h=W-2*(B_P-2-0.2));
cylinder(r=R_I+B-0.5, h=2);
translate([0, 0, W-2*(B_P-2-0.2)-2]) cylinder(r=R_I+B-0.5, h=2);
translate([0, 0, B_P]) cylinder(r=R_I+B+2, h=2);
translate([0, 0, W-2*(B_P-2-0.2)-6]) cylinder(r=R_I+B+2, h=2);
}
for (i = [1 : 8]) rotate([0, 0, i*45]) rim_cut();
translate([0, 0, -0.5]) cylinder(r=2.5, h=W+1);
}
2014-06-05 13:56:39 +04:00
}
}
2014-06-05 20:03:44 +04:00
module rim_cut() {
translate([5, 0, -0.5]) linear_extrude(height=W+1) {
hull() {
circle(r=1);
rotate([0, 0, 15]) translate([R_I-2-5-3, 0, 0]) circle(r=3);
rotate([0, 0, -15]) translate([R_I-2-5-3, 0, 0]) circle(r=3);
}
difference() {
circle(r=R_I-2-5);
rotate([0, 0, 15]) translate([-50, 0]) square(size=[100, 30]);
rotate([0, 0, -15]) translate([-50, -30]) square(size=[100, 30]);
}
}
}
2014-06-05 13:56:39 +04:00
module tire() {
2014-06-04 11:46:57 +04:00
difference() {
hull() {
translate([0, 0, 2]) cylinder(r=R, h=W-4);
cylinder(r=R-2, h=W);
}
// center hole through all piece
2014-06-05 13:56:39 +04:00
translate([0, 0, -0.5]) cylinder(r=R_I, h=W+1);
2014-06-04 11:46:57 +04:00
// top hole
2014-06-05 13:56:39 +04:00
translate([0, 0, W-B_P]) cylinder(r=R_I+B, h=B_P+1);
2014-06-04 11:46:57 +04:00
hull() {
2014-06-05 13:56:39 +04:00
translate([0, 0, W-1.5]) cylinder(r=R_I+B, h=1.5);
translate([0, 0, W]) cylinder(r=R_I+B+1.5, h=1);
2014-06-04 11:46:57 +04:00
}
// bottom hole
2014-06-05 13:56:39 +04:00
translate([0, 0, -1]) cylinder(r=R_I+B, h=B_P+1);
2014-06-04 11:46:57 +04:00
hull() {
2014-06-05 13:56:39 +04:00
translate([0, 0, 0]) cylinder(r=R_I+B, h=1.5);
translate([0, 0, -1]) cylinder(r=R_I+B+1.5, h=1);
2014-06-04 11:46:57 +04:00
}
// inside cut
2014-06-05 13:56:39 +04:00
translate([0, 0, B_P+B_W]) cylinder(r=R-3, h=W-(B_P+B_W)*2);
2014-06-04 11:46:57 +04:00
difference() {
translate([0, 0, 2.5]) cylinder(r=R-3, h=W-2.5*2);
2014-06-05 13:56:39 +04:00
cylinder(r=R_I+B+2, h=W);
2014-06-04 11:46:57 +04:00
}
// lateral protector
for (i = [1 : N_L])
translate([0, 0, -1+i*W/(N_L+1)]) difference() {
cylinder(r=R+1, h=2.5);
translate([0, 0, -0.1]) cylinder(r=R-1, h=2.5+0.2);
}
// angular protector
for (i = [1 : N_A])
rotate([0, 0, 360/N_A*i]) protector_single();
// to cut and look inside :)
//translate([0, 0, -0.1]) cube(size=[100, 100,100]);
}
2014-06-05 13:56:39 +04:00
}
2014-06-04 11:46:57 +04:00
module protector_single() {
difference() {
union() {
translate([(W/2)/2, 0, W/2]) rotate([0, -45, 0]) cube(size=[2, R+4, sqrt((W/2)*(W/2)*2)]);
translate([-(W/2+2)/2, 0, 0]) rotate([0, 45, 0]) cube(size=[2, R+4, sqrt((W/2+2)*(W/2+2)*2)]);
}
translate([0, 0, -0.5]) cylinder(r=R-1, h=W+1);
translate([0, 0, W]) cylinder(r=R+10, h=10);
translate([0, 0, -10]) cylinder(r=R+10, h=10);
}
}