]> www.fi.muni.cz Git - things.git/commitdiff
18650 LED torch - first version
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 16 Oct 2018 15:01:41 +0000 (17:01 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 16 Oct 2018 15:01:41 +0000 (17:01 +0200)
led-torch.scad [new file with mode: 0644]

diff --git a/led-torch.scad b/led-torch.scad
new file mode 100644 (file)
index 0000000..7f2f749
--- /dev/null
@@ -0,0 +1,59 @@
+infty = 200;
+eps = 0.01;
+
+wall = 1;
+
+led_d = 10 + 0.5;
+int_d = 19/cos(30);
+barrier_h = 8;
+body_l = 70 + barrier_h;
+
+difference() {
+       cylinder(r = int_d/2 + wall/cos(30), $fn = 6, h = body_l);
+       translate([0, 0, wall])
+       cylinder(r = int_d/2, $fn = 6, h = body_l);
+       // hole for LED
+       translate([0, 0, -eps])
+               cylinder(r = led_d/2, h = infty);
+}
+
+// battery front end stop
+translate([0, 0, barrier_h-wall])
+intersection() {
+       cylinder(r = int_d/2 + wall/(2*cos(30)), $fn = 6, h = wall);
+       for (angle = [0:360/3:360]) rotate ([0, 0, angle])
+               translate([led_d/2+wall, -infty/2, -eps])
+                       cube(infty);
+}
+
+// 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])
+       rotate([0, 90, 0])
+               cylinder(r = clip_w, h = clip_l, $fn = 4);
+}
+
+// lid
+
+lid_d = int_d + 2*wall/cos(30) + 2*clip_w/cos(30);
+lid_h = clip_dist + 3*wall+3*clip_w;
+
+translate([0, int_d + 5, 0])
+difference() {
+       cylinder(r = lid_d/2 + wall/cos(30), $fn = 6, h = lid_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]) {
+                       scale([1, 1, 3])
+                       rotate([0, 90, 0])
+                       cylinder(r = clip_w, h = clip_l, $fn = 4);
+               }
+       }
+}