]> www.fi.muni.cz Git - things.git/blob - diffuser-adjustable.scad
Merge branch 'master' of ssh://anxur.fi.muni.cz/home/kas/public_html/git/things
[things.git] / diffuser-adjustable.scad
1 // A simple adjustable diffuser for the LED flashlights.
2 //
3 // Designed by Jan "Yenya" Kasprzak <kas at yenya.net>.
4 // Distributable under the terms of the Artistic License.
5 //
6 // Tested with ZHISHUNJIA ZSJ-T29 LED flashlight (dx.com SKU #317226).
7 // NOTE: I can't really recommend this particular flashlight, it is
8 // well below the specs (600/300/150 mA instead of stated 2.4 A).
9 //
10 // For any other flashlight, adjust the parameters below:
11
12 // the true _diameter_ of the flashlight + some space around
13 ring_d = 34.3 + 1.0;
14
15 // the diaphragm thickness, set so that it is printed with two print layers
16 diaphragm = 0.5;
17
18 // outer wall thickness - preferably the integer multiple
19 // of the print trace width
20 wall = 1.5;
21
22 // height of the center of clip beams + some space below + diaphragm thickness
23 clip_h = 7.3 + 0.5 + diaphragm;
24
25 // the clips protrude this much to the inner cylindrical hole
26 // the bigger value means more stiff fit
27 clip_w = 1.2;
28
29 clip_angle = 120; // at least 90 degrees; bigger is easier to put on and off,
30         // smaller is more stiff, but harder to remove
31
32 n_clips = 3; // number of clips; odd numbers prefered
33
34 // the height of the clip is computed so that there is wall/2-wide flat
35 // on top of the clip
36 clip_top = clip_h + (clip_w+wall/2)*tan(clip_angle/2);
37
38 // the overall height:
39 // ring_h = clip_top; // cylindrical shape without the clips protruding on the top
40 ring_h = clip_h + wall; // clips protruding on the top
41
42 infty = 100;
43 eps = 0.01;
44
45 module diffuser() {
46         difference() {
47                 // outer cylinder
48                 cylinder(r = ring_d/2 + wall, h = ring_h);
49                 // inner cylinder hole + diaphragm
50                 translate([0, 0, diaphragm])
51                         cylinder(r = ring_d/2, h = ring_h);
52                 translate([0, 0, ring_h + eps - wall])
53                         cylinder(r1 = ring_d/2, r2 = ring_d/2 + wall/2, h = wall);
54         }
55         // clip beams
56         for (angle = [0:360/n_clips:360-eps]) intersection() {
57                 rotate([0,0,angle])
58                         translate([ring_d/2-clip_w, -infty/2, clip_h]) {
59                                 rotate([0, 90-clip_angle/2, 0])
60                                         cube(infty);
61                                 rotate([0, clip_angle/2, 0])
62                                         cube(infty);
63                         }
64                 cylinder(r = ring_d/2 + wall, h = clip_top);
65         }
66 }
67
68 diffuser();
69