2021-01-20 08:23:46 +00:00
|
|
|
include <export.scad>
|
|
|
|
|
2020-12-31 12:59:34 +00:00
|
|
|
// dependency: https://github.com/revarbat/BOSL
|
|
|
|
include <BOSL/constants.scad>
|
|
|
|
use <BOSL/transforms.scad>
|
|
|
|
use <BOSL/shapes.scad>
|
|
|
|
use <BOSL/masks.scad>
|
2020-12-31 22:51:48 +00:00
|
|
|
use <BOSL/sliders.scad>
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2021-01-20 11:56:26 +00:00
|
|
|
use <specs_phone.scad>
|
|
|
|
use <specs_harness.scad>
|
|
|
|
use <specs_platform.scad>
|
|
|
|
|
2020-12-31 12:59:34 +00:00
|
|
|
// DEBUG:
|
|
|
|
//validation = 1;
|
2021-01-11 13:38:06 +00:00
|
|
|
XRAY_POSITIVE=1;
|
|
|
|
XRAY_BACKPLANE=2;
|
2021-01-11 18:33:19 +00:00
|
|
|
XRAY_BOTTOM=3;
|
2021-01-11 13:38:06 +00:00
|
|
|
//xray = 2;
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2021-01-12 15:54:41 +00:00
|
|
|
function use_slideout_backplane() = is_model_strict(MODEL_HARNESS_BOTTOM_PIP) || is_model_strict(MODEL_HARNESS_LEFT) || is_model_strict(MODEL_HARNESS_RIGHT);
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2021-01-11 13:38:06 +00:00
|
|
|
backplane_pip_slideout=10;
|
|
|
|
|
2021-01-20 14:55:17 +00:00
|
|
|
use <common.scad>
|
2021-01-11 12:54:11 +00:00
|
|
|
|
2021-01-12 09:00:07 +00:00
|
|
|
module dotted_grill_cutout(vents_area, vents_x=10, vents_y=10, mesh=1.5, cut_corners=false) {
|
|
|
|
function is_corner(x, y, xm, ym) = (x == 0 || x == xm) && (y == 0 || y == ym);
|
|
|
|
vent_size=[vents_area.x/vents_x-mesh, vents_area.y/vents_y-mesh, vents_area.z];
|
|
|
|
translate([-vents_area.x/2 - vent_size.x/2, vents_area.y/2 - vent_size.y/2, 0])
|
|
|
|
for (x=[0:vents_x-1]) {
|
|
|
|
for (y=[0:vents_y-1]) {
|
|
|
|
if (!cut_corners || !is_corner(x, y, vents_x-1, vents_y-1)) {
|
|
|
|
right(x*(vent_size.x+mesh))
|
|
|
|
fwd(y*(vent_size.y+mesh))
|
|
|
|
cubi(vent_size, fillet=min(vent_size.x/2, vent_size.y/2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
module phone() {
|
|
|
|
s=get_phone_size();
|
|
|
|
color("gray")
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(s, fillet=5);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module arm() {
|
|
|
|
$fn=6;
|
|
|
|
s=[210, 55, 50];
|
|
|
|
color("SaddleBrown")
|
2021-01-11 12:54:11 +00:00
|
|
|
down(s.z/2 + get_phone_size().z/2) cubi(s, fillet=20);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module phone_harness() {
|
|
|
|
ops=get_phone_size();
|
|
|
|
ps=[ops.x+0.2, ops.y+0.2, ops.z+0.2];
|
2020-12-31 22:51:48 +00:00
|
|
|
shell_wall=3;
|
|
|
|
shell_rim_wall=3;
|
2021-01-11 21:00:51 +00:00
|
|
|
rim_edge_thickness=1.5;
|
2020-12-31 22:51:48 +00:00
|
|
|
rim_edge_tolerance=0.4;
|
2021-01-11 21:00:51 +00:00
|
|
|
expose_back_camera=true;
|
2020-12-31 22:51:48 +00:00
|
|
|
screwmount_screw=3;
|
2021-01-11 18:33:19 +00:00
|
|
|
harness_divider=[1, 0, 1.3];
|
2020-12-31 22:51:48 +00:00
|
|
|
harness_size=[ps.x+shell_wall*2, ps.y+shell_wall*2, ps.z+shell_wall*2];
|
2021-01-11 21:00:51 +00:00
|
|
|
rim_size=[harness_size.x+2*shell_rim_wall, harness_size.y+2*shell_rim_wall, 8];
|
2020-12-31 22:51:48 +00:00
|
|
|
|
2020-12-31 18:28:23 +00:00
|
|
|
w=shell_wall;
|
2020-12-31 12:59:34 +00:00
|
|
|
f=2;
|
|
|
|
rf=5;
|
2020-12-31 22:51:48 +00:00
|
|
|
hs=harness_size;
|
2021-01-11 21:00:51 +00:00
|
|
|
backplane_rim_size=[40, ps.y*0.95, shell_wall/2];
|
|
|
|
backplane_teeth=6;
|
2020-12-31 22:51:48 +00:00
|
|
|
|
|
|
|
// ==== SHELL ====
|
2020-12-31 12:59:34 +00:00
|
|
|
|
|
|
|
module shell() {
|
|
|
|
$fn = $preview ? 6 : 30;
|
|
|
|
difference() {
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(hs, fillet=f);
|
|
|
|
cubi(ps, fillet=f);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
shell_rim();
|
2020-12-31 18:28:23 +00:00
|
|
|
shell_screwmounts();
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module shell_rim() {
|
|
|
|
$fn = $preview ? 6 : 30;
|
2020-12-31 18:28:23 +00:00
|
|
|
w=shell_rim_wall;
|
2020-12-31 22:51:48 +00:00
|
|
|
s=rim_size;
|
2020-12-31 12:59:34 +00:00
|
|
|
intersection() {
|
|
|
|
difference() {
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(s, fillet=rf, edges=EDGES_Z_ALL);
|
|
|
|
cubi(ps, fillet=f, edges=EDGES_Z_ALL);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(s, fillet=1);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
rail_extension=10;
|
|
|
|
fwd(hs.y/2) xrot(90) harness_rail(slider_len_front+rail_extension);
|
|
|
|
back(hs.y/2) xrot(-90) harness_rail(slider_len_back+rail_extension);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module shell_rim_edge(thickness, groove, tolerance=rim_edge_tolerance) {
|
|
|
|
$fn = $preview ? 6 : 30;
|
|
|
|
w=thickness + (groove ? tolerance : 0);
|
|
|
|
offset=(groove ? 0 : tolerance/2);
|
2020-12-31 18:28:23 +00:00
|
|
|
res=[hs.x+2*(w+offset), hs.y+2*(w+offset), 3];
|
2020-12-31 12:59:34 +00:00
|
|
|
resi=[hs.x+2*offset, hs.y+2*offset, res.z+1];
|
2020-12-31 18:28:23 +00:00
|
|
|
up(0.0) difference() {
|
2020-12-31 12:59:34 +00:00
|
|
|
intersection() {
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(res, fillet=rf, edges=EDGES_Z_ALL);
|
|
|
|
cubi(res, fillet=(groove?1:1.5), edges=EDGES_BOTTOM);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
2021-01-11 12:54:11 +00:00
|
|
|
cubi(resi, fillet=rf, edges=EDGES_Z_ALL);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-31 18:28:23 +00:00
|
|
|
module foreach_screwmount() {
|
|
|
|
for(x = [0:1]) for (y = [0:1]) {
|
|
|
|
translate([(-0.5+x)*ps.x, (-0.5+y)*ps.y, -hs.z/2])
|
|
|
|
children();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module shell_screwmounts() {
|
|
|
|
$fn = $preview ? 6 : 30;
|
|
|
|
r=3;
|
|
|
|
foreach_screwmount() {
|
|
|
|
cylinder(r=r, h=hs.z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module shell_screwmounts_holes() {
|
|
|
|
$fn = $preview ? 6 : 30;
|
|
|
|
foreach_screwmount() {
|
|
|
|
up(w) cylinder(d2=screwmount_screw, d1=screwmount_screw*0.5, h=hs.z+1);
|
|
|
|
up(hs.z-1) cylinder(d=screwmount_screw+1.5, h=5);
|
|
|
|
}
|
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
module shell_backplane(groove) {
|
2021-01-11 21:00:51 +00:00
|
|
|
module groove_scale() { scale([groove?1.05:1, groove?1.05:1, groove?1.2:1]) children(); }
|
2021-01-12 09:00:07 +00:00
|
|
|
|
|
|
|
if (use_slideout_backplane()) {
|
|
|
|
down(hs.z/2 - shell_wall/3) up(backplane_rim_size.z/2) right(harness_divider.x) {
|
|
|
|
back(backplane_rim_size.y/2) {
|
|
|
|
teeth=backplane_teeth;
|
|
|
|
segment=backplane_rim_size.y/teeth;
|
|
|
|
tooth_size=[backplane_rim_size.x, segment/2, backplane_rim_size.z];
|
|
|
|
joiner_base=5;
|
|
|
|
joiner_size=[joiner_base + (groove?backplane_pip_slideout:0), segment*1.5, backplane_rim_size.z];
|
|
|
|
for (i = [0:teeth-1]) {
|
|
|
|
fwd(i*segment) fwd(tooth_size.y) {
|
|
|
|
groove_scale() cubi(tooth_size, fillet=0.5, edges=EDGES_X_ALL);
|
|
|
|
if (i%2 == 0) {
|
|
|
|
left(backplane_rim_size.x/2 + joiner_base/2) fwd(joiner_size.y/3) left(-joiner_size.x/2) groove_scale() cubi(joiner_size, fillet=2, edges=EDGES_Z_ALL);
|
|
|
|
}
|
2021-01-11 21:00:51 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-11 13:38:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ==== SHELL SLIDER AND RAIL ====
|
|
|
|
|
|
|
|
rail_angle=36;
|
|
|
|
rail_wall=1;
|
|
|
|
slider_slop=0.1;
|
|
|
|
slider_len_back=hs.x*0.3;
|
2021-01-11 18:33:19 +00:00
|
|
|
slider_len_front=hs.x*0.15;
|
2020-12-31 22:51:48 +00:00
|
|
|
module harness_slider(l) {
|
|
|
|
base=2;
|
|
|
|
ss=[l, shell_rim_wall, rim_size.z+rail_wall*2];
|
2021-01-11 18:33:19 +00:00
|
|
|
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;
|
2021-01-11 18:51:51 +00:00
|
|
|
right(-screws_area_l/2 + screws_area_l/(screws-1) * i) cylinder(d2=screwmount_screw*0.5, d1=screwmount_screw, h=ss.y*0.7);
|
2021-01-11 18:33:19 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
}
|
|
|
|
module harness_rail(l) {
|
|
|
|
sw=2;
|
|
|
|
ss=[l, shell_rim_wall, rim_size.z+rail_wall*2];
|
|
|
|
rail(l=ss.x, w=ss.z, h=ss.y, chamfer=0.5, ang=rail_angle, orient=ORIENT_X, align=V_UP);
|
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// ==== SHELL CUTOUTS ====
|
|
|
|
module shell_cutouts() {
|
|
|
|
top_cutout();
|
|
|
|
bottom_cutout();
|
|
|
|
left_cutout();
|
|
|
|
right_cutout();
|
|
|
|
front_cutout();
|
|
|
|
shell_screwmounts_holes();
|
|
|
|
}
|
|
|
|
// -- TOP --
|
2020-12-31 12:59:34 +00:00
|
|
|
module screen_cutout() {
|
2021-01-11 18:46:36 +00:00
|
|
|
$fn=$preview ? 4 : 12;
|
|
|
|
s=[138, 69, 12];
|
|
|
|
b = 10;
|
|
|
|
s1=[s.x, s.y];
|
|
|
|
s2=[s.x+b, s.y+b];
|
|
|
|
h=s.z;
|
|
|
|
up(5) rounded_prismoid(size1=s1, size2=s2, h=h, r1=1, r2=15);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
top_offset=6.5;
|
2020-12-31 18:28:23 +00:00
|
|
|
module top_speaker_cutout() {
|
|
|
|
s=[3, 12, 100];
|
2021-01-11 12:54:11 +00:00
|
|
|
right(ps.x/2 - top_offset) up(s.z/2 - ps.z/3) cubi(s, fillet=1);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module front_camera_cutout() {
|
|
|
|
$fn = $preview ? 6 : 30;
|
|
|
|
d=5;
|
2020-12-31 18:28:23 +00:00
|
|
|
s=[d, d, 100];
|
2021-01-11 12:54:11 +00:00
|
|
|
right(ps.x/2 - top_offset) fwd(11.5) cylinder(d=s.x, h=s.z);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module leds_cutout() {
|
2020-12-31 18:28:23 +00:00
|
|
|
s=[4, 14, 100];
|
2021-01-11 12:54:11 +00:00
|
|
|
right(ps.x/2 - top_offset) up(s.z/2 - ps.z/3) back(23) cubi(s, fillet=1);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module top_cutout() {
|
|
|
|
screen_cutout();
|
2020-12-31 18:28:23 +00:00
|
|
|
top_speaker_cutout();
|
2020-12-31 12:59:34 +00:00
|
|
|
front_camera_cutout();
|
|
|
|
leds_cutout();
|
|
|
|
}
|
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// -- BOTTOM --
|
2020-12-31 12:59:34 +00:00
|
|
|
module back_camera_cutout() {
|
2020-12-31 18:28:23 +00:00
|
|
|
s=[13, 25, expose_back_camera ? 100 : 11];
|
2021-01-15 11:49:41 +00:00
|
|
|
right(ps.x/2 - 7.5) fwd(ps.y/2 - 24.5) down(s.z/2 - ps.z/3) cubi(s, fillet=6, edges=EDGES_Z_ALL);
|
2020-12-31 18:28:23 +00:00
|
|
|
}
|
|
|
|
module bottom_speaker_cutout() {
|
|
|
|
s=[8, 49, 100];
|
|
|
|
left(ps.x/2 - 13)
|
2021-01-12 09:00:07 +00:00
|
|
|
down(s.z/2 - ps.z/3)
|
|
|
|
dotted_grill_cutout(s, vents_x=4, vents_y=8, cut_corners=true, mesh=1);
|
|
|
|
}
|
|
|
|
module bottom_vents_cutout() {
|
|
|
|
vents_x=10;
|
|
|
|
vents_y=6;
|
|
|
|
vents_area=[35, 50, 10];
|
|
|
|
vents_pos=[45, 0, -ps.z/2];
|
|
|
|
mesh=1.5;
|
|
|
|
translate(vents_pos)
|
|
|
|
dotted_grill_cutout(vents_area, vents_x=vents_x, vents_y=vents_y, mesh=mesh, cut_corners=true);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module bottom_cutout() {
|
|
|
|
back_camera_cutout();
|
2020-12-31 18:28:23 +00:00
|
|
|
bottom_speaker_cutout();
|
2021-01-12 09:00:07 +00:00
|
|
|
bottom_vents_cutout();
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// -- RIGHT --
|
2020-12-31 12:59:34 +00:00
|
|
|
module headphones_cutout() {
|
|
|
|
$fn = $preview ? 10 : 30;
|
2021-01-11 13:04:19 +00:00
|
|
|
d1=8.8;
|
|
|
|
d2=14;
|
2020-12-31 18:28:23 +00:00
|
|
|
p=[ps.x/2, ps.y/2-24, -0.88];
|
2021-01-11 21:00:51 +00:00
|
|
|
h=22;
|
2021-01-11 13:04:19 +00:00
|
|
|
translate(p) yrot(90) down(10) cylinder(h=h, d1=d1, d2=d2);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module right_cutout() {
|
|
|
|
headphones_cutout();
|
|
|
|
}
|
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// -- LEFT --
|
2020-12-31 12:59:34 +00:00
|
|
|
module usbc_cutout() {
|
2021-01-11 13:04:19 +00:00
|
|
|
s=[20, 20, 7];
|
2021-01-11 12:54:11 +00:00
|
|
|
left(ps.x/2) down(2) cubi(s, fillet=1);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module left_cutout() {
|
|
|
|
usbc_cutout();
|
|
|
|
}
|
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// -- FRONT --
|
2021-01-11 18:33:19 +00:00
|
|
|
buttons_cutout_size=[42, 100, 4.5];
|
|
|
|
buttons_cutout_pos=[ps.x/2 - 44.5, -ps.y/2 - 3, 0.25];
|
2020-12-31 12:59:34 +00:00
|
|
|
module buttons_cutout() {
|
2021-01-11 18:33:19 +00:00
|
|
|
s=buttons_cutout_size;
|
|
|
|
p=buttons_cutout_pos;
|
|
|
|
translate(p) cubi(s, fillet=1);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module front_cutout() {
|
|
|
|
buttons_cutout();
|
|
|
|
}
|
2021-01-11 18:33:19 +00:00
|
|
|
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;
|
2021-01-11 21:00:51 +00:00
|
|
|
pin_size=[3 + t, 3 + t, s.z+2 + t/2];
|
2021-01-11 18:33:19 +00:00
|
|
|
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);
|
2021-01-12 15:54:41 +00:00
|
|
|
back(1) cubi(cs);
|
2021-01-11 18:33:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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);
|
2021-01-12 15:54:41 +00:00
|
|
|
back(1) {
|
2021-01-11 18:33:19 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2020-12-31 22:51:48 +00:00
|
|
|
// ==== MODEL ====
|
2020-12-31 12:59:34 +00:00
|
|
|
|
2020-12-31 18:28:23 +00:00
|
|
|
divider=harness_divider;
|
2020-12-31 12:59:34 +00:00
|
|
|
module model_harness_left() {
|
|
|
|
intersection() {
|
|
|
|
intersection() {
|
|
|
|
translate(divider) downcube([1000, 1000, 1000]);
|
|
|
|
translate(divider) leftcube([1000, 1000, 1000]);
|
|
|
|
}
|
|
|
|
difference() {
|
|
|
|
shell();
|
|
|
|
shell_rim_edge(rim_edge_thickness, groove=true, tolerance=rim_edge_tolerance);
|
|
|
|
shell_cutouts();
|
2020-12-31 22:51:48 +00:00
|
|
|
shell_backplane(groove=true);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module model_harness_right() {
|
|
|
|
intersection() {
|
|
|
|
intersection() {
|
|
|
|
translate(divider) downcube([1000, 1000, 1000]);
|
|
|
|
translate(divider) rightcube([1000, 1000, 1000]);
|
|
|
|
}
|
|
|
|
difference() {
|
|
|
|
shell();
|
|
|
|
shell_rim_edge(rim_edge_thickness, groove=true, tolerance=rim_edge_tolerance);
|
|
|
|
shell_cutouts();
|
2021-01-11 18:33:19 +00:00
|
|
|
front_buttons(socket=true);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
shell_backplane(groove=false);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
module model_harness_top() {
|
|
|
|
intersection() {
|
|
|
|
translate(divider) upcube([1000, 1000, 1000]);
|
|
|
|
difference() {
|
|
|
|
shell();
|
|
|
|
shell_cutouts();
|
2021-01-11 18:33:19 +00:00
|
|
|
front_buttons(socket=true);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
difference() {
|
|
|
|
shell_rim_edge(rim_edge_thickness, groove=false);
|
|
|
|
shell_cutouts();
|
2021-01-11 18:33:19 +00:00
|
|
|
front_buttons(socket=true);
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-31 22:51:48 +00:00
|
|
|
module model_harness_slider_front() {
|
|
|
|
difference() {
|
|
|
|
fwd(hs.y/2) xrot(90) harness_slider(slider_len_front);
|
|
|
|
front_cutout();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module model_harness_slider_back() {
|
|
|
|
back(hs.y/2) xrot(-90) harness_slider(slider_len_back);
|
|
|
|
}
|
2021-01-11 18:33:19 +00:00
|
|
|
module model_harness_buttons() {
|
|
|
|
front_buttons(socket=false);
|
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
|
|
|
|
if (is_model(MODEL_HARNESS_LEFT)) model_harness_left();
|
2021-01-11 13:38:06 +00:00
|
|
|
if (is_model(MODEL_HARNESS_RIGHT)) model_harness_right();
|
2021-01-12 09:00:07 +00:00
|
|
|
if (is_model_strict(MODEL_HARNESS_BOTTOM)) {
|
|
|
|
model_harness_left();
|
|
|
|
model_harness_right();
|
|
|
|
}
|
2021-01-11 13:38:06 +00:00
|
|
|
if (is_model_strict(MODEL_HARNESS_BOTTOM_PIP)) {
|
|
|
|
model_harness_left();
|
|
|
|
right(backplane_pip_slideout) model_harness_right();
|
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
if (is_model(MODEL_HARNESS_TOP)) model_harness_top();
|
2020-12-31 22:51:48 +00:00
|
|
|
if (is_model(MODEL_HARNESS_SLIDER_FRONT)) model_harness_slider_front();
|
|
|
|
if (is_model(MODEL_HARNESS_SLIDER_BACK)) model_harness_slider_back();
|
2021-01-11 18:33:19 +00:00
|
|
|
if (is_model(MODEL_HARNESS_BUTTONS)) model_harness_buttons();
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module model() {
|
2021-01-21 08:59:55 +00:00
|
|
|
up(get_harness_size().z/2) phone_harness();
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!is_undef(validation)) {
|
|
|
|
intersection() {
|
|
|
|
phone();
|
|
|
|
model();
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
intersection() {
|
|
|
|
if (!is_undef(xray)) {
|
2021-01-11 13:38:06 +00:00
|
|
|
if (xray == XRAY_POSITIVE) {
|
|
|
|
span_cube([0,1000], [0,1000], [-1000,1000]);
|
2021-01-11 21:00:51 +00:00
|
|
|
} else if (abs(xray) == XRAY_BACKPLANE) {
|
|
|
|
span_cube([-1000,1000], [-1000,1000], [-1000*sign(xray),-6]);
|
2021-01-11 18:33:19 +00:00
|
|
|
} else if (xray == XRAY_BOTTOM) {
|
|
|
|
span_cube([-1000,1000], [-1000,1000], [-1000,0]);
|
2021-01-11 13:38:06 +00:00
|
|
|
}
|
2020-12-31 12:59:34 +00:00
|
|
|
}
|
|
|
|
union() {
|
|
|
|
if (is_not_export()) {
|
|
|
|
//phone();
|
|
|
|
//arm();
|
|
|
|
}
|
|
|
|
model();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|