X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=fairphone-battery-case.scad;h=557271d3e98d329d9982c19b574658fe7599ada0;hb=6a319b7ceeca0d02fbeac92c0737e976919d87a1;hp=921e1a59a9accca8e1a26a742472617447d29045;hpb=40357144ba6be92f304aefd95aa80fa0cd74efeb;p=reprap-play.git diff --git a/fairphone-battery-case.scad b/fairphone-battery-case.scad index 921e1a5..557271d 100644 --- a/fairphone-battery-case.scad +++ b/fairphone-battery-case.scad @@ -1,9 +1,11 @@ // -*- C -*- +include + mainwall_th = 3.0; smallwall_th = 2.0; -seal_th = 0.3 + 0.6 + 0.6; // total gap for seal etc. +seal_th = 0.3 + 0.6 + 0.6 - 0.4 - 0.4 + 0.2; // total gap for seal etc. behind_recess = 1.5; recess_gap_end = 0.4; @@ -18,6 +20,14 @@ battery_base_indent = 0.94 + 0.50; battery_base_indent_fromside_outside = 4; battery_base_indent_fromside_inside = 10; +handle_height = 3.5; +handle_inward = 10; +handle_len = 5; + +pushhole_ell_sz = 4.75; +pushhole_ell_th = 1.75; +pushhole_circle_dia = 4.0; + // for testing: //battery_len = 3; //battery_wdth = 15; @@ -34,9 +44,15 @@ bpp3 = [ bpp2[0] + (bpp1 - bpp0)[1], bpp0[1] ]; bpp4 = [ bpp3[0], bpp0[1] + mainwall_th ]; lppC = bpp3 + [ 0, -recess_gap_end ]; +lppF = lppC + [ handle_height, 0 ]; + s0 = battery_wdth/2; +s0i = s0 - battery_th/2; s1 = s0 + smallwall_th; +l1 = s1 - handle_inward; +l0 = l1 - handle_len; + echo( bpp0, bpp1, @@ -95,11 +111,16 @@ module LidHalfPlan(){ ]); } +module HandleHalfPlan(){ + translate(lppE) + square(lppF - lppE); +} + module ExtrudePlan(from,to){ rotate([0,-90,0]) for (mj=[0,1]) { mirror([0,0,mj]) translate([0,0,from]){ - linear_extrude(height= to-from){ + linear_extrude(height= to-from, convexity=5){ for (mi=[0,1]) { mirror([0,mi]) translate([0, battery_th/2]) @@ -110,6 +131,17 @@ module ExtrudePlan(from,to){ } } +module PushHolePlan(){ ////toplevel + translate(-(pushhole_ell_th * 0.10 + + pushhole_ell_sz * 0.10) * [1,1]) { + for (r=[0,90]) + rotate(r) + translate(-pushhole_ell_th * 0.5 * [1,1]) + square([ pushhole_ell_sz, pushhole_ell_th ]); + } + circle(pushhole_circle_dia/2, $fn=40); +} + module PlanDemo(){ ////toplevel color("blue") BaseHalfPlan(); color("red") LidHalfPlan(); @@ -117,11 +149,22 @@ module PlanDemo(){ ////toplevel } module Base(){ ////toplevel - ExtrudePlan(0,s1) BaseHalfPlan(); - ExtrudePlan(s0,s1) SideHalfPlan(); - ExtrudePlan(s0 - battery_base_indent_fromside_inside, - s0 - battery_base_indent_fromside_outside - ) BaseHalfPlan(indent = battery_base_indent); + difference(){ + ExtrudePlan(0,s1) BaseHalfPlan(); + linextr(-(10+battery_len), battery_len+10, convexity=5) PushHolePlan(); + } + difference(){ + union(){ + ExtrudePlan(s0i, s1) SideHalfPlan(); + ExtrudePlan(s0 - battery_base_indent_fromside_inside, + s0 - battery_base_indent_fromside_outside + ) BaseHalfPlan(indent = battery_base_indent); + } + for (m=[0,1]) + mirror([m,0,0]) + translate([s0i, 0, bpp7[0] - 0.1]) + cylinder(r= battery_th/2, h=100, $fs=0.5); + } } module BaseHalfTest(){ ////toplevel @@ -134,6 +177,7 @@ module BaseHalfTest(){ ////toplevel module Lid(){ ////toplevel ExtrudePlan(0,s1) LidHalfPlan(); + ExtrudePlan(l0,l1) HandleHalfPlan(); } module Demo(){ ////toplevel