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 // 1: simply an opening
20 // 2: opening with separate cover model, for printing in clear (two colour)
21 // 3: like 2 but one-layer window for ad-hoc multi-colour
23 initial_layer_thick = 0.400; // ^ needed for mode 3 only
24 multicolour_gap = 0.15; // each side
28 button_cutout_depth = 9;
30 phone_edge_thick = 9.0;
31 phone_total_thick = 12.0;
32 phone_backside_slope_inner = 1.5; // larger means shallower
33 phone_backside_slope_outer = 1.0; // larger means shallower
35 camera_pos_tl = [ 6.450, 12.750 ]; // measured from tl corner
36 camera_pos_br = [ 22.300, 37.600 ]; // tl/br as seen from back
38 jack_pos = [ 13.83, 8.485 ];
39 jack_dia = 10.64 + .5; // some jack I had lying around
41 led_pos = [ 12.50, 8.00 ];
43 led_windowledge = 0.75; // each side
45 noisecancelmic_pos = [ 19.54, 7.37 ]; // from rhs
46 noisecancelmic_dia = 4.00;
48 //fingerpushhole_dias = [ 15, 18 ];
49 fingerpushhole_dias = [];
51 rearspeaker_pos_bl = [ 12.64, 18.72 ];
52 rearspeaker_size = [ 3.76, 7.36 ];
54 microusb_above = 3.27 - 0.25;
56 microusb_width = 16.12 + 1.25;
63 case_struts_count = 6;
64 case_struts_solid_below = 1.00;
65 case_struts_solid_above = 0.75;
66 case_struts_width = 0.10;
70 keeper_inner_width = 2.75;
71 keeper_inner_height = 2.75;
72 keeper_slant_slope = 2; // larger means steeper
74 keeper_gap_z_top = 0.25;
75 keeper_gap_z_bot = 0.75;
77 keeper_gap_x_holes = 0.75;
79 keeper_side = 0; // 0 = lhs; 1 = rhs
90 foldover_lever_gap = 0.50;
92 // properties of the hinge fasteners
93 hingescrew_shaft_dia = 2.0 + 0.25; // M2 x 12mm machine screw
94 hingescrew_shaft_len = 12;
95 hingescrew_fasteners_extra_thick = 0.40;
96 // ^ amount of thread protruding if everything was completely nominal
97 // and we are using two nuts
98 hingescrew_nut_access_dia = 4.72 + 0.50;
99 // ^ washer is 4.72 dia
100 // also, want to get pliers or tiny spanner in to do up locknut
101 hingescrew_nut_across = 3.92 + 0.25; // incl. slop around recess slop
102 hingescrew_nut_thick = 1.93;
103 hingescrew_head_th = 1.38 + 0.75;
104 hingescrew_head_dia = 3.92;
106 hingescrew_nut_recess_portion = 2/3; // portion of nut in recess
108 lever_cover_th = 0.75;
110 hingemount_wd = 4.8725;
115 button_l_fudge = 4.4;
116 buttonishleg_default_l_is_fudge = 10;
118 hinge_base_slope = 1.5; // bigger is steeper
120 strut_min_at_end = 1.5;
123 hinge_x_postscrew_gap = 0.75;
124 hinge_x_arms_gap = 0.35;
125 hinge_r_arms_gap = 0.55;
127 rearspeaker_gap = [ 2.0, 2.0 ]; // each side
131 catch_thickness = 1.0;
132 catch_side_gap = 0.75; // each side
136 catch_finger_height = 1.5;
137 catch_finger_depth = 2.5;
139 prop_recess_under = 0.50;
140 prop_recess_slop = 0.200; // each side
145 prop_side_gap = 0.75; // each side
146 prop_lidrecess_behind = 0.75;
147 prop_caserecess_behind = 0.75;
148 prop_caserecess_taper = 0.45; // one side only
150 prop_prong_heel_slope = 0.5;
152 // ---------- calculated ----------
154 phone_width = (phone + bumper*2)[0];
155 phone_height = (phone + bumper*2)[1];
157 inside_br = [phone_width, -phone_height];
159 prop_prong_h = prop_main_th;
161 //echo(camera_pos_tl + bumper,
162 // camera_pos_br + bumper);
164 // ----- could be changed -----
165 lid_buttoncover_gap = lid_gap_x;
166 lid_buttoncover_overlap = case_th_lip + keeper_gap_z_top;
168 phone_backside_slope_thick = phone_total_thick - phone_edge_thick;
170 //prop_lidrecess_depth = case_th_lid - prop_recess_under;
172 //prop_nose_len = case_th_lid - prop_recess_under;
173 //prop_recess_slope = tan(prop_max_angle); // bigger means steeper
174 //prop_recess_width = prop_main_th / cos(prop_max_angle) + prop_backfwd_gap;
177 //lid_lip_overlap_width xxx bad name = ;
178 //lid_lip_inner_slope = [ 5, 5 ]; // xxx
181 epp1 = [0, -phone_edge_thick];
182 epp2i = epp1 + phone_backside_slope_thick * [ phone_backside_slope_inner, -1 ];
183 epp2o = epp1 + phone_backside_slope_thick * [ phone_backside_slope_outer, -1 ];
184 epp3 = epp2i + [10, 0];
185 epp5 = epp0 + [0,1] * (keeper_th_z + keeper_gap_z_top + case_lip);
186 epp4 = epp5 + [-1,0] * case_th_side;
189 kppd = kppe + [1,0] * keeper_inner_width;
190 kppc = kppd + [0,1] * keeper_th_z;
191 kppb = [ kppe[0] - keeper_th_x, kppc[1] ];
192 kppf = kppe - [0,1] * keeper_inner_height;
193 kppa = [ kppb[0], kppf[1] ];
195 lpp10 = [ epp5[0] + lid_gap_x, kppc[1] + lid_gap_z ];
196 lpp11 = [ lpp10[0], epp5[1] + lid_gap_z ];
198 lp_r12 = case_th_lid - (lpp11[1] - lpp10[1]);
200 lpp12 = [ epp4[0] + lp_r12, lpp11[1] ];
201 lpp13 = [ lpp12[0], lpp12[1] + lp_r12 ];
203 case_bottom_z = epp2o[1] - case_th_bottom;
207 bppN = [ 0.5 * (epp0[0] + epp4[0]), bppM[1] ];
208 bppR = [ bppN[0] + lid_buttoncover_gap, -button_cutout_depth ];
209 bppS = [ epp1[0], bppR[1] ];
210 bppQ = [ bppM[0], bppR[1] - lid_buttoncover_overlap ];
211 bppP = bppQ + [0,1] * lid_buttoncover_gap;
212 bppO = [ bppN[0], bppP[1] ];
213 bppL = lpp10 + [5,0];
214 bppK = [ bppL[0], bppN[1] ];
215 bppJ = [ bppN[0], bppL[1] ];
216 bppU = [ bppJ[0], lpp12[1] ];
220 // notification led aperture
222 nla_r0 = led_aperture/2;
223 nla_r1 = nla_r0 + led_windowledge;
224 nla_r2 = nla_r1 + multicolour_gap;
226 led_window_style >= 3 ? initial_layer_thick :
227 led_window_style >= 2 ? led_window_ledge : 0;
231 hp_rn = hingescrew_nut_access_dia/2;
232 hp_r2_min = hp_rn + lever_cover_th;
233 hp_rs = hingescrew_shaft_dia/2;
234 hp_r1_min = hp_rs + hingemount_th;
236 hp_r1 = max(hp_r1_min, hp_r2_min);
240 hppS = epp2o + [0,-1] * case_th_bottom;
241 hp_k = 0.5 * (hppU[1] - hppS[1] + foldover_gap);
243 hppM = [ epp4[0] - foldover_lever_gap - hp_r2,
244 0.5 * (hppU + hppS)[1] ];
245 hppT = [ hppM[0], hppU[1] - hp_r1 ];
246 hppB = hppT + [0,-1] * hp_k;
248 hppE_y = epp2o[1] - case_th_bottom + hp_r1;
249 hppE_x = hppB[0] + (hppB[1] - hppE_y) * hinge_base_slope;
250 hppE = [ hppE_x, hppE_y ];
252 // hinge elevation x coords
254 hex20 = max(epp2o[0],
256 kppd[0] + hingescrew_head_th + keeper_gap_x_holes);
257 hex21 = hex20 + hingemount_wd;
258 hex22 = hex21 + hinge_x_gap;
259 hex27 = hex20 + hingescrew_shaft_len;
260 hex24 = hex27 + hinge_x_postscrew_gap;
261 hex23 = hex27 - (hingescrew_nut_thick*2
262 + hingescrew_fasteners_extra_thick);
263 hex26 = hex23 + hingescrew_nut_thick * 2/3;
265 echo(hex20, hex21, hex22, hex23, hex24);
266 // 6, 10.8725, 10.9975, 13.74, 18.75
267 module chk(act,exp) {
268 if (abs(act-exp) > 1e-9) echo("WRONG", act, exp);
269 else echo("ok", act);
279 cppJ = [ epp4[0] + catch_thickness, lpp10[1] ];
280 cppA = cppJ + [lid_gap_x, -lid_gap_z];
281 cppB = [ epp0[0], cppA[1] ];
282 cppP = [ epp4[0], cppJ[1] ];
284 cppS = cppJ + [0,-1] * catch_len;
285 cppD = [ cppA[0], cppS[1] + catch_slop ];
286 cppC = [ cppB[0], cppD[1] ];
287 cppT = cppS + [1,0] * catch_depth;
288 cppU = cppT + [0,-1] * catch_height;
289 cppV = [ cppS[0], cppU[1] - catch_depth ];
291 cppR = 0.5*(cppP + cppJ);
293 cp_rQ = 0.5 * (cppJ[0] - cppP[0]);
295 cppV[1] - (catch_finger_height - cp_rQ) ];
296 cppF = [ cppV[0] + catch_finger_depth, cppC[1] ];
298 // prop recess in case
300 prop_x_pos = phone_width/2;
302 prop_recess_hw = 0.5 * prop_main_width + prop_side_gap;
304 prc_r1 = prop_end_dia/2;
305 prc_r3 = prc_r1 + prop_recess_slop;
307 prcp2 = [ epp4[0] + prop_buildout_less,
310 prop_caserecess_buildout_r = -1; // prcp2[0] - epp2o[0];
312 prcp1 = [ epp2o[0] + prc_r3 + prop_caserecess_behind,
313 epp2i[1] - prc_r3 - prop_recess_under];
315 // prop recess in lid
317 prl_r10 = prop_end_dia/2;
318 prl_r10o = prl_r10 + prop_recess_slop;
320 prlp10 = lpp10 + [1,1] * prl_r10o
321 + [1,0] * prop_lidrecess_behind
322 + [0,1] * prop_recess_under;
327 $prpp11 = [0, prop_taper_len];
331 // ---------- modules ----------
333 module KeeperProfile(slant=0){
334 use_e = kppe + [0,-1] * slant * keeper_inner_width / keeper_slant_slope;
335 polygon([use_e, kppd, kppc, kppb, kppa, kppf]);
338 module EdgeProfile(){
341 translate(epp3) square(case_th_bottom*2, center=true);
342 circleat(epp2o, r=case_th_bottom);
343 circleat(epp1, r=case_th_side);
344 rectfromto(epp0, epp4);
346 polygon([ epp5 + [0,10],
353 module LidEdgeProfile(){
362 circleat(lpp12, r=lp_r12);
363 rectfromto( lpp12 + [-10, 0],
364 lpp12 + [+10, +10] );
368 module ButtonCoverProfile(){
370 polygon(concat([ bppM, bppP, bppO, bppJ ],
371 (enable_support ? [ bppU, bppV, bppW ] : []),
380 module ButtonPlan(l, deep, cut){
382 (cut ? 0 : lid_buttoncover_gap);
385 (deep ? lid_buttoncover_overlap : 0);
387 C = [0,0]; // by definition
391 B0 = C + [0,-1] * button_cutout_depth;
392 B1 = B0 + [0,1] * epsilon;
394 r0 = 0.5 * (T[1] - B0[1]);
395 A = [ -(l + button_l_fudge)/2 + r0, 0.5 * (T[1] + B0[1]) ];
396 H = A + [0,-1] * delta;
402 E1 = E0 + [1,0] * epsilon;
404 I0 = [ E0[0], H[1] ];
405 I1 = [ E1[0], H[1] ];
408 for (m=[0,1]) mirror([m,0])
409 circleat(H, r0 - epsilon);
411 for (m=[0,1]) mirror([m,0]) {
421 circleat(D, r0 + epsilon);
426 module CatchCatchProfile(){
428 for (c=[ cppR, cppQ ])
432 circleat(lpp12, lp_r12);
433 circleat(lpp12 + [5,0], lp_r12);
434 rectfromto(cppP, cppP + [5,0.1]);
436 polygon([cppJ, cppS, cppT, cppU, cppV, cppQ, cppR]);
439 module CatchCutProfile(){
451 module Flip_rhs(yn=[0,1]) {
453 translate([phone_width/2, 0, 0])
454 mirror([$rhsflip,0,0])
455 translate([-phone_width/2, 0, 0])
460 module Flip_bot(yn=[0,1]) {
462 translate([0, -phone_height/2, 0])
463 mirror([0, $botflip, 0])
464 translate([0, phone_height/2, 0])
469 module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
472 translate([0, -phone_cnr_rad, 0])
474 linear_extrude(height = phone_height - phone_cnr_rad*2)
478 Flip_rhs() Flip_bot() {
479 translate([+1,-1] * phone_cnr_rad)
484 translate([-1,0] * phone_cnr_rad)
486 rectfromto([0,-20],[10,20]);
488 translate([-10, 0, -20] + 0.01 * [+1,-1, 0] )
494 translate([ phone_width - phone_cnr_rad, 0,0 ])
496 linear_extrude(height = phone_width - phone_cnr_rad*2)
500 translate([0,0, fill_zstart])
501 mirror([0,0, fill_downwards])
502 linear_extrude(height = fill_th)
503 rectfromto([+1,-1] * phone_cnr_rad,
504 [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
507 module CaseAperture(pos, dia, $fn) {
509 translate([ pos[0] + bumper[0],
512 rotate([-90, theta, 0])
513 cylinder(r = dia/2 / cos(theta),
517 module SideButton(y, y_ref_sign, l){
519 // +1 measured from top of actual phone to top of button
520 // -1 measured from bottom of actual phone to bottom of button
521 // 0 y is centre of button in coordinate system
523 eff_y = y_ref_sign > 0 ? -bumper [1] -y -l/2 :
524 y_ref_sign < 0 ? (-phone -bumper)[1] +y +l/2 :
527 translate([0, eff_y, 0])
531 module LidButtonishLeg(y, y_ref_sign, l=buttonishleg_default_l_is_fudge) {
532 $button_leg_only = true;
533 SideButton(y, y_ref_sign, l) children();
537 Flip_rhs(1) SideButton(15.580, +1, 8.9) children(); // power
538 Flip_rhs(1) SideButton(48.700, -1, 8.920) children(); // camera
539 Flip_rhs(0) SideButton(30.800, +1, 21.96) children(); // volume
540 Flip_rhs( ) LidButtonishLeg(14, -1) children();
541 // Flip_rhs(0) LidButtonishLeg(20, +1, 20) children();
544 module Struts(x_start, z_min, th){
545 // if th is negative, starts at z_min and works towards -ve z
546 // and object should then be printed other way up
547 for (i= [1 : 1 : case_struts_count]) {
551 mirror([0,0, th<0 ? 1 : 0])
553 -phone_height * i / (case_struts_count+1),
554 case_struts_solid_below])
555 linear_extrude(height= abs(th)
556 -(case_struts_solid_below+case_struts_solid_above))
557 rectfromto([ x_start, -0.5 * case_struts_width ],
558 [ phone_width - x_start, +0.5 * case_struts_width ]);
562 module OrdinaryRearAperture(rhs,bot, pos){
563 Flip_rhs(rhs) Flip_bot(bot)
566 translate(pos + bumper)
574 linextr(-epp2i[0], 60)
575 translate([0.5 * phone_width, 0, 0])
576 rectfromto([-microusb_width/2, epp2i[1] + microusb_below],
577 [+microusb_width/2, epp0[1] + -microusb_above]);
581 module OrdinaryRearApertures(){
583 OrdinaryRearAperture(1,1, rearspeaker_pos_bl)
584 rectfromto(-rearspeaker_gap,
585 rearspeaker_size + rearspeaker_gap);
587 // finger hole to remove phone
588 if (len(fingerpushhole_dias))
589 OrdinaryRearAperture(1,0, [ fingerpushhole_dias[0]/2 + epp2i[0],
591 scale(fingerpushhole_dias)
595 module RearCameraAperture(){
598 linear_extrude(height = 20)
601 rectfromto(camera_pos_tl, camera_pos_br);
604 module HingeLidProfile(){
606 circleat(hppT, hp_r1);
607 circleat(lpp12, lp_r12);
615 module HingeBaseProfile(){
618 circleat(hppB, hp_r1);
619 circleat(hppE, hp_r1);
620 circleat(epp2o, case_th_bottom);
621 circleat(hppB + [10,0], hp_r1);
623 polygon([epp5, epp1, epp2i, epp3, bppL]);
627 module HingeLeverOuterProfile(){
629 circleat(hppT, hp_r2);
630 circleat(hppB, hp_r2);
634 module HingeLeverInnerProfile(){
636 c = s > 0 ? hppT : hppB;
639 rotate(s<0 ? -40 : 0)
648 module HingeLeverNutProfile(){
649 for (c= [hppB, hppT]) {
651 circle($fn=6, r= 0.5 * hingescrew_nut_across / cos(30));
655 module Flip_hinge(doflip=1){
656 hinge_origin = [0, -(phone_height - hppB[0]), hppB[1]];
657 translate(hinge_origin)
658 rotate([doflip*180,0,0])
659 translate(-hinge_origin)
663 module HingePortion(x0,x1){
664 Flip_rhs() Flip_bot(1)
668 linear_extrude(height=x1-x0)
672 module CatchPortion(width){
673 translate([phone_width/2, 0,0])
675 linextr(-width/2, width/2)
680 AroundEdges(epp3[1], case_th_bottom, 1)
684 function prop_x(gamma) = hp_k / (2 * sin(gamma/2)) - hppT[0];
686 module PropProfileAssignments(gamma){
687 // https://en.wikipedia.org/wiki/Solution_of_triangles#Two_sides_and_the_included_angle_given_(SAS)
689 p = phone_height + prlp10[0] - hppB[0];
692 q = phone_height - hppT[0] - prcp1[0]; // $prpp7[0] is 0 by definition
694 c = sqrt(a*a + b*b - 2*a*b*cos(gamma));
695 $prp_alpha = acos( (b*b + c*c - a*a) / (2*b*c) );
697 $prp_theta = 90 - $prp_alpha;
698 beta = 180 - $prp_alpha - gamma;
701 //echo("abc", a,b,c);
703 v1 = [ [ cos(psi), -sin(psi) ], // x
704 [ sin(psi), cos(psi) ] ]; // y
706 $prpp7 = [0, c + (lpp13[1] - $prpp10[1] - hp_k) ];
709 $prp_r11 = prop_main_th/2;
711 $prpp1 = $prpp7 + [1,0] *
712 // this is approximate, but will do
713 (prop_main_th/2 + prop_prop_gap + prcp1[0] - cppA[0]);
716 v1[1] * ((prcp2[1] - prcp1[1]) - prop_prop_gap);
717 $prpp12 = $prpp3 + v1[0] *
718 (prop_end_dia + prop_caserecess_taper * ($prpp1[1] - $prpp3[1]));
719 $prp_r8 = prop_main_th;
720 $prpp4 = [ prop_main_th/2, $prpp3[1] ];
722 $prpp5 = [ $prpp12[0] - $prp_r5,
723 $prpp3[1] - prop_prong_h + $prp_r5 ];
724 $prpp6 = $prpp4 + [0,-1] * (prop_prong_h +
725 prop_prong_heel_slope * ($prpp5[0] - $prpp4[0]));
726 $prpp8 = $prpp4 + [0,-1] * $prp_r8;
727 $prpp9 = $prpp8 + [-1,0] * $prp_r8;
732 module PropProfile(gamma, cut=0, rot=0){ ////toplevel
733 PropProfileAssignments(gamma){
735 //#circleat($prpp3,1);
736 //#circleat($prpp12,1);
743 polygon([[-20,-0], [20,20], [0,0]]);
745 rectfromto($prpp6, $prpp9);
746 translate($prpp5) intersection(){
748 polygon([[-10,-10], [0,0], [10,0]]);
750 rectfromto($prpp12 + [0,-0.1], $prpp3);
753 circleat($prpp1, $prp_r1);
754 rectfromto($prpp12 + [0,-0.1], $prpp3);
758 rotate([0,0, rot*-$prp_theta]){
760 extra = cut ? prop_recess_slop : 0;
761 rectfromto($prpp6, $prpp9);
762 circleat($prpp11, $prp_r11 + extra);
763 circleat($prpp10, $prp_r10 + extra);
769 module PropAggregateProfile(){
770 for (angle = prop_angles)
771 PropProfile(angle, 0,0);
774 module Prop(){ ////toplevel
775 hw = prop_main_width/2;
777 PropAggregateProfile();
780 module Case(){ ////toplevel
785 // ledge (fixed keeper)
786 Flip_rhs(1-keeper_side) intersection(){
788 linear_extrude(height = phone_height + phone_cnr_rad * 2)
791 // outline of the whole case, to stop it protruding
792 translate([0,0, -25])
793 linear_extrude(height = 50)
796 circleat([+1,-1] * phone_cnr_rad, phone_cnr_rad + case_th_side/2);
800 HingePortion(hex20, hex21) HingeBaseProfile();
802 // buildout for prop recess
803 if (prop_caserecess_buildout_r > 0) Flip_rhs(1)
804 linextr(case_bottom_z, epp2i[1])
807 circleat([ prop_x_pos + dxs * prop_caserecess_buildout_r,
809 r = epp2o[0] - prcp2[0]);
814 Flip_rhs(keeper_side)
815 translate([0, -phone_cnr_rad, 0])
817 linear_extrude(height = phone_height + phone_cnr_rad * 2)
820 rectfromto([ -keeper_gap_x, -keeper_gap_z_bot ],
821 [ keeper_gap_x_holes, +keeper_gap_z_top ]);
825 RearCameraAperture();
827 // struts (invisible, because they're buried in the case)
828 Struts(epp2i[0], epp2i[1] - case_th_bottom, case_th_bottom);
833 if (!($button_leg_only && enable_support))
836 linear_extrude(height= 20)
837 ButtonPlan($button_l, 0,1);
838 if ($button_leg_only)
840 translate([phone_width/2, -400, kppe[1]])
841 mirror([1-abs($rhsflip - keeper_side),0,0])
842 cube([400, 800, 50]);
845 translate([-400, -400, kppd[1]])
849 translate([0,0, -bppR[0]])
850 linear_extrude(height= 20)
851 ButtonPlan($button_l, 1,1);
856 // apertures along top edge
857 CaseAperture(jack_pos, jack_dia, 8);
859 CaseAperture(noisecancelmic_pos, noisecancelmic_dia, 8);
861 OrdinaryRearApertures();
865 // gaps for the lid's hinge arms
866 HingePortion(hex20 - hinge_x_arms_gap,
867 hex21 + hinge_x_arms_gap)
870 circle(r= hinge_r_arms_gap, $fn= 8);
873 // screw holes in the hinge arms
877 CatchPortion(catch_width + catch_side_gap*2)
882 translate([prop_x_pos,0,0])
885 linextr(-prop_recess_hw, +prop_recess_hw)
887 for (d=[ [0,0], [0,-1], [+1,-1/prop_caserecess_taper] ])
888 circleat(prcp1 + 20*d,
894 module Lid(){ ////toplevel
897 AroundEdges(lpp10[1], lpp13[1] - lpp10[1], 0)
905 linear_extrude(height= 20)
906 ButtonPlan($button_l, 1,0);
908 translate([0,0,-100])
909 linear_extrude(height= 200)
910 ButtonCoverProfile();
915 HingePortion(hex20, hex21) HingeLidProfile();
918 CatchPortion(catch_width)
921 Struts(lpp10[0] + strut_min_at_end, lpp13[1], -case_th_lid);
923 // screw holes in the hinge arms
927 translate([prop_x_pos, -prlp10[0], prlp10[1]])
930 linextr(-prop_recess_hw, +prop_recess_hw)
932 for (pa = prop_angles)
933 PropProfile(pa, 1,1);
935 // notification led aperture
936 if (led_window_style)
937 translate([led_pos[0], -led_pos[1], lpp13[1]]) {
939 cylinder(r=nla_r0, h=20);
940 if (led_window_style >= 2)
941 translate([0,0, -nla_t])
942 cylinder(r=nla_r2, height=20);
947 module HingeLever(){ ////toplevel
949 // outer body, positive
950 HingePortion(hex22, hex22 + phone_width/2)
951 HingeLeverOuterProfile();
953 // space for the screws
954 HingePortion(hex26, hex24)
955 HingeLeverInnerProfile();
957 // recesses for the nuts
958 HingePortion(hex23, hex26+1)
959 HingeLeverNutProfile();
961 // bores for the screws
964 // space for the charging cable
966 Flip_hinge() MicroUSB();
970 module HingeLeverPrint(){ ////toplevel
972 translate([-phone_width/2, phone_height, 0])
976 module TestSelectLength(){
977 translate([-30, -200, -20])
978 cube([30 + 15, 250, 40]);
981 module TestLength(){ ////toplevel
988 module TestLengthRight(){ ////toplevel
996 module TestSelectWidth(){
997 translate([-30, -(phone_height - 25), -20])
1002 module TestWidth(){ ////toplevel
1009 module TestLidWidthPrint(){ ////toplevel
1010 rotate([0,180.0]) intersection(){
1016 module TestSelectRearAperture(){
1019 translate([20, 0,0])
1020 cube([42, 2, 1], center=true);
1024 module TestSelectCamera(){
1026 TestSelectRearAperture()
1027 RearCameraAperture();
1028 cube([0.1, 50, 0.1]);
1032 module TestSelectOrdinaryRearApertures(){
1033 TestSelectRearAperture()
1034 OrdinaryRearApertures();
1037 module TestCamera(){ ////toplevel
1044 module TestLidByCamera(){ ////toplevel
1051 module TestLidByCameraPrint(){ ////toplevel
1052 rotate([180,0,0]) TestLidByCamera();
1055 module DemoByCamera(){ ////toplevel
1056 color("blue") TestLidByCamera();
1057 color("red") TestCamera();
1060 module OneKeeper(){ ////toplevel
1061 translate([0, -phone_cnr_rad, 0])
1063 linear_extrude(height = phone_height - phone_cnr_rad * 2)
1067 module OneKeeperPrint(){ ////toplevel
1072 module LidPrint(){ ////toplevel
1077 module TestSelectFrame(){
1078 include = [1,-1] * (epp2i[0] + 4);
1081 cube(1000, center=true);
1082 translate([0,0, -100])
1083 linear_extrude(height=200)
1084 rectfromto(include, inside_br - include);
1088 module TestSelectLidFrame(){
1092 module TestFrameCase(){ ////toplevel
1098 TestSelectOrdinaryRearApertures();
1103 module TestTopApertures(){ ////toplevel
1107 translate([-100, -35, -100])
1108 cube([400, 100, 200]);
1112 module TestFrameLidPrint(){ ////toplevel
1113 rotate([0,180,0]) intersection(){
1115 TestSelectLidFrame();
1119 module ButtonPlanForDemo(z, deep, cut){
1121 ButtonPlan(8, deep, cut);
1124 module HingeScrews(){
1125 Flip_rhs() Flip_bot(1){
1126 for (c= [ hppT, hppB ])
1131 translate([0,0,-.2])
1132 cylinder( r= hingescrew_shaft_dia/2,
1133 h = hingescrew_shaft_len+0.2 );
1135 translate([0,0,+.1])
1136 cylinder( r= hingescrew_head_dia/2, h = hingescrew_head_th );
1141 module DemoPropAngleSelect(c){
1142 color(c) difference(){
1143 union(){ children(); }
1144 translate([ prop_x_pos, -400, -200 ])
1145 cube([ 400,800,400 ]);
1149 module DemoPropAngle(ang){
1150 hL = [0, -(phone_height - hppT[0]), hppT[1] - hp_k*2];
1151 hC = [0, -(phone_height - hppB[0]), hppB[1]];
1159 DemoPropAngleSelect("red") Case();
1162 translate([prop_x_pos, -prcp1[0], prcp1[1]])
1163 PropProfileAssignments(ang) {
1165 rotate([-$prp_theta, 0, 0])
1166 translate([0, $prpp1[0], -$prpp1[1]])
1172 translate([0,0, -hp_k*2])
1173 DemoPropAngleSelect("blue")
1177 module DemoPropAngles(){ ////toplevel
1178 for (i=[0 : len(prop_angles)-1])
1179 translate(i * [0, -100, 100])
1180 DemoPropAngle(prop_angles[i]);
1183 module DemoFrame(){ ////toplevel
1184 color("red") TestFrameCase();
1185 color("blue") intersection(){ Lid(); TestSelectLidFrame(); }
1186 color("black") HingeScrews();
1190 module DemoHingedFrame(){ ///toplevel
1191 color("red") TestFrameCase();
1192 translate([0,0, -2*hp_k])
1193 color("blue") intersection(){ Lid(); TestSelectLidFrame(); }
1196 color("orange") HingeLever();
1197 color("black") HingeScrews();
1201 module DemoHinge(){ ////toplevel
1202 translate([ -0.5*phone_width, phone_height, hp_k*3 ]) {
1204 translate([0,0, -hp_k*3])
1209 module DemoProfiles(){ ////toplevel
1213 translate([0,0,-1]) color("black") KeeperProfile(1);
1219 demopoint_QR = [ bppS[0], bppQ[1] - 0.1];
1221 color("blue") ButtonCoverProfile();
1223 rectfromto(bppQ, demopoint_QR);
1224 rectfromto(bppR, demopoint_QR);
1228 translate([-20,0]) {
1229 color("black") ButtonPlanForDemo(-2, 0,1);
1230 color("red" ) ButtonPlanForDemo(-4, 1,1);
1231 color("blue") ButtonPlanForDemo(-6, 1,0);
1234 translate([0, -30]) {
1237 color("blue") HingeLidProfile();
1238 color("red") HingeBaseProfile();
1239 color("black") translate([0,0,-2]) HingeLeverOuterProfile();
1243 translate([-30, -60 + 30*f]) {
1244 translate([0,0,-4]) EdgeProfile();
1245 %translate([0,0,-10]) HingeBaseProfile();
1246 translate([0,-2] * f * hp_k) {
1247 translate([0,0,-4]) LidEdgeProfile();
1248 %translate([0,0,-10]) %HingeLidProfile();
1250 translate(+hppB) rotate([0,0,180*f]) translate(-hppB) {
1251 translate([0,0,-2]) color("black") HingeLeverOuterProfile();
1252 translate([0,0,0]) color("red") difference(){
1253 HingeLeverOuterProfile();
1254 HingeLeverInnerProfile();
1256 translate([0,0,3]) color("yellow") HingeLeverNutProfile();
1261 translate([20,-30]) {
1264 //translate([0,0,1]) CatchCutProfile();
1265 color("blue") CatchCatchProfile();
1266 color("red") difference(){ EdgeProfile(); CatchCutProfile(); }
1269 translate([40,-30]) {
1273 PropProfile(10, 1, 0);
1278 translate([60,-30]) {
1279 PropAggregateProfile();