case.scad: alternative lid clips
[heater.git] / case.scad
index 43583c4..653a79a 100644 (file)
--- a/case.scad
+++ b/case.scad
@@ -53,7 +53,9 @@ clip_pretension = 0.5;
 plus_width = 4.5; // width of the + sign
 
 batt_contact_w = 12;
-clip_cyl_r = 1;
+batt_contact_h = 14;
+batt_contact_h_lid = batt_contact_h-2;
+clip_cyl_r = 0.7;
 batt_end_h = body_top_h - 4*clip_cyl_r;;
 
 
@@ -70,9 +72,9 @@ module case_body() {
                        translate([-infty/2, -infty/2, eps]) cube(infty);
                };
                translate([-front_flat_len/2,
-                       batt_diam/2 - pcb_width,
+                       batt_diam/2 - pcb_width-0.5*wall,
                        -batt_diam/2-pcb_comp_h-pcb_comp_h2-pcb_thick-wall])
-                       cube([front_flat_len, pcb_width+wall, eps]);
+                       cube([front_flat_len, pcb_width+1.5*wall, eps]);
        };
        // mounting cylinders
        for (x = [-1, 1]) translate([x*(batt_len/2-mounthole_w/2),
@@ -102,20 +104,21 @@ module case() {
                // upper cube-shaped part
                // rotate([20, 0, 0])
                translate([-batt_len/2, -batt_diam/2, 0])
-                       cube([batt_len, batt_diam, batt_diam]);
+                       cube([batt_len, batt_diam, batt_end_h+eps]);
                // upper longer cube-shaped part
                difference() {
                        translate([-batt_len/2-cable_sep-wall, -batt_diam/2, batt_end_h])
                                cube([batt_len+2*cable_sep+2*wall, batt_diam, batt_diam]);
-                       for (x = [-1,1]) scale([x, 1, 1])
-                               translate([batt_len/2 + wall + cable_sep, -infty/2, batt_end_h + 3*clip_cyl_r])
-                               rotate([-90, 0, 0])
-                               cylinder(r = clip_cyl_r, h = infty, $fn=4);
+                       // clips
+                       for (x = [-1,1]) scale([1, x, 1])
+                               translate([batt_len/6, batt_diam/2, batt_end_h + 3*clip_cyl_r])
+                               rotate([0, -90, 0])
+                               cylinder(r = clip_cyl_r, h = batt_len/3, $fn=4);
                }
                // grabbing holes
                for (x=[-1,1]) scale([x,1,1])
                translate([batt_len/2 + 2*wall + cable_sep+10-wall, 0, 0])
-                       cylinder(r1 = 7, r2 = 10-wall/4, h = body_top_h + eps);
+                       cylinder(r1 = 7, r2 = 10, h = body_top_h + eps);
                // battery cylinder for the lower part
                translate([-batt_len/2, 0, 0])
                        rotate([0, 90, 0])
@@ -180,12 +183,12 @@ module case() {
                // holes in front of battery contacts
                for(x=[-1,1]) scale([x, 1, 1])
                translate([batt_len/2-eps, wall/2-batt_contact_w/2,
-                       wall/2-batt_contact_w/2])
+                       wall/2-batt_contact_h/2])
                        cube([wall+2*eps, batt_contact_w-wall, infty]);
                // holes for battery contacts
                for(x=[-1,1]) scale([x, 1, 1])
                translate([batt_len/2+wall-eps, -batt_contact_w/2,
-                       -batt_contact_w/2])
+                       -batt_contact_h/2])
                        cube([cable_sep+2*eps, batt_contact_w, infty]);
                // internal plus sign - vertical line
                translate([-batt_len/2 + 0.5*wall+plus_width/2, -plus_width/2, -batt_diam/2-wall])
@@ -219,10 +222,11 @@ module lid_body() {
        translate([-batt_len/2 - wall - cable_sep + lid_sep, -batt_diam/2+lid_sep, -batt_diam/2 -wall])
                cube([batt_len + 2*wall + 2*cable_sep - 2*lid_sep, batt_diam-2*lid_sep, batt_diam/2 - batt_end_h + wall - lid_sep]);
        // clips
-       for (x = [-1, 1]) scale([x, 1, 1])
-       translate([batt_len/2 + wall + cable_sep - lid_sep, batt_diam/2 - lid_sep, -batt_end_h-lid_sep-clip_cyl_r])
-               rotate([90, 0, 0])
-               cylinder(r = clip_cyl_r, h = batt_diam-2*lid_sep, $fn = 4);
+       for (x = [-1, 1]) scale([1, x, 1])
+               translate([batt_len/6, batt_diam/2-lid_sep, - batt_end_h - clip_cyl_r - lid_sep])
+               rotate([0, -90, 0])
+               cylinder(r = clip_cyl_r, h = batt_len/3, $fn=4);
+       // translate([batt_len/2 + wall + cable_sep - lid_sep, batt_diam/2 - lid_sep, -batt_end_h-lid_sep-clip_cyl_r])
 }
 
 module lid() {
@@ -230,6 +234,11 @@ module lid() {
                lid_body();
                translate([-batt_len/2-lid_sep, 0, 0]) rotate([0, 90, 0])
                        cylinder(r=batt_diam/2 + lid_sep, h=batt_len+2*lid_sep);
+               // holes for battery contacts
+               for(x=[-1,1]) scale([x, 1, 1])
+               translate([batt_len/2+wall-eps, -batt_contact_w/2,
+                       -batt_contact_h_lid/2])
+                       cube([cable_sep+2*eps, batt_contact_w, infty]);
        };
 };