case.scad: improvements from the second testing print
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 17 Jan 2014 16:45:07 +0000 (17:45 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Fri, 17 Jan 2014 16:45:07 +0000 (17:45 +0100)
case.scad

index cb028f6..e4acfcb 100644 (file)
--- a/case.scad
+++ b/case.scad
@@ -1,15 +1,20 @@
-lowres = 0; // fast rendering or fine printing with print-friendly orientation
+/* TODO
+   - nabeh zaklapavaciho hranolu by mel byt zkoseny
+   - vystup pro kabel leze do vystupu pro snuru pri vetsim wall
+   - diry pro uchyceni jsou mozna prilis male
+*/
+lowres = 1; // fast rendering or fine printing with print-friendly orientation
 
 eps = 0.01;
 infty = 300;
 
-wall = 1.5; // generic wall thickness
+wall = 2.0; // generic wall thickness
 
 // 18650 is ~18mm diameter, ~65mm length, 
 batt_diam = 18 + 0.6;
 batt_len = 65 + 1.5;
 
-cable_sep = 1;
+cable_sep = 2;
 
 // front flat area
 front_flat_len = batt_len + 4*wall + 2*cable_sep;
@@ -30,7 +35,7 @@ cable_out_diam = 5.2;
 
 batt_end_h = wire_sep/2 + wire_thick/2 + 1.5;;
 
-lid_sep = 0.5; // the lid is made this much smaller to separate from the body
+lid_sep = 0.1; // the lid is made this much smaller to separate from the body
 
 sw_diam = 2.5 + 0.5;
 led_diam = 3 + 0.5;
@@ -157,15 +162,15 @@ module case() {
                        translate([0, batt_diam/2 - pcb_width,
                                -batt_diam/2-pcb_comp_h-pcb_thick])
                                cube([wall + cable_sep + eps, pcb_width, eps]);
-                       translate([cable_sep, batt_diam/2 - pcb_width + 1.5*wall,
+                       translate([cable_sep, batt_diam/2 - pcb_width + wall,
                                -batt_diam/2-pcb_comp_h-pcb_thick-wall])
                                cube([wall + eps, pcb_width-2*wall, eps]);
                };
                // cable lead to battery contacts
                for (x=[1, -1]) scale([x, 1, 1])
                        rotate([-140, 0, 0])
-                       translate([batt_len/2+wire_thick/2, 0, batt_diam/2-2*wall])
-                               cylinder(r=wire_thick/2, h = 5);
+                       translate([batt_len/2+wire_thick/2, 0, batt_diam/2-2.7])
+                               cylinder(r=wire_thick/2, h = 5.4);
                
                // mounting holes
                for(x=[-1,1]) scale([x, 1, 1])
@@ -179,7 +184,7 @@ module case() {
        };
        // clip barrier
        for (x = [-1, 1]) scale([x, 1, 1])
-               translate([batt_len/2+wall-eps, batt_diam/2-pcb_width+wall+lid_sep,
+               translate([batt_len/2+wall-eps, batt_diam/2-pcb_width+wall/2+lid_sep,
                        -batt_diam/2-pcb_thick-pcb_comp_h + wall + lid_sep])
                        cube([cable_sep+eps, pcb_width-2*wall-2*lid_sep, wall]);
 };
@@ -204,6 +209,12 @@ module lid_body() {
                        translate([cable_sep+wall/2, batt_diam/2 - pcb_width + 1.5*wall +lid_sep,
                                batt_diam/2+pcb_comp_h+pcb_thick+wall/2-lid_sep])
                                cube([wall/2-lid_sep, pcb_width-2*wall-2*lid_sep, eps]);
+                       // rear cone
+                       translate([cable_sep+wall-lid_sep, 0, -batt_diam/2-wall]) difference() {
+                               scale([0.5, 1, 1])
+                               cylinder(r = batt_diam/2 - lid_sep,  h = eps);
+                               translate([-infty, -infty/2, -infty/2]) cube(infty);
+                       };
                };
 };