]> www.fi.muni.cz Git - things.git/commitdiff
led torch - printed version
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 18 Oct 2018 04:53:29 +0000 (06:53 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Thu, 18 Oct 2018 04:53:29 +0000 (06:53 +0200)
led-torch.scad

index 7f2f74948b3dfcb6c18ff1d28dcc0f06f927545a..5a49740a06a548947ff308663a24d8244cec600d 100644 (file)
@@ -8,6 +8,11 @@ int_d = 19/cos(30);
 barrier_h = 8;
 body_l = 70 + barrier_h;
 
+clip_l = 2;
+clip_w = 0.8;
+clip_dist = 3;
+
+// main cylinder
 difference() {
        cylinder(r = int_d/2 + wall/cos(30), $fn = 6, h = body_l);
        translate([0, 0, wall])
@@ -27,10 +32,6 @@ intersection() {
 }
 
 // rear end clip
-clip_l = 2;
-clip_w = 0.8;
-clip_dist = 3;
-
 for (angle = [0:60:360]) rotate([0, 0, angle])
 translate([-clip_l/2, int_d*cos(30)/2+wall, body_l - clip_dist]) {
        scale([1, 1, 3])
@@ -40,20 +41,38 @@ translate([-clip_l/2, int_d*cos(30)/2+wall, body_l - clip_dist]) {
 
 // lid
 
+switch_w = 14;
+switch_h = 9;
+
 lid_d = int_d + 2*wall/cos(30) + 2*clip_w/cos(30);
-lid_h = clip_dist + 3*wall+3*clip_w;
+lid_h = clip_dist + 3*wall+3*clip_w + switch_h;
 
+support_w = 4;
+support_off = 3;
 translate([0, int_d + 5, 0])
 difference() {
        cylinder(r = lid_d/2 + wall/cos(30), $fn = 6, h = lid_h);
+       translate([-switch_w/2, 0, wall+eps])
+               cube([switch_w, infty, switch_h]);
        difference() {
-               translate([0, 0, wall])
-                       cylinder(r = lid_d/2, $fn = 6, h = lid_h);
-               for (angle = [0:180:360]) rotate([0, 0, angle])
-               translate([-clip_l/2, lid_d*cos(30)/2, clip_dist + 2*wall]) {
+               union() {
+                       translate([0, 0, wall+switch_h])
+                               cylinder(r = lid_d/2, $fn = 6, h = lid_h);
+                       translate([0, 0, wall])
+                               cylinder(r = lid_d/2-2*wall/cos(30), $fn = 6, h = lid_h);
+                       intersection() { // switch side w/o support
+                               translate([0, 0, wall])
+                                       cylinder(r = lid_d/2, $fn = 6, h = lid_h);
+                               translate([-infty/2, 0, 0]) cube(infty);
+                       }
+               }
+               for (angle = [60:180:360]) rotate([0, 0, angle])
+               translate([-clip_l/2, lid_d*cos(30)/2, switch_h+clip_dist + 2*wall]) {
                        scale([1, 1, 3])
                        rotate([0, 90, 0])
                        cylinder(r = clip_w, h = clip_l, $fn = 4);
                }
+               translate([-infty/2, -support_w-support_off, switch_h-eps])
+                       cube([infty, support_w, wall]);
        }
 }