]> www.fi.muni.cz Git - things.git/blob - dual-led-strips-holder.scad
switch holder.scad
[things.git] / dual-led-strips-holder.scad
1 infty = 1000;
2 eps = 0.01;
3
4 wall = 1.5;
5
6 // distance between the centers of both strips
7 strip_dist = 25;
8
9 body_h = 6;
10
11 al_bar_w = 15 + 0.5;
12 al_bar_h = 2.0 + 0.2;
13
14 led_strip_w = 10 + 1.0;
15 led_strip_h = 2 * 2.5;
16
17 screw_hole = 3.7;
18 screw_l = 2;
19
20 module body() {
21         cube([strip_dist/2 + al_bar_w/2 + wall, al_bar_h + wall, body_h]);
22         translate([strip_dist/2, al_bar_h, 0])
23                 scale([1, (led_strip_h/2 + wall)/(led_strip_w/2 + wall), 1])
24                 cylinder(r = led_strip_w/2 + wall, h = body_h);
25         
26 }
27
28 for (x = [-1, 1]) scale([x, 1, 1])
29 difference() {
30         body();
31         // aluminium bars
32         translate([strip_dist/2-al_bar_w/2, -eps, -eps])
33                 cube([al_bar_w, al_bar_h + eps, body_h + 2*eps]);
34
35         // LED strip
36         translate([strip_dist/2, al_bar_h, -eps])
37                 scale([1, led_strip_h/led_strip_w, 1])
38                 cylinder(r = led_strip_w/2, h = body_h + 2*eps);
39
40         // rear half of the cylinder
41         translate([strip_dist/2-led_strip_w/2 - wall - eps, -led_strip_h-wall, -eps])
42                 cube([led_strip_w + 2*wall + 2*eps, led_strip_h +wall + 2*eps, body_h + 2*eps]);
43
44         // screw hole
45         translate([0, 0, body_h/2]) rotate([-90, 0, 0]) {
46                 translate([screw_l/2, 0, -infty/2])
47                         cylinder(r = screw_hole/2, h = infty, $fn = 6);
48                 translate([0, 0, -infty/2])
49                         cylinder(r = screw_hole/2, h = infty, $fn = 6);
50         }
51 }