-
Notifications
You must be signed in to change notification settings - Fork 0
/
tread.scad
58 lines (50 loc) · 1.17 KB
/
tread.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module treadPlate(shape="smooth") {
for (x = [0:19], y = [0:24]) {
if (y%2) {
translate([x*3.5 + 1.75, y*2]) rotate([0,0,45]) diamond(shape);
}
else {
translate([x*3.5, y*2]) rotate([0,0,-45]) diamond(shape);
}
}
translate([0,0,-.25]) cube([50,50,.25]);
}
module diamond(p="sharp") {
if (p == "sharp") {
scale([.5,.5,.5]) sharpDiamond();
}
else if (p == "smooth") {
scale([.5,.5,.5]) smoothDiamond();
}
else {
scale([.5,.5,.5]) treadPattern();
}
}
module sharpDiamond() {
linear_extrude(height=.5, scale=.9)
union() {
circle(d=1.5, $fn=25);
intersection() {
translate([-9.5,0]) circle(d=20, $fn=50);
translate([9.5,0]) circle(d=20, $fn=50);
}
}
}
module smoothDiamond() {
linear_extrude(height=.5, scale=.9)
hull() {
scale([1,2,1]) circle(d=1.5, $fn=25);
intersection() {
translate([-9.5,0]) circle(d=20, $fn=50);
translate([9.5,0]) circle(d=20, $fn=50);
}
}
}
module treadPattern() {
linear_extrude(height=.5, scale=.9)
intersection() {
translate([-14.25,0]) circle(d=30, $fn=100);
translate([14.25,0]) circle(d=30, $fn=100);
square([10,6], center=true);
}
}