]> www.fi.muni.cz Git - things.git/blob - quasar-firewall.scad
switch holder.scad
[things.git] / quasar-firewall.scad
1 eps = 0.01;
2 infty = 100;
3
4 wall = 1.2;
5 base_wall = 5; // before the cut to the angles
6 real_base_wall = 1.5; // after the cut
7
8 angle_horiz = 2; // y axis is horizontal, so this is rotate along x
9 angle_vert = 1;  // x axis is vertical, so this is rotate along y
10
11 center_hole = 8 + 0.3;
12 center_d = 24;
13
14 foam_horiz = 6 + 0.3;
15 side_w = 40;
16
17 wing_clip_w1 = 9;
18 wing_clip_w2 = 8;
19 wing_clip_h = 20;
20 wing_clip_top_off = 5;
21
22 screw_dist = 31.5;
23 screw_d = 2;
24
25 fuse_w = 18;
26 fuse_h = 52;
27 fuse_add = 2;
28 fuse_top = 2;
29
30 module body_solid() {
31         cylinder(r = center_d/2, h = base_wall);
32         // wing front
33         translate([-side_w/2, -foam_horiz/2-wall, 0])
34                 cube([side_w, foam_horiz+2*wall, base_wall]);
35         // wing clips on sides
36         for (x = [-1, 1]) scale([x, 1, 1])
37                 hull() {
38                         // bottom
39                         translate([side_w/2-wing_clip_w1, -foam_horiz/2-wall, 0])
40                                 cube([wing_clip_w1, foam_horiz+2*wall, eps]);
41                         // top
42                         translate([side_w/2-wing_clip_w1+wing_clip_top_off,
43                                 -foam_horiz/2-wall, wing_clip_h])
44                                 cube([wing_clip_w1, foam_horiz+2*wall, eps]);
45                 }
46         // fuse front
47         hull() {
48                 for (x = [-1, 1]) scale([x, 1, 1])
49                         translate([fuse_w/2, 0, 0])
50                         cylinder(r = fuse_add, h = base_wall, $fn = 16);
51                 for (y = [-1, 1]) scale([1, y, 1])
52                         translate([0, fuse_h/2, 0])
53                         cylinder(r = fuse_add, h = base_wall, $fn = 16);
54         }
55         // fuse clips body
56         hull() for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1]) {
57                 translate([fuse_w/2, 0, 0])
58                         cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
59                 translate([0, fuse_h/2, 0])
60                         cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
61         }
62 }
63
64 module body_diff() {
65         difference() {
66                 body_solid();
67                 // center hole
68                 translate([0, 0, -eps])
69                         cylinder(r = center_hole/2, h = base_wall + 2*eps);
70                 // horizontal foam
71                 difference() {
72                         translate([-infty/2, -foam_horiz/2, base_wall])
73                                 cube([infty, foam_horiz, infty]);
74                         // in the center there is only bottom half of the foam
75                         translate([-fuse_w/2, 0, base_wall-eps])
76                                 cube([fuse_w, foam_horiz/2, infty]);
77                 }
78                 // screw holes
79                 for (angle = [0:90:360])
80                         rotate([0, 0, angle])
81                         translate([screw_dist/2, 0, -eps])
82                         cylinder(r = screw_d/2, h = base_wall + 2*eps);
83                 // fuse clips inside
84                 hull() for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1]) {
85                         translate([fuse_w/2 - wall/sin(atan(fuse_h/fuse_w)), 0, base_wall])
86                                 cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
87                         translate([0, fuse_h/2 - wall/sin(atan(fuse_w/fuse_h)), base_wall])
88                                 cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
89                 }
90         }
91 }
92
93 // now rotate it and cut the bottom
94 difference() {
95         rotate([0, angle_horiz, 0])
96         rotate([angle_vert, 0, 0])
97         translate([0, 0, real_base_wall - base_wall])
98                 body_diff();
99         translate([-infty/2, -infty/2, -infty])
100                 cube(infty);
101 }
102