]> www.fi.muni.cz Git - things.git/commitdiff
Merge branch 'master' of ssh://anxur.fi.muni.cz/home/kas/public_html/git/things
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 19 May 2015 18:13:34 +0000 (20:13 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 19 May 2015 18:13:34 +0000 (20:13 +0200)
diffuser-adjustable.scad [new file with mode: 0644]
diffuser-zsj-t29.scad [deleted file]
led-arrow.scad [new file with mode: 0644]

diff --git a/diffuser-adjustable.scad b/diffuser-adjustable.scad
new file mode 100644 (file)
index 0000000..8c47adf
--- /dev/null
@@ -0,0 +1,69 @@
+// A simple adjustable diffuser for the LED flashlights.
+//
+// Designed by Jan "Yenya" Kasprzak <kas at yenya.net>.
+// Distributable under the terms of the Artistic License.
+//
+// Tested with ZHISHUNJIA ZSJ-T29 LED flashlight (dx.com SKU #317226).
+// NOTE: I can't really recommend this particular flashlight, it is
+// well below the specs (600/300/150 mA instead of stated 2.4 A).
+//
+// For any other flashlight, adjust the parameters below:
+
+// the true _diameter_ of the flashlight + some space around
+ring_d = 34.3 + 1.0;
+
+// the diaphragm thickness, set so that it is printed with two print layers
+diaphragm = 0.5;
+
+// outer wall thickness - preferably the integer multiple
+// of the print trace width
+wall = 1.5;
+
+// height of the center of clip beams + some space below + diaphragm thickness
+clip_h = 7.3 + 0.5 + diaphragm;
+
+// the clips protrude this much to the inner cylindrical hole
+// the bigger value means more stiff fit
+clip_w = 1.2;
+
+clip_angle = 120; // at least 90 degrees; bigger is easier to put on and off,
+       // smaller is more stiff, but harder to remove
+
+n_clips = 3; // number of clips; odd numbers prefered
+
+// the height of the clip is computed so that there is wall/2-wide flat
+// on top of the clip
+clip_top = clip_h + (clip_w+wall/2)*tan(clip_angle/2);
+
+// the overall height:
+// ring_h = clip_top; // cylindrical shape without the clips protruding on the top
+ring_h = clip_h + wall; // clips protruding on the top
+
+infty = 100;
+eps = 0.01;
+
+module diffuser() {
+       difference() {
+               // outer cylinder
+               cylinder(r = ring_d/2 + wall, h = ring_h);
+               // inner cylinder hole + diaphragm
+               translate([0, 0, diaphragm])
+                       cylinder(r = ring_d/2, h = ring_h);
+               translate([0, 0, ring_h + eps - wall])
+                       cylinder(r1 = ring_d/2, r2 = ring_d/2 + wall/2, h = wall);
+       }
+       // clip beams
+       for (angle = [0:360/n_clips:360-eps]) intersection() {
+               rotate([0,0,angle])
+                       translate([ring_d/2-clip_w, -infty/2, clip_h]) {
+                               rotate([0, 90-clip_angle/2, 0])
+                                       cube(infty);
+                               rotate([0, clip_angle/2, 0])
+                                       cube(infty);
+                       }
+               cylinder(r = ring_d/2 + wall, h = clip_top);
+       }
+}
+
+diffuser();
+
diff --git a/diffuser-zsj-t29.scad b/diffuser-zsj-t29.scad
deleted file mode 100644 (file)
index c7c46db..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Diffuser for ZHISHUNJIA ZSJ-T29 LED flashlight (dx.com SKU #317226).
-infty = 100;
-eps = 0.01;
-
-diaphragm = 0.5; // diaphragm thickness
-wall = 1.5;
-
-ring_h = 12; // the height of the body
-ring_d = 34.3 + 0.5; // the lens ring diameter + tolerance
-
-clip_h = 7.3 + 0.5; // height of the clip above the diaphragm
-clip_dist = 1.5;
-clip_size = 1.2;
-
-
-module diffuser() {
-       difference() {
-               cylinder(r = ring_d/2 + wall, h = ring_h);
-               translate([0, 0, diaphragm])
-                       cylinder(r = ring_d/2, h = ring_h);
-               for (angle = [0:120:360]) rotate([0,0,60+angle]) {
-                       translate([0, 0, 20+clip_h])
-                       rotate([0, 90, 0])
-                               cylinder(r=20, h=infty);
-               }
-       }
-       for (angle = [0:120:360]) rotate([0,0,angle]) {
-               intersection() {
-                       hull() {
-                               translate([ring_d/2-clip_dist, -infty/2, clip_h])
-                                       cube([infty, infty, clip_size]);
-                               translate([ring_d/2+wall/2, -eps/2, ring_h+wall])
-                                       cube([eps, eps, eps]);
-                       }
-                       cylinder(r = ring_d/2 + wall/2, h = ring_h);
-               }
-       }
-}
-
-diffuser();
-
diff --git a/led-arrow.scad b/led-arrow.scad
new file mode 100644 (file)
index 0000000..768bba5
--- /dev/null
@@ -0,0 +1,77 @@
+eps = 0.01;
+infty = 100;
+
+module chamber() {
+       hull() {
+               for (i = [-1, 1]) {
+                       translate([-3, 0, 0.5])
+                               scale([1.25, 1, 1])
+                               cylinder(r1 = 8, r2 = 9, h = 4, $fn = 3);
+                       rotate([0, 35*i, 0]) {
+                               translate([0, 0, 7])
+                               rotate([0, 0, 45])
+                               cylinder(r = 10/2, h = 4, $fn = 4);
+                       }
+               }
+       }
+       for (i = [-1, 1]) {
+                       rotate([0, 35*i, 0])
+                               translate([0, 0, 10])
+                                       cylinder(r = 6.0/2, h = 5, $fn = 6);
+                               intersection() {
+                               rotate([0, 35*i, 0])
+                               translate([0, 0, 15-eps])
+                                       cylinder(r = 8/2, h = 10, $fn = 6);
+                               translate([-30/2, -15/2, eps])
+                                       cube([30, 15, 15]);
+                               }
+               difference() {
+                       translate([-32/2, -16/2, 15])
+                               cube([32, 16, 20]);
+                       
+                       translate([screw_x-12/2, screw_y-12/2,0])
+                               cube([12, 12, infty]);
+               }
+       }
+
+}
+
+screw_x = 5;
+screw_y = 11;
+
+module body() {
+       hull() {
+               // top cube
+               translate([-36/2, -20/2, 15])
+                       cube([36, 20, 5]);
+               // bottom triangle
+               translate([-3, 0, 0])
+                       scale([1.5, 1, 1])
+                       cylinder(r = 11, h = eps, $fn = 3);
+               // screw base
+               translate([screw_x-12/2, screw_y-12/2,17])
+                       cube([12, 12, 3]);
+       }
+}
+
+module light() {
+       difference() {
+               body();
+               chamber();
+               // screw head hole
+               translate([-4+screw_x, screw_y-8/2, 17-infty])
+                       cube([8, infty, infty]);
+               // screw hole
+               translate([screw_x-4, screw_y-4/2, -eps])
+                       cube([8, 4, infty]);
+
+               // cable hole
+               translate([-9-eps, 0, 17])
+                       cube([8, infty, infty]);
+
+               // debug
+               // translate([-infty/2, -infty, -infty/2]) cube(infty);
+       }
+}
+
+light();