]> www.fi.muni.cz Git - things.git/blob - firefly-q6-case.scad
pulley.scad: new mods
[things.git] / firefly-q6-case.scad
1 infty = 200;
2 eps = 0.01;
3
4 wall = 1.5;
5
6 body_l = 70 + 0.5;
7 body_w = 33 + 0.5;
8 body_h = 28 + 0.5;
9 corner_r = 8;
10 corner_side_h = 5;
11
12 hook_w = 3.5;
13 hook_l = 6;
14 hook_hole_l = 3;
15 hook_hole_w = 2;
16
17 ziptie_w = 4;
18 ziptie_h = 3;
19
20 // base plate
21 difference() {
22         hull() {
23                 for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
24                         translate([body_l/2 - corner_r,
25                                 body_w/2 - corner_r, 0])
26                         cylinder(r = corner_r + wall, h = wall);
27         }
28         // translate([-body_l/2+corner_r + hook_l, -body_w/2+corner_r, -eps])
29         //      cube([body_l-2*corner_r-2*hook_l, body_w - 2*corner_r, wall +2*eps]);
30         translate([-body_l/2+corner_r, -body_w/2+corner_r, -eps])
31                 cube([body_l-2*corner_r, body_w - 2*corner_r, wall +2*eps]);
32
33         // ziptie angles
34         for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
35                 translate([body_l/2-corner_r-hook_l-ziptie_w,
36                         body_w/2+wall/2-corner_r/2, wall])
37                         rotate([-40, 0, 0])
38                         translate([0, -ziptie_h/2, -infty/2])
39                         cube([ziptie_w, ziptie_h, infty]);
40                 
41         // more space for lens
42         for (x = [-1, 1]) scale([x, 1, 1])
43                 translate([body_l/2, -body_w/2+corner_r, -eps])
44                         cube([wall+eps, body_w-2*corner_r, wall+2*eps]);
45 }
46
47 // raised corner bottom
48 for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
49         translate([body_l/2 - corner_r,
50                 body_w/2 - corner_r, wall-eps])
51         difference() {
52                 cylinder(r = corner_r + wall, h = wall+eps);
53                 translate([-infty, -infty/2, -infty/2]) cube(infty);
54                 translate([-infty/2, -infty, -infty/2]) cube(infty);
55         }
56
57
58 // raised corner side
59 for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
60         translate([body_l/2 - corner_r,
61                 body_w/2 - corner_r, 2*wall-eps])
62         difference() {
63                 cylinder(r = corner_r + wall, h = corner_side_h+eps);
64                 translate([0, 0,-eps])
65                         cylinder(r = corner_r, h = infty);
66                 translate([-infty, -infty/2, -infty/2]) cube(infty);
67                 // front edges cut
68                 rotate([-30, 0, 0])
69                 translate([-infty/2, -infty, -infty/2]) cube(infty);
70         }
71
72 // rubber band hooks
73 for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
74         difference() {
75                 translate([body_l/2 - corner_r - hook_l,
76                         body_w/2 - corner_r, 0])
77                         cube([hook_l, hook_w + corner_r + wall, 2*wall]);
78                 translate([body_l/2 - corner_r - hook_hole_l,
79                         body_w/2 + wall, -eps])
80                         cube([hook_hole_l + eps, hook_hole_w, 2*wall+2*eps]);
81         }