+module Case(){ ////toplevel
+ difference(){
+ union(){
+ CaseBase();
+
+ // ledge (fixed keeper)
+ intersection(){
+ rotate([90, 0, 0])
+ linear_extrude(height = phone_height + phone_cnr_rad * 2)
+ KeeperProfile(1);
+
+ // outline of the whole case, to stop it protruding
+ translate([0,0, -25])
+ linear_extrude(height = 50)
+ hull()
+ // CaseBase_rhsflip() // actually, we only care about the LH
+ CaseBase_botflip()
+ circleat([+1,-1] * phone_cnr_rad, phone_cnr_rad + case_th_side/2);
+ }
+ }
+
+ // slot for keeper
+ CaseBase_rhsflip(1)
+ translate([0, -phone_cnr_rad, 0])
+ rotate([90, 0, 0])
+ linear_extrude(height = phone_height + phone_cnr_rad * 2)
+ minkowski(){
+ KeeperProfile();
+ rectfromto([ -keeper_gap_x, -keeper_gap_z_bot ],
+ [ keeper_gap_x_holes, +keeper_gap_z_top ]);
+ }
+
+ // front camera
+ CaseBase_rhsflip([1])
+ mirror([0, 0, 1])
+ linear_extrude(height = 20)
+ mirror([0, 1, 0])
+ 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 ]);
+ }
+ }
+}
+
+module Lid(){ ////toplevel
+ AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
+ LidEdgeProfile();
+}
+
+module TestLength(){ ////toplevel
+ intersection(){
+ Case();
+ translate([-30, -200, -20])
+ cube([30 + 15, 250, 40]);
+ }
+}
+
+module TestWidth(){ ////toplevel
+ intersection(){
+ Case();
+ translate([-30, -(phone_height - 25), -20])
+ mirror([0, 1, 0])
+ cube([200, 50, 40]);
+ }
+}
+
+module TestLidWidthPrint(){ ////toplevel
+ rotate([0,180.0])
+ intersection(){
+ Lid();
+ translate([-30, -(phone_height - 25), -20])
+ mirror([0, 1, 0])
+ cube([200, 50, 40]);
+ }
+}
+
+module TestCamera(){ ////toplevel
+ intersection(){
+ Case();
+ CaseBase_rhsflip(1)
+ translate([0,0,-25])
+ linear_extrude(height = 50)
+ mirror([0, 1, 0])
+ rectfromto([-20, -20],
+ camera_pos_br + [ 5, 5 ]);
+ }
+}
+
+module OneKeeper(){ ////toplevel
+ translate([0, -phone_cnr_rad, 0])
+ rotate([90, 0, 0])
+ linear_extrude(height = phone_height - phone_cnr_rad * 2)
+ KeeperProfile();
+}
+
+module OneKeeperPrint(){ ////toplevel
+ rotate([0,180,0])
+ OneKeeper();
+}
+
+module Keeper(){ ////toplevel
+ CaseBase_rhsflip()
+ OneKeeper();
+}
+
+module ButtonPlanForDemo(colour, z, deep, cut){
+ color(colour)
+ translate([0,0,z])
+ ButtonPlan(8, deep, cut);
+}
+
+module DemoProfiles(){ ////toplevel
+ LidEdgeProfile();
+ %EdgeProfile();
+ KeeperProfile();
+ translate([0,0,-1]) color("black") KeeperProfile(1);
+
+ translate([20,0]) {
+ LidEdgeProfile();
+ %EdgeProfile();
+
+ demopoint_QR = [ bppS[0], bppQ[1] - 0.1];
+
+ color("blue") ButtonCoverProfile();
+ color("red") {
+ rectfromto(bppQ, demopoint_QR);
+ rectfromto(bppR, demopoint_QR);
+ }
+ }
+
+ translate([-20,0]) {
+ ButtonPlanForDemo("grey", -1, 0,1);
+ ButtonPlanForDemo("blue", -2, 1,0);
+ ButtonPlanForDemo("red", -3, 1,1);
+ }
+}
+