]> www.fi.muni.cz Git - things.git/blob - led-strip-holder.scad
switch holder.scad
[things.git] / led-strip-holder.scad
1 eps = 0.01;
2 infty = 50;
3
4 bar_w = 15 + 1.0;
5 bar_h = 2 + 1.0;
6
7 cable_w = 7;
8 cable_h = 4;
9
10 screw_d = 4;
11 screw_head = 8;
12
13 strip_angle =30;
14
15 wall = 1.5;
16
17 holder_w = 15;
18
19 difference() {
20         hull($fn =32) {
21                 translate([wall + bar_h/2, wall + bar_h/2 + (bar_w-bar_h)*sin(strip_angle) +screw_head/2, 0]) {
22                         cylinder(r = bar_h/2 + wall, h = holder_w);
23                         rotate([0, 0, -strip_angle]) translate([bar_w-bar_h, 0, 0])
24                                 cylinder(r = bar_h/2 + wall, h = holder_w);
25                 }
26                 translate([0, -wall -screw_head/2, 0]) {
27                         cube([wall, screw_head + 2*wall, holder_w]);
28                 }
29         }
30         // bar itself
31         hull($fn =32) {
32                 translate([wall + bar_h/2, wall + bar_h/2 + (bar_w-bar_h)*sin(strip_angle) +screw_head/2, -eps]) {
33                         cylinder(r = bar_h/2, h = holder_w+2*eps);
34                         rotate([0, 0, -strip_angle]) translate([bar_w-bar_h, 0, 0])
35                                 cylinder(r = bar_h/2, h = holder_w+2*eps);
36                 }
37         }
38         // above the bar
39         translate([0, wall + bar_h/2 + (bar_w-bar_h)*sin(strip_angle) + screw_head/2, 0])
40                 rotate([0, 0, -strip_angle]) translate([wall + bar_h/2, bar_h/2 -eps, -eps])
41                         cube([bar_w - bar_h, infty, holder_w + 2*eps]);
42
43         // screw hole
44         translate([-eps, 0, holder_w/2]) rotate([0, 90, 0]) {
45                 rotate([0, 0, 90]) {
46                         cylinder(r = screw_d/2, h = infty, $fn = 6);
47                         translate([0, 0, wall])
48                                 cylinder(r = screw_head/2, h = infty, $fn = 6);
49                 }
50         }
51         // cable hole
52         translate([0, screw_head/2+cable_h/2+wall+(bar_w-bar_h)*sin(strip_angle)+eps, 0])
53         rotate([0, 0, -strip_angle])
54         translate([wall + bar_w/2 - cable_w/2 + cable_h/2, -cable_h/2, -eps])
55         hull() {
56                 cylinder(r = cable_h/2, h = holder_w + 2*eps);
57                 translate([cable_w - cable_h, 0, 0])
58                         cylinder(r = cable_h/2, h = holder_w + 2*eps);
59         }
60 }