]> www.fi.muni.cz Git - things.git/commitdiff
solar-powered turtle toy leg
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 27 Oct 2016 09:56:21 +0000 (11:56 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 27 Oct 2016 09:56:21 +0000 (11:56 +0200)
turtle_leg.scad [new file with mode: 0644]

diff --git a/turtle_leg.scad b/turtle_leg.scad
new file mode 100644 (file)
index 0000000..93dba01
--- /dev/null
@@ -0,0 +1,113 @@
+eps = 0.01;
+infty = 100;
+
+
+beam_len = 36;
+beam_w = 8;
+beam_h = 4.5;
+
+leg_h = 8;
+leg_d = 10;
+leg_asym = 1.5;
+leg_wall = 1.5;
+
+tail_w1 = 4;
+tail_w2 = 2;
+tail_h = 2;
+tail_len = 11;
+
+screw_d = 4;
+screw_head_d = 6;
+screw_head_h = 3;
+
+screw_bot_d = 5;
+screw_bot_h = 2;
+
+lever_hole_d = 5;
+lever_hole_x = 6;
+lever_space_d = 6.5;
+lever_space_d2 = 8;
+lever_h = 1;
+
+module body() {
+       // main beam
+       translate([-beam_len/2, -beam_w/2, 0])
+               cube([beam_len, beam_w, beam_h]);
+       // legs
+       for (x = [-1, 1]) {
+               scale([x, 1, 1]) translate([beam_len/2, 0, 0]) scale([1, leg_asym, 1])
+                       cylinder(r1 = beam_w/(2*leg_asym), r2 = leg_d/(2*leg_asym), h = leg_h);
+       }
+
+       // reinforcement for the screw hole
+       cylinder(r = screw_bot_d/2 + 2, h = beam_h);
+       
+       // reinforcement for the lever hole
+       intersection() {
+               translate([lever_hole_x, 0, 0]) 
+                       cylinder(r = lever_space_d/2 + 2, h = beam_h);
+               translate([-infty/2, -infty, 0]) cube(infty);
+       }
+
+/*
+       // tail
+       hull() {
+               translate([-tail_w1/2, -beam_w/2, 0])
+                       cube([tail_w1, eps, tail_h]);
+               translate([-tail_w2/2, -beam_w/2-tail_len, 0])
+                       cube([tail_w2, eps, tail_h]);
+       }
+*/
+}
+
+module leg() {
+       difference() {
+               body();
+
+               // legs hole
+               hull() for (x = [-1, 1])
+                       scale([x, leg_asym, 1])
+                               translate([beam_len/2, 0, beam_h+eps])
+                               cylinder(r1 = (beam_w-2*leg_wall)/(2*leg_asym),
+                                        r2 = (leg_d-2*leg_wall)/(2*leg_asym),
+                                       h = leg_h - beam_h + eps);
+               // legs side cut
+               for (x = [-1, 1]) scale([x, 1 ,1])
+                       translate([beam_len/2, 0, 0])
+                       rotate([0, 45, 0])
+                       translate([0, -infty/2, -infty/2])
+                               cube(infty);
+
+               // screw hole
+               rotate([0, 0, 45])
+               cylinder(r = screw_d/2, h = infty, $fn = 4);
+               // screw head
+               
+               translate([0, 0, screw_head_h])
+                       cylinder(r = screw_head_d/2, h = infty);
+
+               // screw bottom
+               difference() {
+                       translate([0, 0, -eps])
+                               cylinder(r = screw_bot_d/2, h = screw_bot_h+eps);
+                       translate([screw_d/2, -infty/2, -infty/2])
+                               cube(infty);
+               }
+
+               // lever hole
+               translate([lever_hole_x, 0, -eps])
+                       rotate([0, 0, 45])
+                       cylinder(r = lever_hole_d/2, h = infty, $fn = 4);
+
+               // lever space
+               hull() {
+                       translate([lever_hole_x, 0, -eps])
+                               cylinder(r = lever_space_d/2, h=beam_h-lever_h+eps);
+                       translate([lever_hole_x - lever_space_d2/2, beam_w/2, -eps])
+                               cube([lever_space_d2, infty, beam_h-lever_h+eps]);
+               }
+       }
+}
+
+leg();
+