]> www.fi.muni.cz Git - things.git/blobdiff - firefly-q6-case.scad
switch holder.scad
[things.git] / firefly-q6-case.scad
index 47b9a43097b7c8dad46aedbac28603aed6cc2239..88ba81f8fc737eceacdb4c2172f36865868c76d8 100644 (file)
@@ -1,22 +1,94 @@
 infty = 200;
 eps = 0.01;
 
-wall = 1.5;
+wall = 1;
 
-body_l = 70 + 0.5;
-body_w = 33 + 0.5;
-body_h = 28 + 0.5;
+body_l = 70 + 0.7;
+body_w = 33 + 0.7;
+body_h = 28 + 0.7;
 corner_r = 8;
-corner_side_h = 5;
+corner_side_h = 12;
 
-hook_w = 3.5;
-hook_l = 6;
-hook_hole_l = 3;
-hook_hole_w = 2;
+hook_w = 4;
+hook_l = 6.5;
+hook_hole_l = 4;
+hook_hole_w = 2.5;
+hook_h = 3;
 
-ziptie_w = 4;
-ziptie_h = 3;
+hook_center_hole = 15;
 
+bottom_hole_l = body_l - 2*corner_r - 2*hook_l;
+bottom_hole_w = body_w - 4*wall;
+
+side_hole_l1 = body_l - 4*corner_r;
+side_hole_l2 = body_l - corner_r;
+side_hole_bot = 2*wall;
+
+lens_d = 23;
+lens_hole_l = 4;
+lens_zoff = 8;
+
+
+difference() {
+       // outer body
+       hull() {
+               for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
+                       translate([body_l/2 - corner_r,
+                               body_w/2 - corner_r, 0])
+                       cylinder(r = corner_r + wall, h = corner_side_h + wall);
+       }
+       // hole for the camera body
+       hull() {
+               for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
+                       translate([body_l/2 - corner_r,
+                               body_w/2 - corner_r, wall])
+                       cylinder(r = corner_r, h = body_h);
+       }
+       // hole in the bottom
+       translate([-bottom_hole_l/2, -bottom_hole_w/2, -eps])
+               cube([bottom_hole_l, bottom_hole_w, body_h]);
+       // side hole
+       hull() {
+               translate([-side_hole_l1/2, -body_w/2-wall-eps, side_hole_bot+wall])
+                       cube([side_hole_l1, body_w+2*wall+2*eps, wall]);
+               translate([-side_hole_l2/2, -body_w/2-wall-eps, corner_side_h+wall])
+                       cube([side_hole_l2, body_w+2*wall+2*eps, wall]);
+       }
+       // lens holes
+       for (x = [-1, 1]) scale([x, 1, 1]) {
+               translate([body_l/2-lens_hole_l, 0, lens_zoff + wall])
+                       rotate([0, 90, 0])
+                       cylinder(r = lens_d/2, h = lens_hole_l + wall + eps);
+               translate([body_l/2-lens_hole_l, -lens_d/2, lens_zoff + wall])
+                       cube([lens_hole_l + wall + eps, lens_d, lens_d/2]);
+       }
+}
+
+// rubber band side hooks
+for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
+       difference() {
+               translate([body_l/2 - corner_r - hook_l,
+                       body_w/2, 0])
+                       cube([hook_l, hook_w + wall, hook_h]);
+               translate([body_l/2 - corner_r - hook_hole_l,
+                       body_w/2 + wall, -eps])
+                       cube([hook_hole_l + eps, hook_hole_w, hook_h+2*eps]);
+       }
+
+// center hooks
+for (y = [-1, 1]) scale([1, y, 1])
+       difference() {
+               translate([-hook_center_hole/2-hook_l, body_w/2, 0])
+                       cube([2*hook_l+hook_center_hole, hook_w + wall, hook_h]);
+               translate([-hook_center_hole/2, body_w/2 + wall, -eps])
+                       cube([hook_center_hole, hook_hole_w, hook_h+2*eps]);
+               for (x = [-1, 1]) scale([x, 1, 1])
+                       translate([hook_center_hole/2+hook_l - hook_hole_l,
+                               body_w/2 + wall, -eps])
+                               cube([hook_hole_l + eps, hook_hole_w, hook_h+2*eps]);
+       }
+
+if (0) {
 // base plate
 difference() {
        hull() {
@@ -30,14 +102,6 @@ difference() {
        translate([-body_l/2+corner_r, -body_w/2+corner_r, -eps])
                cube([body_l-2*corner_r, body_w - 2*corner_r, wall +2*eps]);
 
-       // ziptie angles
-       for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
-               translate([body_l/2-corner_r-hook_l-ziptie_w,
-                       body_w/2+wall/2-corner_r/2, wall])
-                       rotate([-40, 0, 0])
-                       translate([0, -ziptie_h/2, -infty/2])
-                       cube([ziptie_w, ziptie_h, infty]);
-               
        // more space for lens
        for (x = [-1, 1]) scale([x, 1, 1])
                translate([body_l/2, -body_w/2+corner_r, -eps])
@@ -68,14 +132,5 @@ for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
                rotate([-30, 0, 0])
                translate([-infty/2, -infty, -infty/2]) cube(infty);
        }
+}
 
-// rubber band hooks
-for (x = [-1, 1]) for (y = [-1, 1]) scale([x, y, 1])
-       difference() {
-               translate([body_l/2 - corner_r - hook_l,
-                       body_w/2 - corner_r, 0])
-                       cube([hook_l, hook_w + corner_r + wall, 2*wall]);
-               translate([body_l/2 - corner_r - hook_hole_l,
-                       body_w/2 + wall, -eps])
-                       cube([hook_hole_l + eps, hook_hole_w, 2*wall+2*eps]);
-       }