case.scad: different approach to rear mounting holes
[heater.git] / case.scad
index b1e5a3f..cb028f6 100644 (file)
--- a/case.scad
+++ b/case.scad
@@ -1,4 +1,4 @@
-lowres = 0;
+lowres = 0; // fast rendering or fine printing with print-friendly orientation
 
 eps = 0.01;
 infty = 300;
@@ -40,6 +40,9 @@ pcb_xoff = 90 * 25.4/1000; // offset of the LED from the middle of the PCB
 prg_len = 10; // programming connector
 prg_width = 7;
 
+rear_clip_hole_dist = 10; // distance between the holes in the rear clip
+rear_clip_aspect = 0.35; // w/h aspect ratio of the ellipse of the rear clip
+
 module case_body() {
        hull() {
                translate([-batt_len/2-2*wall-cable_sep, -batt_diam/2-wall, 0])
@@ -57,6 +60,12 @@ module case_body() {
                        -batt_diam/2-2*pcb_comp_h-pcb_thick-wall])
                        cube([front_flat_len, pcb_width+wall, eps]);
        };
+       for (x = [-1, 1]) scale([x, 1, 1]) hull() {
+               for (x0 = [0-wall, 10+wall])
+                       translate([batt_len/2-wall-wire_thick-x0, batt_diam/2, 0])
+                               rotate([-90, 0, 0]) scale([rear_clip_aspect, 1, 1])
+                               cylinder(r=batt_diam/2 + 2*wall + wire_thick, h=wall);
+               };
 };
 
 module case() {
@@ -164,7 +173,7 @@ module case() {
                        vert_torus();
                        
                for (x = [-1, 1]) scale([x, 1, 1]) for (x0 = [0, 10])
-                       translate([batt_len/2-wall-wire_thick-x0, 0, batt_end_h-wire_thick/2])
+                       translate([batt_len/2-wall-wire_thick-x0, 0, batt_diam/2+wire_thick/2+wall])
                        rotate([-90, 0, 0])
                        scale([2,1,1]) cylinder (r=wire_thick/2, h=infty, $fn=16);
        };
@@ -213,6 +222,13 @@ module lid() {
                        translate([-batt_len/2-cable_sep-wall, batt_diam/2-pcb_width+0.5*wall+0.5*lid_sep, batt_diam/2 + pcb_comp_h+pcb_thick-wall-lid_sep])
                        cube([batt_len + 2*wall + 2* cable_sep, pcb_width-1.5*wall-1.5*lid_sep, eps]);
                };
+               // holes for the mounting clips on the body
+               for (x = [-1, 1]) scale([x, 1, 1]) hull() {
+               for (x0 = [0-wall, 10+wall])
+                       translate([batt_len/2-wall-wire_thick-x0, batt_diam/2-lid_sep+eps, 0])
+                               rotate([-90, 0, 0]) scale([rear_clip_aspect, 1, 1])
+                               cylinder(r=batt_diam/2 + 2*wall + wire_thick+lid_sep/rear_clip_aspect, h=wall+lid_sep+eps);
+               };
        };
 };