X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=fairphone-case.scad;h=ff29be79a9349bdf2f218435767ea47facbb4188;hb=d4c1cea9e5f126dfa75434af5d04d179f397f972;hp=59dd894fcbad25d60300a7c8a5513d56b0192cb0;hpb=d7aca80e53472fca75c92aa8d07221e9e79c5963;p=reprap-play.git diff --git a/fairphone-case.scad b/fairphone-case.scad index 59dd894..ff29be7 100644 --- a/fairphone-case.scad +++ b/fairphone-case.scad @@ -332,6 +332,30 @@ module Struts(x_start, z_min, th){ } } +module OrdinaryRearAperture(rhs,bot, pos){ + CaseBase_rhsflip(rhs) CaseBase_botflip(bot) + linextr(-20, 20) + mirror([0,1]) + translate(pos + bumper) + children(); +} + +module OrdinaryRearApertures(){ + // rear speaker + OrdinaryRearAperture(1,1, rearspeaker_pos_bl) + rectfromto(-rearspeaker_gap, + rearspeaker_size + rearspeaker_gap); +} + +module RearCameraAperture(){ + CaseBase_rhsflip([1]) + mirror([0, 0, 1]) + linear_extrude(height = 20) + mirror([0, 1, 0]) + translate(bumper) + rectfromto(camera_pos_tl, camera_pos_br); +} + module CaseBase(){ AroundEdges(epp3[1], case_th_bottom, 1) EdgeProfile(); @@ -370,12 +394,7 @@ module Case(){ ////toplevel } // front camera - CaseBase_rhsflip([1]) - mirror([0, 0, 1]) - linear_extrude(height = 20) - mirror([0, 1, 0]) - translate(bumper) - rectfromto(camera_pos_tl, camera_pos_br); + RearCameraAperture(); // struts (invisible, because they're buried in the case) Struts(epp2i[0], epp2i[1] - case_th_bottom, case_th_bottom); @@ -403,13 +422,7 @@ module Case(){ ////toplevel CaseBase_rhsflip([1]) CaseAperture(noisecancelmic_pos, noisecancelmic_dia, 20); - // rear speaker - CaseBase_rhsflip([1]) CaseBase_botflip([1]) - linextr(-20, 20) - mirror([0,1]) - translate(rearspeaker_pos_bl + bumper) - rectfromto(-rearspeaker_gap, - rearspeaker_size + rearspeaker_gap); + OrdinaryRearApertures(); } } @@ -465,22 +478,25 @@ module TestLidWidthPrint(){ ////toplevel } } +module TestSelectRearAperture(){ + minkowski(){ + union() children(); + translate([20, 0,0]) + cube([42, 2, 1], center=true); + } +} + module TestSelectCamera(){ - CaseBase_rhsflip(1) - translate([0,0,-25]) - linear_extrude(height = 50) - mirror([0, 1, 0]) - rectfromto([-20, -20], - camera_pos_br + bumper + [ 5, 5 ]); + minkowski(){ + TestSelectRearAperture() + RearCameraAperture(); + cube([0.1, 50, 0.1]); + } } -module TestSelectRearSpeaker(){ - CaseBase_rhsflip(1) CaseBase_botflip([1]) - linextr(-20,20) - mirror([0,1,0]) - translate(rearspeaker_pos_bl + bumper) - rectfromto(-(rearspeaker_gap + [40,2]), - rearspeaker_size + rearspeaker_gap + [2,2]); +module TestSelectOrdinaryRearApertures(){ + TestSelectRearAperture() + OrdinaryRearApertures(); } module TestCamera(){ ////toplevel @@ -540,7 +556,7 @@ module TestFrameCase(){ ////toplevel union(){ TestSelectFrame(); TestSelectCamera(); - TestSelectRearSpeaker(); + TestSelectOrdinaryRearApertures(); } } }