8 phone_edge_thick = 9.0;
9 phone_total_thick = 12.0;
10 phone_backside_slope = 1.0; // larger means shallower
12 camera_pos_tl = [ 7.5, 13.5 ]; // measured from tl corner
13 camera_pos_br = [ 24.0, 39.5 ]; // tl/br as seen from back
22 keeper_inner_width = 1.75;
23 keeper_inner_height = 1.75;
25 keeper_gap_z_top = 0.25;
26 keeper_gap_z_bot = 0.25;
28 keeper_gap_x_holes = 0.75;
41 phone_backside_slope_thick = phone_total_thick - phone_edge_thick;
43 //lid_lip_overlap_width xxx bad name = ;
44 //lid_lip_inner_slope = [ 5, 5 ]; // xxx
47 epp1 = [0, -phone_edge_thick];
48 epp2 = epp1 + phone_backside_slope_thick * [ phone_backside_slope, -1 ];
49 epp3 = epp2 + [10, 0];
50 epp5 = epp0 + [0,1] * (keeper_th_z + keeper_gap_z_top + case_lip);
51 epp4 = epp5 + [-1,0] * case_th_side;
54 kppd = kppe + [1,0] * keeper_inner_width;
55 kppc = kppd + [0,1] * keeper_th_z;
56 kppb = [ kppe[0] - keeper_th_x, kppc[1] ];
57 kppf = kppe - [0,1] * keeper_inner_height;
58 kppa = [ kppb[0], kppf[1] ];
60 lpp10 = [ epp5[0] + lid_gap_x, kppc[1] + lid_gap_z ];
61 lpp11 = [ lpp10[0], epp5[1] + lid_gap_z ];
62 lpp12 = [ epp4[0] + lid_lip, lpp11[1] ];
63 lpp13 = [ lpp12[0], lpp12[1] + lid_lip ];
65 module rectfromto(a,b) {
67 translate([min(a[0], b[0]), min(a[1], b[1])])
68 square([abs(ab[0]), abs(ab[1])]);
70 module circleat(c,r) { translate(c) circle(r); }
72 module KeeperProfile(){
73 polygon([kppe, kppd, kppc, kppb, kppa, kppf]);
79 translate(epp3) square(case_th_bottom*2, center=true);
80 circleat(epp2, r=case_th_bottom);
81 circleat(epp1, r=case_th_side);
82 rectfromto(epp0, epp4);
84 polygon([ epp5 + [0,10],
91 module LidEdgeProfile(){
100 circleat(lpp12, r=lid_lip);
101 rectfromto( lpp12 + [-10, 0],
102 lpp12 + [+10, +10] );
106 module CaseBase_rhsflip(yn=[0,1]) {
108 translate([phone_width/2, 0, 0])
110 translate([-phone_width/2, 0, 0])
115 module CaseBase_botflip() {
117 translate([0, -phone_height/2, 0])
119 translate([0, phone_height/2, 0])
124 module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
127 translate([0, -phone_cnr_rad, 0])
129 linear_extrude(height = phone_height - phone_cnr_rad*2)
133 CaseBase_rhsflip() CaseBase_botflip() {
134 translate([+1,-1] * phone_cnr_rad)
139 translate([-1,0] * phone_cnr_rad)
141 rectfromto([0,-20],[10,20]);
143 translate([-10, 0, -20] + 0.01 * [+1,-1, 0] )
149 translate([ phone_width - phone_cnr_rad, 0,0 ])
151 linear_extrude(height = phone_width - phone_cnr_rad*2)
155 translate([0,0, fill_zstart])
156 mirror([0,0, fill_downwards])
157 linear_extrude(height = fill_th)
158 rectfromto([+1,-1] * phone_cnr_rad,
159 [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
163 AroundEdges(epp3[1], case_th_bottom, 1)
167 module Case(){ ////toplevel
173 translate([0, -phone_cnr_rad, 0])
175 linear_extrude(height = phone_height + phone_cnr_rad * 2)
178 rectfromto([ -keeper_gap_x, -keeper_gap_z_bot ],
179 [ keeper_gap_x_holes, +keeper_gap_z_top ]);
183 CaseBase_rhsflip([1])
185 linear_extrude(height = 20)
187 rectfromto(camera_pos_tl, camera_pos_br);
191 module Lid(){ ////toplevel
192 AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
196 module TestLength(){ ////toplevel
199 translate([-30, -200, -20])
200 cube([30 + 15, 250, 40]);
204 module TestWidth(){ ////toplevel
207 translate([-30, -(phone_height - 25), -20])
213 module TestCamera(){ ////toplevel
218 linear_extrude(height = 50)
220 rectfromto([-20, -20],
221 camera_pos_br + [ 5, 5 ]);
225 module OneKeeper(){ ////toplevel
226 translate([0, -phone_cnr_rad, 0])
228 linear_extrude(height = phone_height - phone_cnr_rad * 2)
232 module OneKeeperPrint(){ ////toplevel
237 module Keeper(){ ////toplevel
242 module DemoProfiles(){ ////toplevel