diff --git a/main.scad b/main.scad index ecab914..5bee777 100644 --- a/main.scad +++ b/main.scad @@ -9,6 +9,7 @@ use //validation = 1; XRAY_POSITIVE=1; XRAY_BACKPLANE=2; +XRAY_BOTTOM=3; //xray = 2; // EXPORT: @@ -18,7 +19,8 @@ MODEL_HARNESS_BOTTOM_PIP=3; MODEL_HARNESS_TOP=4; MODEL_HARNESS_SLIDER_FRONT=5; MODEL_HARNESS_SLIDER_BACK=6; -export=3; // [0:6] +MODEL_HARNESS_BUTTONS=7; +export=0; // [0:7] function is_not_export() = is_undef(export) || export == 0; function is_export() = !is_not_export(); function is_model_strict(m) = is_export() && export == m; @@ -57,7 +59,7 @@ module phone_harness() { rim_edge_tolerance=0.4; expose_back_camera=false; screwmount_screw=3; - harness_divider=[16, 0, 1.3]; + harness_divider=[1, 0, 1.3]; harness_size=[ps.x+shell_wall*2, ps.y+shell_wall*2, ps.z+shell_wall*2]; rim_size=[harness_size.x+2*shell_rim_wall, harness_size.y+2*shell_rim_wall, 6]; @@ -151,11 +153,19 @@ module phone_harness() { rail_wall=1; slider_slop=0.1; slider_len_back=hs.x*0.3; - slider_len_front=hs.x*0.3; + slider_len_front=hs.x*0.15; module harness_slider(l) { base=2; ss=[l, shell_rim_wall, rim_size.z+rail_wall*2]; - up(ss.y + base) xrot(180) slider(l=ss.x, w=ss.z, h=ss.y, base=base, chamfer=0.9, wall=2, ang=rail_angle, slop=slider_slop, orient=ORIENT_X, align=V_UP); + up(ss.y + base) xrot(180) difference() { + slider(l=ss.x, w=ss.z, h=ss.y, base=base, chamfer=0.9, wall=2, ang=rail_angle, slop=slider_slop, orient=ORIENT_X, align=V_UP); + screws=2; + screws_area_l=0.7*l; + for (i=[0:screws-1]) { + $fn=$preview ? 6 : 16; + #right(-screws_area_l/2 + screws_area_l/(screws-1) * i) cylinder(d2=screwmount_screw*0.5, d1=screwmount_screw, h=ss.y/2); + } + } } module harness_rail(l) { sw=2; @@ -246,13 +256,53 @@ module phone_harness() { } // -- FRONT -- + buttons_cutout_size=[42, 100, 4.5]; + buttons_cutout_pos=[ps.x/2 - 44.5, -ps.y/2 - 3, 0.25]; module buttons_cutout() { - s=[42, 100, 5]; - fwd(ps.y/2) right(ps.x/2 - 44.5) cubi(s, fillet=1); + s=buttons_cutout_size; + p=buttons_cutout_pos; + translate(p) cubi(s, fillet=1); } module front_cutout() { buttons_cutout(); } + module front_buttons(socket) { + s=[buttons_cutout_size.x-2, 4, buttons_cutout_size.z-0.5]; + p=buttons_cutout_pos; + t=socket ? 0.2 : 0; + pin_size=[3 + t, 3 + t, s.z+1.4 + t/2]; + touch_size=[2, s.y, 2]; + touch_power_size=[3, touch_size.y, touch_size.z]; + translate(p) { + cs=[4, s.y, s.z]; + left(5) { + bs=[13, s.y, s.z]; + left(bs.x/6) cubi(pin_size); + left(bs.x/2) { + difference() { + cubi(bs); + back(2) cubi(cs); + } + } + fwd(1) left(bs.x*0.8) cubi(touch_power_size, fillet=1); + } + right(8) { + bs=[18, s.y, s.z]; + cubi(pin_size); + difference() { + cubi(bs); + back(2) { + left(bs.x/4) cubi(cs); + right(bs.x/4) cubi(cs); + } + } + fwd(1) { + left(bs.x*0.4) cubi(touch_size, fillet=1); + right(bs.x*0.4) cubi(touch_size, fillet=1); + } + } + } + } // ==== MODEL ==== @@ -281,6 +331,7 @@ module phone_harness() { shell(); shell_rim_edge(rim_edge_thickness, groove=true, tolerance=rim_edge_tolerance); shell_cutouts(); + front_buttons(socket=true); } } shell_backplane(groove=false); @@ -291,11 +342,13 @@ module phone_harness() { difference() { shell(); shell_cutouts(); + front_buttons(socket=true); } } difference() { shell_rim_edge(rim_edge_thickness, groove=false); shell_cutouts(); + front_buttons(socket=true); } } module model_harness_slider_front() { @@ -307,6 +360,9 @@ module phone_harness() { module model_harness_slider_back() { back(hs.y/2) xrot(-90) harness_slider(slider_len_back); } + module model_harness_buttons() { + front_buttons(socket=false); + } if (is_model(MODEL_HARNESS_LEFT)) model_harness_left(); if (is_model(MODEL_HARNESS_RIGHT)) model_harness_right(); @@ -317,6 +373,7 @@ module phone_harness() { if (is_model(MODEL_HARNESS_TOP)) model_harness_top(); if (is_model(MODEL_HARNESS_SLIDER_FRONT)) model_harness_slider_front(); if (is_model(MODEL_HARNESS_SLIDER_BACK)) model_harness_slider_back(); + if (is_model(MODEL_HARNESS_BUTTONS)) model_harness_buttons(); } module model() { @@ -335,6 +392,8 @@ if (!is_undef(validation)) { span_cube([0,1000], [0,1000], [-1000,1000]); } else if (xray == XRAY_BACKPLANE) { span_cube([-1000,1000], [-1000,1000], [-1000,-7]); + } else if (xray == XRAY_BOTTOM) { + span_cube([-1000,1000], [-1000,1000], [-1000,0]); } } union() {