]> www.fi.muni.cz Git - things.git/blobdiff - quasar-firewall.scad
switch holder.scad
[things.git] / quasar-firewall.scad
index 8df1d77a15e4134ae5c7d8db02268cc7ada7ab75..83a68bf458823e681fc9212a7adf854a09e2eef7 100644 (file)
 eps = 0.01;
 infty = 100;
 
-base_d = 28;
-screw_d1 = 19;
-screw_d2 = 16;
-screw_hole = 3.5;
-base_wall = 1.5;
-wall = base_wall;
+wall = 1.2;
+base_wall = 5; // before the cut to the angles
+real_base_wall = 1.5; // after the cut
 
-center_d = 8 + 0.3;
+angle_horiz = 2; // y axis is horizontal, so this is rotate along x
+angle_vert = 1;  // x axis is vertical, so this is rotate along y
 
-cable_slot_w = 5;
-cable_slot_h = 3;
+center_hole = 8 + 0.3;
+center_d = 24;
 
-foam_horiz = 6 + 0.6;
-foam_vert = 6 + 0.6;
-support_h = 50;
-
-top_d = foam_horiz + 8;
+foam_horiz = 6 + 0.3;
 side_w = 40;
 
-module body() {
-       // base
-       cylinder(r = base_d/2, h = base_wall);
-       intersection() {
-               cylinder(r1 = side_w/2, r2 = top_d/2,
-                        h = support_h + base_wall);
-               union() {
-                       translate([-side_w/2, -foam_horiz/2-wall, 0])
-                               cube([side_w, foam_horiz + 2*wall, support_h]);
-                       translate([-foam_vert/2-wall, -side_w/2, 0])
-                               cube([foam_vert + 2*wall, side_w, support_h]);
+wing_clip_w1 = 9;
+wing_clip_w2 = 8;
+wing_clip_h = 20;
+wing_clip_top_off = 5;
+
+screw_dist = 31.5;
+screw_d = 2;
+
+fuse_w = 18;
+fuse_h = 52;
+fuse_add = 2;
+fuse_top = 2;
+
+module body_solid() {
+       cylinder(r = center_d/2, h = base_wall);
+       // wing front
+       translate([-side_w/2, -foam_horiz/2-wall, 0])
+               cube([side_w, foam_horiz+2*wall, base_wall]);
+       // wing clips on sides
+       for (x = [-1, 1]) scale([x, 1, 1])
+               hull() {
+                       // bottom
+                       translate([side_w/2-wing_clip_w1, -foam_horiz/2-wall, 0])
+                               cube([wing_clip_w1, foam_horiz+2*wall, eps]);
+                       // top
+                       translate([side_w/2-wing_clip_w1+wing_clip_top_off,
+                               -foam_horiz/2-wall, wing_clip_h])
+                               cube([wing_clip_w1, foam_horiz+2*wall, eps]);
                }
+       // fuse front
+       hull() {
+               for (x = [-1, 1]) scale([x, 1, 1])
+                       translate([fuse_w/2, 0, 0])
+                       cylinder(r = fuse_add, h = base_wall, $fn = 16);
+               for (y = [-1, 1]) scale([1, y, 1])
+                       translate([0, fuse_h/2, 0])
+                       cylinder(r = fuse_add, h = base_wall, $fn = 16);
+       }
+       // fuse clips body
+       hull() for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1]) {
+               translate([fuse_w/2, 0, 0])
+                       cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
+               translate([0, fuse_h/2, 0])
+                       cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
        }
 }
 
-module screw_hole() {
-       translate([0, 0, -eps])
-               cylinder(r = screw_hole/2, h = base_wall + 2*eps, $fn = 6);
-       translate([0, 0, base_wall/2])
-               cylinder(r1 = screw_hole/2,
-                       r2 = screw_hole/2 + base_wall/2,
-                       h = base_wall/2+eps, $fn = 6);
-       translate([0, 0, base_wall-eps])
-               cylinder(r = screw_hole/2 + base_wall/2, h = 2*base_wall + eps, $fn = 6);
+module body_diff() {
+       difference() {
+               body_solid();
+               // center hole
+               translate([0, 0, -eps])
+                       cylinder(r = center_hole/2, h = base_wall + 2*eps);
+               // horizontal foam
+               difference() {
+                       translate([-infty/2, -foam_horiz/2, base_wall])
+                               cube([infty, foam_horiz, infty]);
+                       // in the center there is only bottom half of the foam
+                       translate([-fuse_w/2, 0, base_wall-eps])
+                               cube([fuse_w, foam_horiz/2, infty]);
+               }
+               // screw holes
+               for (angle = [0:90:360])
+                       rotate([0, 0, angle])
+                       translate([screw_dist/2, 0, -eps])
+                       cylinder(r = screw_d/2, h = base_wall + 2*eps);
+               // fuse clips inside
+               hull() for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1]) {
+                       translate([fuse_w/2 - wall/sin(atan(fuse_h/fuse_w)), 0, base_wall])
+                               cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
+                       translate([0, fuse_h/2 - wall/sin(atan(fuse_w/fuse_h)), base_wall])
+                               cylinder(r = eps, h = base_wall + fuse_top, $fn = 4);
+               }
+       }
 }
 
+// now rotate it and cut the bottom
 difference() {
-       body();
-       // screw holes
-       rotate([0, 0, 45]) {
-       for (x = [-1, 1]) translate([x*screw_d1/2, 0, 0])
-               screw_hole();
-       for (y = [-1, 1]) translate([0, y*screw_d2/2, 0])
-               screw_hole();
-       }
-       // tube hole
-       translate([0, 0, -eps])
-               cylinder(r = center_d/2, h = base_wall + 2*eps);
-       // cable slot
-       /*
-       rotate([0, 0, 45])
-       translate([-cable_slot_w/2, base_d/2-cable_slot_h, -eps])
-               cube([cable_slot_w, 2*cable_slot_h, infty]);
-       */
-       // horizontal foam
-       translate([-side_w/2-eps, -foam_horiz/2, base_wall])
-               cube([side_w + 2*eps, foam_horiz, support_h + eps]);
-       // vertical foam
-       translate([-foam_vert/2, -side_w/2-eps, base_wall])
-               cube([foam_vert, side_w + 2*eps, support_h + eps]);
+       rotate([0, angle_horiz, 0])
+       rotate([angle_vert, 0, 0])
+       translate([0, 0, real_base_wall - base_wall])
+               body_diff();
+       translate([-infty/2, -infty/2, -infty])
+               cube(infty);
 }