5 phone = [ 75.0, 145.0 ];
7 prop_buildout_less = 3;
9 prop_angles = [ 15, 30, 45, 60 ];
11 bumper = [ 0.250, -0.025 ];
12 // ^ One side. Overall size is increased by twice this.
13 // If no bumpers, is the gap around the phone.
19 button_cutout_depth = 9;
21 phone_edge_thick = 9.0;
22 phone_total_thick = 12.0;
23 phone_backside_slope_inner = 1.5; // larger means shallower
24 phone_backside_slope_outer = 1.0; // larger means shallower
26 camera_pos_tl = [ 6.450, 12.750 ]; // measured from tl corner
27 camera_pos_br = [ 22.300, 37.600 ]; // tl/br as seen from back
29 jack_pos = [ 13.83, 8.485 ];
30 jack_dia = 10.64 + .5; // some jack I had lying around
32 noisecancelmic_pos = [ 19.54, 7.37 ]; // from rhs
33 noisecancelmic_dia = 4.00;
35 //fingerpushhole_dias = [ 15, 18 ];
36 fingerpushhole_dias = [];
38 rearspeaker_pos_bl = [ 12.64, 18.72 ];
39 rearspeaker_size = [ 3.76, 7.36 ];
41 microusb_above = 3.27 - 0.25;
43 microusb_width = 16.12 + 1.25;
50 case_struts_count = 6;
51 case_struts_solid_below = 1.00;
52 case_struts_solid_above = 0.75;
53 case_struts_width = 0.10;
57 keeper_inner_width = 2.75;
58 keeper_inner_height = 2.75;
59 keeper_slant_slope = 2; // larger means steeper
61 keeper_gap_z_top = 0.25;
62 keeper_gap_z_bot = 0.75;
64 keeper_gap_x_holes = 0.75;
66 keeper_side = 0; // 0 = lhs; 1 = rhs
77 foldover_lever_gap = 0.50;
79 hingescrew_shaft_dia = 2.0 + 0.25; // M2 x 12mm machine screw
80 hingescrew_shaft_len = 12;
81 hingescrew_nut_thick = 1.93 + 0.20; // incl. washer
82 hingescrew_nut_dia = 4.72 + 0.50; // washer, actually
83 hingescrew_head_th = 1.38 + 0.75;
84 hingescrew_head_dia = 3.92;
85 lever_cover_th = 0.75;
92 buttonishleg_default_l_is_fudge = 10;
94 hinge_base_slope = 1.5; // bigger is steeper
96 strut_min_at_end = 1.5;
99 hinge_x_postscrew_gap = 0.75;
100 hinge_x_arms_gap = 0.35;
101 hinge_r_arms_gap = 0.55;
103 rearspeaker_gap = [ 2.0, 2.0 ]; // each side
107 catch_thickness = 1.0;
108 catch_side_gap = 0.75; // each side
112 catch_finger_height = 1.5;
113 catch_finger_depth = 2.5;
115 prop_recess_under = 0.50;
116 prop_recess_slop = 0.200; // each side
121 prop_side_gap = 0.75; // each side
122 prop_lidrecess_behind = 0.75;
123 prop_caserecess_behind = 0.75;
124 prop_caserecess_taper = 0.45; // one side only
126 prop_prong_heel_slope = 0.5;
128 // ---------- calculated ----------
130 phone_width = (phone + bumper*2)[0];
131 phone_height = (phone + bumper*2)[1];
133 inside_br = [phone_width, -phone_height];
135 prop_prong_h = prop_main_th;
137 //echo(camera_pos_tl + bumper,
138 // camera_pos_br + bumper);
140 // ----- could be changed -----
141 lid_buttoncover_gap = lid_gap_x;
142 lid_buttoncover_overlap = case_th_lip + keeper_gap_z_top;
144 phone_backside_slope_thick = phone_total_thick - phone_edge_thick;
146 //prop_lidrecess_depth = case_th_lid - prop_recess_under;
148 //prop_nose_len = case_th_lid - prop_recess_under;
149 //prop_recess_slope = tan(prop_max_angle); // bigger means steeper
150 //prop_recess_width = prop_main_th / cos(prop_max_angle) + prop_backfwd_gap;
153 //lid_lip_overlap_width xxx bad name = ;
154 //lid_lip_inner_slope = [ 5, 5 ]; // xxx
157 epp1 = [0, -phone_edge_thick];
158 epp2i = epp1 + phone_backside_slope_thick * [ phone_backside_slope_inner, -1 ];
159 epp2o = epp1 + phone_backside_slope_thick * [ phone_backside_slope_outer, -1 ];
160 epp3 = epp2i + [10, 0];
161 epp5 = epp0 + [0,1] * (keeper_th_z + keeper_gap_z_top + case_lip);
162 epp4 = epp5 + [-1,0] * case_th_side;
165 kppd = kppe + [1,0] * keeper_inner_width;
166 kppc = kppd + [0,1] * keeper_th_z;
167 kppb = [ kppe[0] - keeper_th_x, kppc[1] ];
168 kppf = kppe - [0,1] * keeper_inner_height;
169 kppa = [ kppb[0], kppf[1] ];
171 lpp10 = [ epp5[0] + lid_gap_x, kppc[1] + lid_gap_z ];
172 lpp11 = [ lpp10[0], epp5[1] + lid_gap_z ];
174 lp_r12 = case_th_lid - (lpp11[1] - lpp10[1]);
176 lpp12 = [ epp4[0] + lp_r12, lpp11[1] ];
177 lpp13 = [ lpp12[0], lpp12[1] + lp_r12 ];
179 case_bottom_z = epp2o[1] - case_th_bottom;
183 bppN = [ 0.5 * (epp0[0] + epp4[0]), bppM[1] ];
184 bppR = [ bppN[0] + lid_buttoncover_gap, -button_cutout_depth ];
185 bppS = [ epp1[0], bppR[1] ];
186 bppQ = [ bppM[0], bppR[1] - lid_buttoncover_overlap ];
187 bppP = bppQ + [0,1] * lid_buttoncover_gap;
188 bppO = [ bppN[0], bppP[1] ];
189 bppL = lpp10 + [5,0];
190 bppK = [ bppL[0], bppN[1] ];
191 bppJ = [ bppN[0], bppL[1] ];
194 hp_rn = hingescrew_nut_dia/2;
195 hp_r2_min = hp_rn + lever_cover_th;
196 hp_rs = hingescrew_shaft_dia/2;
197 hp_r1_min = hp_rs + hingemount_th;
199 hp_r1 = max(hp_r1_min, hp_r2_min);
203 hppS = epp2o + [0,-1] * case_th_bottom;
204 hp_k = 0.5 * (hppU[1] - hppS[1] + foldover_gap);
206 hppM = [ epp4[0] - foldover_lever_gap - hp_r2,
207 0.5 * (hppU + hppS)[1] ];
208 hppT = [ hppM[0], hppU[1] - hp_r1 ];
209 hppB = hppT + [0,-1] * hp_k;
211 hppE_y = epp2o[1] - case_th_bottom + hp_r1;
212 hppE_x = hppB[0] + (hppB[1] - hppE_y) * hinge_base_slope;
213 hppE = [ hppE_x, hppE_y ];
215 // hinge elevation x coords
217 hingescrew_portion_len =
218 0.5* (hingescrew_shaft_len - hingescrew_nut_thick - hinge_x_gap);
220 hex20 = max(epp2o[0],
222 kppd[0] + hingescrew_head_th + keeper_gap_x_holes);
223 hex21 = hex20 + hingescrew_portion_len;
224 hex22 = hex21 + hinge_x_gap;
225 hex23 = hex22 + hingescrew_portion_len
226 - hingescrew_nut_thick; // bodge, need to divvy this up more sensibly
227 hex24 = hex20 + hingescrew_shaft_len + hinge_x_postscrew_gap;
228 //echo(hex20, hex21, hex22, hex23, hex24);
229 //echo(hingescrew_portion_len);
233 cppJ = [ epp4[0] + catch_thickness, lpp10[1] ];
234 cppA = cppJ + [lid_gap_x, -lid_gap_z];
235 cppB = [ epp0[0], cppA[1] ];
236 cppP = [ epp4[0], cppJ[1] ];
238 cppS = cppJ + [0,-1] * catch_len;
239 cppD = [ cppA[0], cppS[1] + catch_slop ];
240 cppC = [ cppB[0], cppD[1] ];
241 cppT = cppS + [1,0] * catch_depth;
242 cppU = cppT + [0,-1] * catch_height;
243 cppV = [ cppS[0], cppU[1] - catch_depth ];
245 cppR = 0.5*(cppP + cppJ);
247 cp_rQ = 0.5 * (cppJ[0] - cppP[0]);
249 cppV[1] - (catch_finger_height - cp_rQ) ];
250 cppF = [ cppV[0] + catch_finger_depth, cppC[1] ];
252 // prop recess in case
254 prop_x_pos = phone_width/2;
256 prop_recess_hw = 0.5 * prop_main_width + prop_side_gap;
258 prc_r1 = prop_end_dia/2;
259 prc_r3 = prc_r1 + prop_recess_slop;
261 prcp2 = [ epp4[0] + prop_buildout_less,
264 prop_caserecess_buildout_r = -1; // prcp2[0] - epp2o[0];
266 prcp1 = [ epp2o[0] + prc_r3 + prop_caserecess_behind,
267 epp2i[1] - prc_r3 - prop_recess_under];
269 // prop recess in lid
271 prl_r10 = prop_end_dia/2;
272 prl_r10o = prl_r10 + prop_recess_slop;
274 prlp10 = lpp10 + [1,1] * prl_r10o
275 + [1,0] * prop_lidrecess_behind
276 + [0,1] * prop_recess_under;
281 $prpp11 = [0, prop_taper_len];
285 // ---------- modules ----------
287 module KeeperProfile(slant=0){
288 use_e = kppe + [0,-1] * slant * keeper_inner_width / keeper_slant_slope;
289 polygon([use_e, kppd, kppc, kppb, kppa, kppf]);
292 module EdgeProfile(){
295 translate(epp3) square(case_th_bottom*2, center=true);
296 circleat(epp2o, r=case_th_bottom);
297 circleat(epp1, r=case_th_side);
298 rectfromto(epp0, epp4);
300 polygon([ epp5 + [0,10],
307 module LidEdgeProfile(){
316 circleat(lpp12, r=lp_r12);
317 rectfromto( lpp12 + [-10, 0],
318 lpp12 + [+10, +10] );
322 module ButtonCoverProfile(){
324 polygon([ bppM, bppP, bppO, bppJ, bppL, bppK ]);
332 module ButtonPlan(l, deep, cut){
334 (cut ? 0 : lid_buttoncover_gap);
337 (deep ? lid_buttoncover_overlap : 0);
339 C = [0,0]; // by definition
343 B0 = C + [0,-1] * button_cutout_depth;
344 B1 = B0 + [0,1] * epsilon;
346 r0 = 0.5 * (T[1] - B0[1]);
347 A = [ -(l + button_l_fudge)/2 + r0, 0.5 * (T[1] + B0[1]) ];
348 H = A + [0,-1] * delta;
354 E1 = E0 + [1,0] * epsilon;
356 I0 = [ E0[0], H[1] ];
357 I1 = [ E1[0], H[1] ];
360 for (m=[0,1]) mirror([m,0])
361 circleat(H, r0 - epsilon);
363 for (m=[0,1]) mirror([m,0]) {
373 circleat(D, r0 + epsilon);
378 module CatchCatchProfile(){
380 for (c=[ cppR, cppQ ])
384 circleat(lpp12, lp_r12);
385 circleat(lpp12 + [5,0], lp_r12);
386 rectfromto(cppP, cppP + [5,0.1]);
388 polygon([cppJ, cppS, cppT, cppU, cppV, cppQ, cppR]);
391 module CatchCutProfile(){
403 module Flip_rhs(yn=[0,1]) {
405 translate([phone_width/2, 0, 0])
406 mirror([$rhsflip,0,0])
407 translate([-phone_width/2, 0, 0])
412 module Flip_bot(yn=[0,1]) {
414 translate([0, -phone_height/2, 0])
415 mirror([0, $botflip, 0])
416 translate([0, phone_height/2, 0])
421 module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
424 translate([0, -phone_cnr_rad, 0])
426 linear_extrude(height = phone_height - phone_cnr_rad*2)
430 Flip_rhs() Flip_bot() {
431 translate([+1,-1] * phone_cnr_rad)
436 translate([-1,0] * phone_cnr_rad)
438 rectfromto([0,-20],[10,20]);
440 translate([-10, 0, -20] + 0.01 * [+1,-1, 0] )
446 translate([ phone_width - phone_cnr_rad, 0,0 ])
448 linear_extrude(height = phone_width - phone_cnr_rad*2)
452 translate([0,0, fill_zstart])
453 mirror([0,0, fill_downwards])
454 linear_extrude(height = fill_th)
455 rectfromto([+1,-1] * phone_cnr_rad,
456 [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
459 module CaseAperture(pos, dia, $fn) {
461 translate([ pos[0] + bumper[0],
464 rotate([-90, theta, 0])
465 cylinder(r = dia/2 / cos(theta),
469 module SideButton(y, y_ref_sign, l){
471 // +1 measured from top of actual phone to top of button
472 // -1 measured from bottom of actual phone to bottom of button
473 // 0 y is centre of button in coordinate system
475 eff_y = y_ref_sign > 0 ? -bumper [1] -y -l/2 :
476 y_ref_sign < 0 ? (-phone -bumper)[1] +y +l/2 :
479 translate([0, eff_y, 0])
483 module LidButtonishLeg(y, y_ref_sign, l=buttonishleg_default_l_is_fudge) {
484 $button_leg_only = true;
485 SideButton(y, y_ref_sign, l) children();
489 Flip_rhs(1) SideButton(15.580, +1, 8.9) children(); // power
490 Flip_rhs(1) SideButton(48.700, -1, 8.920) children(); // camera
491 Flip_rhs(0) SideButton(30.800, +1, 21.96) children(); // volume
492 Flip_rhs( ) LidButtonishLeg(14, -1) children();
493 // Flip_rhs(0) LidButtonishLeg(20, +1, 20) children();
496 module Struts(x_start, z_min, th){
497 // if th is negative, starts at z_min and works towards -ve z
498 // and object should then be printed other way up
499 for (i= [1 : 1 : case_struts_count]) {
503 mirror([0,0, th<0 ? 1 : 0])
505 -phone_height * i / (case_struts_count+1),
506 case_struts_solid_below])
507 linear_extrude(height= abs(th)
508 -(case_struts_solid_below+case_struts_solid_above))
509 rectfromto([ x_start, -0.5 * case_struts_width ],
510 [ phone_width - x_start, +0.5 * case_struts_width ]);
514 module OrdinaryRearAperture(rhs,bot, pos){
515 Flip_rhs(rhs) Flip_bot(bot)
518 translate(pos + bumper)
526 linextr(-epp2i[0], 60)
527 translate([0.5 * phone_width, 0, 0])
528 rectfromto([-microusb_width/2, epp2i[1] + microusb_below],
529 [+microusb_width/2, epp0[1] + -microusb_above]);
533 module OrdinaryRearApertures(){
535 OrdinaryRearAperture(1,1, rearspeaker_pos_bl)
536 rectfromto(-rearspeaker_gap,
537 rearspeaker_size + rearspeaker_gap);
539 // finger hole to remove phone
540 if (len(fingerpushhole_dias))
541 OrdinaryRearAperture(1,0, [ fingerpushhole_dias[0]/2 + epp2i[0],
543 scale(fingerpushhole_dias)
547 module RearCameraAperture(){
550 linear_extrude(height = 20)
553 rectfromto(camera_pos_tl, camera_pos_br);
556 module HingeLidProfile(){
558 circleat(hppT, hp_r1);
559 circleat(lpp12, lp_r12);
567 module HingeBaseProfile(){
570 circleat(hppB, hp_r1);
571 circleat(hppE, hp_r1);
572 circleat(epp2o, case_th_bottom);
573 circleat(hppB + [10,0], hp_r1);
575 polygon([epp5, epp1, epp2i, epp3, bppL]);
579 module HingeLeverOuterProfile(){
581 circleat(hppT, hp_r2);
582 circleat(hppB, hp_r2);
586 module HingeLeverInnerProfile(){
587 for (c = [hppT, hppB]) {
590 for (y=[0, c[1] - hppM[1]])
597 hinge_origin = [0, -(phone_height - hppB[0]), hppB[1]];
598 translate(hinge_origin)
600 translate(-hinge_origin)
604 module HingePortion(x0,x1){
605 Flip_rhs() Flip_bot(1)
609 linear_extrude(height=x1-x0)
613 module CatchPortion(width){
614 translate([phone_width/2, 0,0])
616 linextr(-width/2, width/2)
621 AroundEdges(epp3[1], case_th_bottom, 1)
625 function prop_x(gamma) = hp_k / (2 * sin(gamma/2)) - hppT[0];
627 module PropProfileAssignments(gamma){
628 // https://en.wikipedia.org/wiki/Solution_of_triangles#Two_sides_and_the_included_angle_given_(SAS)
630 p = phone_height + prlp10[0] - hppB[0];
633 q = phone_height - hppT[0] - prcp1[0]; // $prpp7[0] is 0 by definition
635 c = sqrt(a*a + b*b - 2*a*b*cos(gamma));
636 $prp_alpha = acos( (b*b + c*c - a*a) / (2*b*c) );
638 $prp_theta = 90 - $prp_alpha;
639 beta = 180 - $prp_alpha - gamma;
642 //echo("abc", a,b,c);
644 v1 = [ [ cos(psi), -sin(psi) ], // x
645 [ sin(psi), cos(psi) ] ]; // y
647 $prpp7 = [0, c + (lpp13[1] - $prpp10[1] - hp_k) ];
650 $prp_r11 = prop_main_th/2;
652 $prpp1 = $prpp7 + [1,0] *
653 // this is approximate, but will do
654 (prop_main_th/2 + prop_prop_gap + prcp1[0] - cppA[0]);
657 v1[1] * ((prcp2[1] - prcp1[1]) - prop_prop_gap);
658 $prpp12 = $prpp3 + v1[0] *
659 (prop_end_dia + prop_caserecess_taper * ($prpp1[1] - $prpp3[1]));
660 $prp_r8 = prop_main_th;
661 $prpp4 = [ prop_main_th/2, $prpp3[1] ];
663 $prpp5 = [ $prpp12[0] - $prp_r5,
664 $prpp3[1] - prop_prong_h + $prp_r5 ];
665 $prpp6 = $prpp4 + [0,-1] * (prop_prong_h +
666 prop_prong_heel_slope * ($prpp5[0] - $prpp4[0]));
667 $prpp8 = $prpp4 + [0,-1] * $prp_r8;
668 $prpp9 = $prpp8 + [-1,0] * $prp_r8;
673 module PropProfile(gamma, cut=0, rot=0){ ////toplevel
674 PropProfileAssignments(gamma){
676 //#circleat($prpp3,1);
677 //#circleat($prpp12,1);
684 polygon([[-20,-0], [20,20], [0,0]]);
686 rectfromto($prpp6, $prpp9);
687 translate($prpp5) intersection(){
689 polygon([[-10,-10], [0,0], [10,0]]);
691 rectfromto($prpp12 + [0,-0.1], $prpp3);
694 circleat($prpp1, $prp_r1);
695 rectfromto($prpp12 + [0,-0.1], $prpp3);
699 rotate([0,0, rot*-$prp_theta]){
701 extra = cut ? prop_recess_slop : 0;
702 rectfromto($prpp6, $prpp9);
703 circleat($prpp11, $prp_r11 + extra);
704 circleat($prpp10, $prp_r10 + extra);
710 module PropAggregateProfile(){
711 for (angle = prop_angles)
712 PropProfile(angle, 0,0);
715 module Prop(){ ////toplevel
716 hw = prop_main_width/2;
718 PropAggregateProfile();
721 module Case(){ ////toplevel
726 // ledge (fixed keeper)
727 Flip_rhs(1-keeper_side) intersection(){
729 linear_extrude(height = phone_height + phone_cnr_rad * 2)
732 // outline of the whole case, to stop it protruding
733 translate([0,0, -25])
734 linear_extrude(height = 50)
737 circleat([+1,-1] * phone_cnr_rad, phone_cnr_rad + case_th_side/2);
741 HingePortion(hex20, hex21) HingeBaseProfile();
743 // buildout for prop recess
744 if (prop_caserecess_buildout_r > 0) Flip_rhs(1)
745 linextr(case_bottom_z, epp2i[1])
748 circleat([ prop_x_pos + dxs * prop_caserecess_buildout_r,
750 r = epp2o[0] - prcp2[0]);
755 Flip_rhs(keeper_side)
756 translate([0, -phone_cnr_rad, 0])
758 linear_extrude(height = phone_height + phone_cnr_rad * 2)
761 rectfromto([ -keeper_gap_x, -keeper_gap_z_bot ],
762 [ keeper_gap_x_holes, +keeper_gap_z_top ]);
766 RearCameraAperture();
768 // struts (invisible, because they're buried in the case)
769 Struts(epp2i[0], epp2i[1] - case_th_bottom, case_th_bottom);
774 if (!($button_leg_only && enable_support))
777 linear_extrude(height= 20)
778 ButtonPlan($button_l, 0,1);
779 if ($button_leg_only)
781 translate([phone_width/2, -400, kppe[1]])
782 mirror([1-abs($rhsflip - keeper_side),0,0])
783 cube([400, 800, 50]);
786 translate([-400, -400, kppd[1]])
790 translate([0,0, -bppR[0]])
791 linear_extrude(height= 20)
792 ButtonPlan($button_l, 1,1);
797 // apertures along top edge
798 CaseAperture(jack_pos, jack_dia, 8);
800 CaseAperture(noisecancelmic_pos, noisecancelmic_dia, 8);
802 OrdinaryRearApertures();
806 // gaps for the lid's hinge arms
807 HingePortion(hex20 - hinge_x_arms_gap,
808 hex21 + hinge_x_arms_gap)
811 circle(r= hinge_r_arms_gap, $fn= 8);
814 // screw holes in the hinge arms
818 CatchPortion(catch_width + catch_side_gap*2)
823 translate([prop_x_pos,0,0])
826 linextr(-prop_recess_hw, +prop_recess_hw)
828 for (d=[ [0,0], [0,-1], [+1,-1/prop_caserecess_taper] ])
829 circleat(prcp1 + 20*d,
835 module Lid(){ ////toplevel
838 AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
846 linear_extrude(height= 20)
847 ButtonPlan($button_l, 1,0);
849 translate([0,0,-100])
850 linear_extrude(height= 200)
851 ButtonCoverProfile();
856 HingePortion(hex20, hex21) HingeLidProfile();
859 CatchPortion(catch_width)
862 Struts(lpp10[0] + strut_min_at_end, lpp13[1], -case_th_lid);
864 // screw holes in the hinge arms
868 translate([prop_x_pos, -prlp10[0], prlp10[1]])
871 linextr(-prop_recess_hw, +prop_recess_hw)
873 for (pa = prop_angles)
874 PropProfile(pa, 1,1);
878 module HingeLever(){ ////toplevel
880 // outer body, positive
881 HingePortion(hex22, hex22 + phone_width/2)
882 HingeLeverOuterProfile();
884 // space for the screws
885 HingePortion(hex23, hex24)
886 HingeLeverInnerProfile();
888 // bores for the screws
891 // space for the charging cable
893 Flip_hinge() MicroUSB();
897 module HingeLeverPrint(){ ////toplevel
902 module TestSelectLength(){
903 translate([-30, -200, -20])
904 cube([30 + 15, 250, 40]);
907 module TestLength(){ ////toplevel
914 module TestLengthRight(){ ////toplevel
922 module TestSelectWidth(){
923 translate([-30, -(phone_height - 25), -20])
928 module TestWidth(){ ////toplevel
935 module TestLidWidthPrint(){ ////toplevel
936 rotate([0,180.0]) intersection(){
942 module TestSelectRearAperture(){
946 cube([42, 2, 1], center=true);
950 module TestSelectCamera(){
952 TestSelectRearAperture()
953 RearCameraAperture();
954 cube([0.1, 50, 0.1]);
958 module TestSelectOrdinaryRearApertures(){
959 TestSelectRearAperture()
960 OrdinaryRearApertures();
963 module TestCamera(){ ////toplevel
970 module TestLidByCamera(){ ////toplevel
977 module TestLidByCameraPrint(){ ////toplevel
978 rotate([180,0,0]) TestLidByCamera();
981 module DemoByCamera(){ ////toplevel
982 color("blue") TestLidByCamera();
983 color("red") TestCamera();
986 module OneKeeper(){ ////toplevel
987 translate([0, -phone_cnr_rad, 0])
989 linear_extrude(height = phone_height - phone_cnr_rad * 2)
993 module OneKeeperPrint(){ ////toplevel
998 module LidPrint(){ ////toplevel
1003 module TestSelectFrame(){
1004 include = [1,-1] * (epp2i[0] + 4);
1007 cube(1000, center=true);
1008 translate([0,0, -100])
1009 linear_extrude(height=200)
1010 rectfromto(include, inside_br - include);
1014 module TestSelectLidFrame(){
1018 module TestFrameCase(){ ////toplevel
1024 TestSelectOrdinaryRearApertures();
1029 module TestTopApertures(){ ////toplevel
1033 translate([-100, -35, -100])
1034 cube([400, 100, 200]);
1038 module TestFrameLidPrint(){ ////toplevel
1039 rotate([0,180,0]) intersection(){
1041 TestSelectLidFrame();
1045 module ButtonPlanForDemo(z, deep, cut){
1047 ButtonPlan(8, deep, cut);
1050 module HingeScrews(){
1051 Flip_rhs() Flip_bot(1){
1052 for (c= [ hppT, hppB ])
1057 translate([0,0,-.2])
1058 cylinder( r= hingescrew_shaft_dia/2,
1059 h = hingescrew_shaft_len+0.2 );
1061 translate([0,0,+.1])
1062 cylinder( r= hingescrew_head_dia/2, h = hingescrew_head_th );
1067 module DemoPropAngleSelect(c){
1068 color(c) difference(){
1069 union(){ children(); }
1070 translate([ prop_x_pos, -400, -200 ])
1071 cube([ 400,800,400 ]);
1075 module DemoPropAngle(ang){
1076 hL = [0, -(phone_height - hppT[0]), hppT[1] - hp_k*2];
1077 hC = [0, -(phone_height - hppB[0]), hppB[1]];
1085 DemoPropAngleSelect("red") Case();
1088 translate([prop_x_pos, -prcp1[0], prcp1[1]])
1089 PropProfileAssignments(ang) {
1091 rotate([-$prp_theta, 0, 0])
1092 translate([0, $prpp1[0], -$prpp1[1]])
1098 translate([0,0, -hp_k*2])
1099 DemoPropAngleSelect("blue")
1103 module DemoPropAngles(){ ////toplevel
1104 for (i=[0 : len(prop_angles)-1])
1105 translate(i * [0, -100, 100])
1106 DemoPropAngle(prop_angles[i]);
1109 module DemoFrame(){ ////toplevel
1110 color("red") TestFrameCase();
1111 color("blue") intersection(){ Lid(); TestSelectLidFrame(); }
1112 color("black") HingeScrews();
1116 module DemoHingedFrame(){ ///toplevel
1117 color("red") TestFrameCase();
1118 translate([0,0, -2*hp_k])
1119 color("blue") intersection(){ Lid(); TestSelectLidFrame(); }
1122 color("orange") HingeLever();
1123 color("black") HingeScrews();
1127 module DemoHinge(){ ////toplevel
1129 translate([0,0, -hp_k*3])
1133 module DemoProfiles(){ ////toplevel
1137 translate([0,0,-1]) color("black") KeeperProfile(1);
1143 demopoint_QR = [ bppS[0], bppQ[1] - 0.1];
1145 color("blue") ButtonCoverProfile();
1147 rectfromto(bppQ, demopoint_QR);
1148 rectfromto(bppR, demopoint_QR);
1152 translate([-20,0]) {
1153 color("black") ButtonPlanForDemo(-2, 0,1);
1154 color("red" ) ButtonPlanForDemo(-4, 1,1);
1155 color("blue") ButtonPlanForDemo(-6, 1,0);
1158 translate([0, -30]) {
1161 color("blue") HingeLidProfile();
1162 color("red") HingeBaseProfile();
1163 color("black") translate([0,0,-2]) HingeLeverOuterProfile();
1164 color("orange") translate([0,0,-1]) HingeLeverInnerProfile();
1167 translate([20,-30]) {
1170 //translate([0,0,1]) CatchCutProfile();
1171 color("blue") CatchCatchProfile();
1172 color("red") difference(){ EdgeProfile(); CatchCutProfile(); }
1175 translate([40,-30]) {
1179 PropProfile(10, 1, 0);
1184 translate([60,-30]) {
1185 PropAggregateProfile();