From c73e8d8c7a09210af369cc6c781e3467724260c0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 20 Jan 2018 22:53:32 +0000 Subject: [PATCH] fairphone-case: break out Struts (nfc) Signed-off-by: Ian Jackson --- fairphone-case.scad | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fairphone-case.scad b/fairphone-case.scad index 532d698..b29207d 100644 --- a/fairphone-case.scad +++ b/fairphone-case.scad @@ -240,6 +240,18 @@ module AroundEdges(fill_zstart, fill_th, fill_downwards=0){ [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad); } +module Struts(z_min, th){ + for (i= [1 : 1 : case_struts_count]) { + translate([0, + -phone_height * i / (case_struts_count+1), + z_min + case_struts_solid_below]) + linear_extrude(height= th + -(case_struts_solid_below+case_struts_solid_above)) + rectfromto([ epp2i[0], -0.5 * case_struts_width ], + [ phone_width - epp2i[0], +0.5 * case_struts_width ]); + } +} + module CaseBase(){ AroundEdges(epp3[1], case_th_bottom, 1) EdgeProfile(); @@ -285,15 +297,7 @@ module Case(){ ////toplevel rectfromto(camera_pos_tl, camera_pos_br); // struts (invisible, because they're buried in the case) - for (i= [1 : 1 : case_struts_count]) { - translate([0, - -phone_height * i / (case_struts_count+1), - epp2i[1] - case_th_bottom + case_struts_solid_below]) - linear_extrude(height= case_th_bottom - -(case_struts_solid_below+case_struts_solid_above)) - rectfromto([ epp2i[0], -0.5 * case_struts_width ], - [ phone_width - epp2i[0], +0.5 * case_struts_width ]); - } + Struts(epp2i[1] - case_th_bottom, case_th_bottom); } } -- 2.30.2