From: Ian Jackson Date: Sun, 19 Dec 2021 23:02:58 +0000 (+0000) Subject: lipo-flat-mount: tidy so it works here X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=002ce0589440c2af7aeb3dfa406571659cb628af;p=reprap-play.git lipo-flat-mount: tidy so it works here Signed-off-by: Ian Jackson --- diff --git a/lipo-flat-mount.scad b/lipo-flat-mount.scad index 98d4baa..7327441 100644 --- a/lipo-flat-mount.scad +++ b/lipo-flat-mount.scad @@ -1,6 +1,7 @@ // -*- C -*- include +include // pimoroni 3000mAh battery = [ 51.5, @@ -32,6 +33,8 @@ battery_nutbox = nutbox_data_M3; // calculated +battery_fix_sz = NutBox_outer_size(battery_nutbox); + battery_nutbox_z = max( battery[2] + battery_wall_top_gap, NutBox_h_base(battery_nutbox) ); battery_keeper_overhang_z = battery[2] + battery_keeper_m_th @@ -54,14 +57,14 @@ module BatteryBase(){ ////toplevel [ -(battery[0]/2 + battery_wall_unsupp), battery[1]/3 ]); } BatteryPlan(); - rectfromto([ fix_sz/2 - 0.5 + rectfromto([ battery_fix_sz/2 - 0.5 + battery_keeper_screw_x_off, -30 ], [ -battery[0], battery_wire_y ]); } } // nutbox - translate([battery_keeper_screw_x_off, -fix_sz/2, battery_nutbox_z]) + translate([battery_keeper_screw_x_off, -battery_fix_sz/2, battery_nutbox_z]) NutBox(battery_nutbox, battery_nutbox_z + 0.1); // overhang for legs at rear @@ -137,9 +140,7 @@ module BatteryKeeper(){ ////toplevel difference(){ translate([0, battery[1] * ((i + 0.5) / battery_keeper_x_n)]) square(center=true, [ battery[0], battery_keeper_x_w ]); - rectfromto([ -battery[1], -20 ], - [ +pi_sz[1] - pi_usb_from_other_side, - pi_usb_over_battery_proportion * battery[1] ]); + children(0); } } } @@ -151,11 +152,11 @@ module BatteryKeeper(){ ////toplevel battery_nutbox_z + battery_keeper_z_gap_nutbox]) linextr(0, battery_keeper_m_th, convexity=4) { difference(){ - rectfromto([ -fix_sz/2, -fix_sz ], - [ +fix_sz/2, + rectfromto([ -battery_fix_sz/2, -battery_fix_sz ], + [ +battery_fix_sz/2, 0.5 * battery[1] / battery_keeper_x_n + 0.5 * battery_keeper_m_w ]); - translate([ 0, -fix_sz/2 ]) + translate([ 0, -battery_fix_sz/2 ]) circle(r = battery_nutbox[0]/2); } } @@ -163,6 +164,6 @@ module BatteryKeeper(){ ////toplevel module BatteryDemo(){ ////toplevel color("grey") BatteryBase(); - BatteryKeeper(); + BatteryKeeper() { union(){ } } }