-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr2d2.scad
51 lines (38 loc) · 954 Bytes
/
r2d2.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
h = 150;
r = 80;
s = 2;
leg_w = 30;
first_cut_h = 100;
leg_polygon_points = [
[0,0],
[r/2-5,0],[r/2,5],
[r/2,h/5-5],[r/2-5,h/5+5],
[r/4,h/3],
[r/4,h-r/4],[r/5,h-r/5+5],[r/6,h-r/7+7],
[0,h]];
leg_polygon_points_cut = [
[0,s],
[r/2-5-s,s],[r/2-s,5+s],
[r/2-s,h/5-5-s],[r/2-5-s,h/5+5-s],
[r/4-s,h/3-s],
[r/4-s,h-r/4-s],[r/5-s,h-r/5+5-s],[r/6-s,h-r/7+7-s],
[0,h-s]];
module leg() {
rotate([90,0,0]) linear_extrude(leg_w*2+2*r){
polygon(leg_polygon_points);
mirror()polygon(leg_polygon_points);
}
}
difference(){
union(){
cylinder(h,r,r);
translate([0,0,h])sphere(r);
translate([0,r+leg_w,0]) leg();
}
translate([0,0,s]) cylinder(h-s,r-s,r-s);
translate([-500,-500,first_cut_h]) cube([1000,1000,1000]);
translate([0,r+leg_w-s,0]) rotate([90,0,0]) linear_extrude(leg_w*2+2*r-2*s){
polygon(leg_polygon_points_cut);
mirror()polygon(leg_polygon_points_cut);
}
}