3dprint/tire/tire_81.6_50.scad

205 lines
7.0 KiB
OpenSCAD
Raw Normal View History

2014-06-07 13:22:04 +04:00
// LEGO-like parametric tire...
// (c) Vitaliy Filippov 2014, license: CC-BY-SA 4.0
2014-06-04 11:46:57 +04:00
$fn=60;
2014-06-07 13:22:04 +04:00
// 81.6x50:
R=40.8; // outer radius
2014-06-05 13:56:39 +04:00
R_I=26.5; // innermost radius
2014-06-07 13:22:04 +04:00
BEVEL=2;
THICKNESS=2.5;
PROT_DEPTH=1;
PROT_L_WIDTH=2;
PROT_A_WIDTH=2;
FIX_WIDTH=2;
2014-06-05 13:56:39 +04:00
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-06 02:02:51 +04:00
SPOKE_THICKNESS=10; // thickness of solid spoke part
2014-06-07 17:06:29 +04:00
RIM_THICKNESS=2;
2014-06-06 02:02:51 +04:00
N_SPOKE=9; // number of spokes
CUT_BASE=8;
CUT_ANGLE=12;
CUT_I_R=1.5;
CUT_O_R=2;
SPACING=0.2;
2014-06-06 02:02:51 +04:00
// 6-spoke variant
2014-06-06 02:02:51 +04:00
N_SPOKE=6;
CUT_ANGLE=21;
CUT_I_R=2.5;
CUT_O_R=2;
2014-06-04 11:46:57 +04:00
2014-06-07 13:22:04 +04:00
// small
R=22;
BEVEL=1;
THICKNESS=1.5;
FIX_WIDTH=1;
2014-06-07 13:22:04 +04:00
PROT_A_WIDTH=1;
PROT_L_WIDTH=1;
B_P=3;
B=1;
2014-06-07 13:22:04 +04:00
R_I=15;
CUT_O_R=1;
CUT_BASE=5;
2014-06-07 17:06:29 +04:00
N_L=2;
W=20;
2014-06-07 13:22:04 +04:00
difference() {
union() {
translate([0, 0, W]) rotate([180, 0, 0]) {
rim();
// Support ...
2014-06-07 17:06:29 +04:00
translate([0, 0, SPOKE_THICKNESS+(R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2+SPACING]) cylinder(r=CUT_BASE, h=W-(SPOKE_THICKNESS+(R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2+SPACING));
2014-06-07 16:53:04 +04:00
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);
2014-06-07 16:53:04 +04:00
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));
}
2014-06-07 13:22:04 +04:00
*/
}
tire();
}
// to cut and look inside :)
translate([0, 0, -0.5]) cube(size=[R+10, R+10, W+1]);
2014-06-07 13:22:04 +04:00
}
2014-06-05 20:03:44 +04:00
module rim() {
2014-06-07 13:22:04 +04:00
color([0.5, 0.5, 1]) {
2014-06-05 20:03:44 +04:00
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);
2014-06-06 02:02:51 +04:00
}
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);
2014-06-06 02:02:51 +04:00
}
}
// make spokes by cutting space between them
2014-06-06 02:02:51 +04:00
for (i = [1 : N_SPOKE])
rotate([0, 0, i*360/N_SPOKE]) rim_cut();
// cut spokes toroidally inside the rim
2014-06-07 17:06:29 +04:00
translate([0, 0, SPOKE_THICKNESS+(R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2])
2014-06-06 02:02:51 +04:00
rotate_extrude(convexity = 10)
2014-06-07 17:06:29 +04:00
translate([(R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2+CUT_BASE, 0, 0])
circle(r = (R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2);
// remove the rest of spokes
2014-06-07 17:06:29 +04:00
translate([0, 0, SPOKE_THICKNESS+(R_I-SPACING-RIM_THICKNESS-CUT_BASE)/2])
cylinder(r=R_I-SPACING-RIM_THICKNESS, h=W);
// add axle hole at the center
2014-06-06 02:02:51 +04:00
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
2014-06-07 13:22:04 +04:00
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)])
2014-06-07 17:06:29 +04:00
scale([1, 1, (B_P-FIX_WIDTH-SPACING)/((R_I-SPACING-RIM_THICKNESS-CUT_BASE+2)/2)])
2014-06-07 13:22:04 +04:00
rotate_extrude(convexity = 10)
2014-06-07 17:06:29 +04:00
translate([(R_I-SPACING-CUT_BASE)/2+CUT_BASE-RIM_THICKNESS, 0, 0]) circle(r = (R_I-SPACING-CUT_BASE)/2);
2014-06-05 20:03:44 +04:00
}
}
2014-06-05 13:56:39 +04:00
}
}
2014-06-05 20:03:44 +04:00
module rim_cut() {
2014-06-07 17:06:29 +04:00
in_angle = atan((R_I-SPACING-RIM_THICKNESS)*sin(CUT_ANGLE)/((R_I-SPACING-RIM_THICKNESS)*cos(CUT_ANGLE)-CUT_BASE-CUT_I_R));
2014-06-06 02:02:51 +04:00
translate([0, 0, -0.5]) linear_extrude(height=W+1) {
2014-06-05 20:03:44 +04:00
hull() {
2014-06-06 02:02:51 +04:00
translate([CUT_BASE+CUT_I_R, 0]) circle(r=CUT_I_R);
2014-06-07 17:06:29 +04:00
rotate([0, 0, CUT_ANGLE]) translate([R_I-SPACING-RIM_THICKNESS-CUT_O_R, 0, 0]) circle(r=CUT_O_R);
rotate([0, 0, -CUT_ANGLE]) translate([R_I-SPACING-RIM_THICKNESS-CUT_O_R, 0, 0]) circle(r=CUT_O_R);
2014-06-05 20:03:44 +04:00
}
difference() {
2014-06-07 17:06:29 +04:00
circle(r=R_I-SPACING-RIM_THICKNESS);
2014-06-06 02:02:51 +04:00
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]);
2014-06-05 20:03:44 +04:00
}
}
}
2014-06-05 13:56:39 +04:00
module tire() {
2014-06-04 11:46:57 +04:00
difference() {
hull() {
2014-06-07 13:22:04 +04:00
translate([0, 0, BEVEL]) cylinder(r=R, h=W-BEVEL*2);
cylinder(r=R-BEVEL, h=W);
2014-06-04 11:46:57 +04:00
}
// 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-07 13:22:04 +04:00
translate([0, 0, W-BEVEL]) cylinder(r=R_I+B, h=BEVEL);
translate([0, 0, W]) cylinder(r=R_I+B+BEVEL, 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-07 13:22:04 +04:00
translate([0, 0, 0]) cylinder(r=R_I+B, h=BEVEL);
translate([0, 0, -1]) cylinder(r=R_I+B+BEVEL, h=1);
2014-06-04 11:46:57 +04:00
}
// inside cut
2014-06-07 13:22:04 +04:00
translate([0, 0, B_P+B_W]) cylinder(r=R-THICKNESS-PROT_DEPTH/2, h=W-(B_P+B_W)*2);
2014-06-04 11:46:57 +04:00
difference() {
2014-06-07 13:22:04 +04:00
translate([0, 0, THICKNESS]) cylinder(r=R-THICKNESS-PROT_DEPTH/2, h=W-THICKNESS*2);
cylinder(r=R_I+B+THICKNESS, h=W);
2014-06-04 11:46:57 +04:00
}
// lateral protector
2014-06-07 17:35:38 +04:00
if (N_L > 0) for (i = [1 : N_L])
2014-06-07 13:22:04 +04:00
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);
}
2014-06-04 11:46:57 +04:00
// angular protector
2014-06-07 17:35:38 +04:00
if (N_A > 0) for (i = [1 : N_A])
rotate([0, 0, 360/N_A*i]) protector_angular();
2014-06-04 11:46:57 +04:00
}
2014-06-05 13:56:39 +04:00
}
2014-06-04 11:46:57 +04:00
2014-06-07 17:35:38 +04:00
module protector_angular() {
2014-06-04 11:46:57 +04:00
difference() {
union() {
2014-06-07 13:22:04 +04:00
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)]);
2014-06-04 11:46:57 +04:00
}
2014-06-07 13:22:04 +04:00
translate([0, 0, -0.5]) cylinder(r=R-PROT_DEPTH, h=W+1);
2014-06-04 11:46:57 +04:00
}
}
2014-06-06 02:02:51 +04:00
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);
}
}