]> www.fi.muni.cz Git - things.git/blob - turtle_leg.scad
rocket: alternative rod holder
[things.git] / turtle_leg.scad
1 eps = 0.01;
2 infty = 100;
3
4
5 beam_len = 36;
6 beam_w = 8;
7 beam_h = 4.5;
8
9 leg_h = 8;
10 leg_d = 10;
11 leg_asym = 1.5;
12 leg_wall = 1.5;
13
14 tail_w1 = 4;
15 tail_w2 = 2;
16 tail_h = 2;
17 tail_len = 11;
18
19 screw_d = 4;
20 screw_head_d = 6;
21 screw_head_h = 3;
22
23 screw_bot_d = 5;
24 screw_bot_h = 2;
25
26 lever_hole_d = 5;
27 lever_hole_x = 6;
28 lever_space_d = 6.5;
29 lever_space_d2 = 8;
30 lever_h = 1;
31
32 module body() {
33         // main beam
34         translate([-beam_len/2, -beam_w/2, 0])
35                 cube([beam_len, beam_w, beam_h]);
36         // legs
37         for (x = [-1, 1]) {
38                 scale([x, 1, 1]) translate([beam_len/2, 0, 0]) scale([1, leg_asym, 1])
39                         cylinder(r1 = beam_w/(2*leg_asym), r2 = leg_d/(2*leg_asym), h = leg_h);
40         }
41
42         // reinforcement for the screw hole
43         cylinder(r = screw_bot_d/2 + 2, h = beam_h);
44         
45         // reinforcement for the lever hole
46         intersection() {
47                 translate([lever_hole_x, 0, 0]) 
48                         cylinder(r = lever_space_d/2 + 2, h = beam_h);
49                 translate([-infty/2, -infty, 0]) cube(infty);
50         }
51
52 /*
53         // tail
54         hull() {
55                 translate([-tail_w1/2, -beam_w/2, 0])
56                         cube([tail_w1, eps, tail_h]);
57                 translate([-tail_w2/2, -beam_w/2-tail_len, 0])
58                         cube([tail_w2, eps, tail_h]);
59         }
60 */
61 }
62
63 module leg() {
64         difference() {
65                 body();
66
67                 // legs hole
68                 hull() for (x = [-1, 1])
69                         scale([x, leg_asym, 1])
70                                 translate([beam_len/2, 0, beam_h+eps])
71                                 cylinder(r1 = (beam_w-2*leg_wall)/(2*leg_asym),
72                                          r2 = (leg_d-2*leg_wall)/(2*leg_asym),
73                                         h = leg_h - beam_h + eps);
74                 // legs side cut
75                 for (x = [-1, 1]) scale([x, 1 ,1])
76                         translate([beam_len/2, 0, 0])
77                         rotate([0, 45, 0])
78                         translate([0, -infty/2, -infty/2])
79                                 cube(infty);
80
81                 // screw hole
82                 rotate([0, 0, 45])
83                 cylinder(r = screw_d/2, h = infty, $fn = 4);
84                 // screw head
85                 
86                 translate([0, 0, screw_head_h])
87                         cylinder(r = screw_head_d/2, h = infty);
88
89                 // screw bottom
90                 difference() {
91                         translate([0, 0, -eps])
92                                 cylinder(r = screw_bot_d/2, h = screw_bot_h+eps);
93                         translate([screw_d/2, -infty/2, -infty/2])
94                                 cube(infty);
95                 }
96
97                 // lever hole
98                 translate([lever_hole_x, 0, -eps])
99                         rotate([0, 0, 45])
100                         cylinder(r = lever_hole_d/2, h = infty, $fn = 4);
101
102                 // lever space
103                 hull() {
104                         translate([lever_hole_x, 0, -eps])
105                                 cylinder(r = lever_space_d/2, h=beam_h-lever_h+eps);
106                         translate([lever_hole_x - lever_space_d2/2, beam_w/2, -eps])
107                                 cube([lever_space_d2, infty, beam_h-lever_h+eps]);
108                 }
109         }
110 }
111
112 leg();
113