X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=fairphone-case.scad;h=522717a7966d22dde29a16f8bbe063d597b99ac3;hb=563d0524f8a2e88681ce58344e3f6b30cf47f69c;hp=bfde4d57aa7059bf143529c38b1c1b65a3e94c4f;hpb=a274d5cf5c4fe1575a8e2d50e5c998570a27269c;p=reprap-play.git diff --git a/fairphone-case.scad b/fairphone-case.scad index bfde4d5..522717a 100644 --- a/fairphone-case.scad +++ b/fairphone-case.scad @@ -258,16 +258,22 @@ module AroundEdges(fill_zstart, fill_th, fill_downwards=0){ [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad); } -module SideButton(y,l){ +module SideButton(y, y_ref_sign, l){ + // y_ref_sign: + // +1 measured from top of actual phone to top of button + // -1 measured from bottom of actual phone to bottom of button + // 0 y is centre of button in coordinate system $button_l= l; - eff_y = -y; + eff_y = y_ref_sign > 0 ? -bumper [1] -y -l/2 : + y_ref_sign < 0 ? (-phone +bumper)[1] +y +l/2 : + -y; echo(eff_y); translate([0, eff_y, 0]) children(); } module Buttons(){ - CaseBase_rhsflip([1]) SideButton(19.650, 8.9) children(); // power + CaseBase_rhsflip([1]) SideButton(15.580, +1, 8.9) children(); // power } module Struts(x_start, z_min, th){