+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) {