3dprint/tire/tire_81.6_50.scad

204 lines
6.8 KiB
OpenSCAD

// LEGO-like parametric tire...
// (c) Vitaliy Filippov 2014, license: CC-BY-SA 4.0
$fn=60;
// 81.6x50:
R=40.8; // outer radius
R_I=26.5; // innermost radius
BEVEL=2;
THICKNESS=2.5;
PROT_DEPTH=1;
PROT_L_WIDTH=2;
PROT_A_WIDTH=2;
FIX_WIDTH=2;
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
W=50; // tire width
N_L=4; // number of lateral protectors
N_A=10; // number of angular protectors
SPOKE_THICKNESS=10; // thickness of solid spoke part
N_SPOKE=9; // number of spokes
CUT_BASE=8;
CUT_ANGLE=12;
CUT_I_R=1.5;
CUT_O_R=2;
SPACING=0.2;
// 6-spoke variant
N_SPOKE=6;
CUT_ANGLE=21;
CUT_I_R=2.5;
CUT_O_R=2;
N_L=2;
// small
R=22;
BEVEL=1;
THICKNESS=1.5;
FIX_WIDTH=1;
PROT_A_WIDTH=1;
PROT_L_WIDTH=1;
B_P=3;
B=1;
R_I=15;
CUT_O_R=1;
CUT_BASE=5;
W=20;
difference() {
union() {
translate([0, 0, W]) rotate([180, 0, 0]) {
rim();
// Support ...
translate([0, 0, SPOKE_THICKNESS+(R_I-2-CUT_BASE)/2+SPACING]) cylinder(r=CUT_BASE, h=W-(SPOKE_THICKNESS+(R_I-2-CUT_BASE)/2+SPACING));
translate([0, 0, W-(B_P-FIX_WIDTH-SPACING)+SPACING]) cylinder(r=R_I+B-SPACING, h=(B_P-FIX_WIDTH-SPACING)-SPACING);
/*
translate([0, 0, W-(B_P-FIX_WIDTH-SPACING)-2-B+SPACING]) difference() {
cylinder(r=R_I+B+THICKNESS, h=(B_P-FIX_WIDTH-SPACING)+2+B-SPACING);
translate([0, 0, -1]) cylinder(r=R_I+B+SPACING, h=1+(B_P-FIX_WIDTH-SPACING)+2+B-SPACING-((B_P-FIX_WIDTH-SPACING)-SPACING));
}
*/
}
tire();
}
// to cut and look inside :)
translate([0, 0, -0.5]) cube(size=[R+10, R+10, W+1]);
}
module rim() {
color([0.5, 0.5, 1]) {
difference() {
union() {
cylinder(r=R_I-SPACING, h=W-(B_P-FIX_WIDTH-SPACING));
// outer fixing edges
cylinder(r=R_I+B-SPACING, h=FIX_WIDTH+(B_P-FIX_WIDTH-SPACING));
translate([0, 0, W-(B_P-FIX_WIDTH-SPACING)-FIX_WIDTH]) cylinder(r=R_I+B-SPACING, h=FIX_WIDTH);
// inner fixing edges, 45 degree slope for easier printing
translate([0, 0, FIX_WIDTH+(B_P-FIX_WIDTH-SPACING)+(B_W+SPACING)+SPACING]) hull() {
cylinder(r=R_I+B+THICKNESS, h=FIX_WIDTH);
translate([0, 0, B+THICKNESS+SPACING]) cylinder(r=R_I-SPACING, h=FIX_WIDTH);
}
translate([0, 0, W-(FIX_WIDTH+(B_P-FIX_WIDTH-SPACING)+(B_W+SPACING))-FIX_WIDTH-SPACING]) hull() {
cylinder(r=R_I+B+THICKNESS, h=FIX_WIDTH);
translate([0, 0, -(B+THICKNESS+SPACING)]) cylinder(r=R_I-SPACING, h=FIX_WIDTH);
}
}
// make spokes by cutting space between them
for (i = [1 : N_SPOKE])
rotate([0, 0, i*360/N_SPOKE]) rim_cut();
// cut spokes toroidally inside the rim
translate([0, 0, SPOKE_THICKNESS+(R_I-2-CUT_BASE)/2])
rotate_extrude(convexity = 10)
translate([(R_I-2-CUT_BASE)/2+CUT_BASE, 0, 0]) circle(r = (R_I-2-CUT_BASE)/2);
// remove the rest of spokes
translate([0, 0, SPOKE_THICKNESS+(R_I-2-CUT_BASE)/2]) cylinder(r=R_I-2, h=W);
// add axle hole at the center
translate([0, 0, -0.5]) linear_extrude(height=W+1) axle();
// add center cut around axle hole
translate([0, 0, -1]) cylinder(r=CUT_BASE-2, h=5+(B_P-FIX_WIDTH-SPACING));
// make spokes convex using another toroidal cut
difference() {
translate([0, 0, -1]) cylinder(r=1+R_I+B-0.5/*R_I-2*/, h=1+(B_P-FIX_WIDTH-SPACING));
translate([0, 0, (B_P-FIX_WIDTH-SPACING)])
scale([1, 1, (B_P-FIX_WIDTH-SPACING)/((R_I-2-CUT_BASE+2)/2)])
rotate_extrude(convexity = 10)
translate([(R_I-2-CUT_BASE+2)/2+CUT_BASE-2, 0, 0]) circle(r = (R_I-2-CUT_BASE+2)/2);
}
}
}
}
module rim_cut() {
in_angle = atan((R_I-2)*sin(CUT_ANGLE)/((R_I-2)*cos(CUT_ANGLE)-CUT_BASE-CUT_I_R));
translate([0, 0, -0.5]) linear_extrude(height=W+1) {
hull() {
translate([CUT_BASE+CUT_I_R, 0]) circle(r=CUT_I_R);
rotate([0, 0, CUT_ANGLE]) translate([R_I-2-CUT_O_R, 0, 0]) circle(r=CUT_O_R);
rotate([0, 0, -CUT_ANGLE]) translate([R_I-2-CUT_O_R, 0, 0]) circle(r=CUT_O_R);
}
difference() {
circle(r=R_I-2);
translate([CUT_BASE+CUT_I_R, 0]) rotate([0, 0, in_angle]) translate([-50, 0]) square(size=[100, 100]);
translate([CUT_BASE+CUT_I_R, 0]) rotate([0, 0, -in_angle]) translate([-50, -100]) square(size=[100, 100]);
}
}
}
module tire() {
difference() {
hull() {
translate([0, 0, BEVEL]) cylinder(r=R, h=W-BEVEL*2);
cylinder(r=R-BEVEL, h=W);
}
// center hole through all piece
translate([0, 0, -0.5]) cylinder(r=R_I, h=W+1);
// top hole
translate([0, 0, W-B_P]) cylinder(r=R_I+B, h=B_P+1);
hull() {
translate([0, 0, W-BEVEL]) cylinder(r=R_I+B, h=BEVEL);
translate([0, 0, W]) cylinder(r=R_I+B+BEVEL, h=1);
}
// bottom hole
translate([0, 0, -1]) cylinder(r=R_I+B, h=B_P+1);
hull() {
translate([0, 0, 0]) cylinder(r=R_I+B, h=BEVEL);
translate([0, 0, -1]) cylinder(r=R_I+B+BEVEL, h=1);
}
// inside cut
translate([0, 0, B_P+B_W]) cylinder(r=R-THICKNESS-PROT_DEPTH/2, h=W-(B_P+B_W)*2);
difference() {
translate([0, 0, THICKNESS]) cylinder(r=R-THICKNESS-PROT_DEPTH/2, h=W-THICKNESS*2);
cylinder(r=R_I+B+THICKNESS, h=W);
}
// lateral protector
for (i = [1 : N_L])
translate([0, 0, -PROT_L_WIDTH/2+i*W/(N_L+1)])
difference() {
cylinder(r=R+1, h=PROT_L_WIDTH);
translate([0, 0, -0.01]) linear_extrude(height=min(PROT_L_WIDTH/2-0.1, PROT_DEPTH/2)+0.01, scale=(R-PROT_DEPTH)/(R+0.01)) circle(r=R+0.01);
translate([0, 0, PROT_L_WIDTH]) rotate([180, 0, 0]) translate([0, 0, -0.01]) linear_extrude(height=min(PROT_L_WIDTH/2-0.1, PROT_DEPTH/2)+0.01, scale=(R-PROT_DEPTH)/(R+0.01)) circle(r=R+0.01);
translate([0, 0, -0.1]) cylinder(r=R-PROT_DEPTH, h=PROT_L_WIDTH+0.2);
}
// angular protector
for (i = [1 : N_A])
rotate([0, 0, 360/N_A*i]) protector_single();
}
}
module protector_single() {
difference() {
union() {
translate([(W/2)/2, 0, W/2]) rotate([0, -45, 0])
cube(size=[PROT_A_WIDTH, R+4, sqrt((W/2)*(W/2)*2)]);
translate([-(W/2)/2, 0, 0]) rotate([0, 45, 0])
cube(size=[PROT_A_WIDTH, R+4, PROT_A_WIDTH+sqrt((W/2)*(W/2)*2)]);
}
translate([0, 0, -0.5]) cylinder(r=R-PROT_DEPTH, h=W+1);
translate([0, 0, W]) cylinder(r=R+10, h=10);
translate([0, 0, -10]) cylinder(r=R+10, h=10);
}
}
module axle(height) {
axle_gap = 1.95;
HOLE_RADIUS = 2.55;
union() {
translate([-HOLE_RADIUS, -axle_gap/2, 0])
roundedRect(HOLE_RADIUS * 2, axle_gap, .2);
translate([-axle_gap/2, -HOLE_RADIUS, 0])
roundedRect(axle_gap, HOLE_RADIUS * 2, .2);
}
}
module roundedRect(x, y, radius) {
hull() {
translate([radius, radius, 0]) circle(r=radius);
translate([x - radius, radius, 0]) circle(r=radius);
translate([x - radius, y - radius, 0]) circle(r=radius);
translate([radius, y - radius, 0]) circle(r=radius);
}
}