Compare commits

..

No commits in common. "bf2050ef0889d08873332d6f0bbd399dadd6035a" and "0295678c71d04d6619b2275f660fc7efb3aea0e3" have entirely different histories.

4 changed files with 21766 additions and 77260 deletions

View File

@ -15,20 +15,18 @@ XRAY_BOTTOM=3;
// EXPORT: // EXPORT:
MODEL_HARNESS_LEFT=1; MODEL_HARNESS_LEFT=1;
MODEL_HARNESS_RIGHT=2; MODEL_HARNESS_RIGHT=2;
MODEL_HARNESS_BOTTOM=3; MODEL_HARNESS_BOTTOM_PIP=3;
MODEL_HARNESS_BOTTOM_PIP=4; MODEL_HARNESS_TOP=4;
MODEL_HARNESS_TOP=5; MODEL_HARNESS_SLIDER_FRONT=5;
MODEL_HARNESS_SLIDER_FRONT=6; MODEL_HARNESS_SLIDER_BACK=6;
MODEL_HARNESS_SLIDER_BACK=7; MODEL_HARNESS_BUTTONS=7;
MODEL_HARNESS_BUTTONS=8; export=0; // [0:7]
export=0; // [0:8]
function is_not_export() = is_undef(export) || export == 0; function is_not_export() = is_undef(export) || export == 0;
function is_export() = !is_not_export(); function is_export() = !is_not_export();
function is_model_strict(m) = is_export() && export == m; function is_model_strict(m) = is_export() && export == m;
function is_model(m) = is_not_export() || export == m; function is_model(m) = is_not_export() || export == m;
function get_phone_size() = [160, 76.7, 10]; function get_phone_size() = [160, 76.7, 10];
function use_slideout_backplane() = is_model_strict(MODEL_HARNESS_BOTTOM_PIP) || is_model_strict(MODEL_HARNESS_LEFT) || is_model_strict(MODEL_HARNESS_RIGHT);
backplane_pip_slideout=10; backplane_pip_slideout=10;
@ -40,20 +38,6 @@ module cubi(s, fillet=0, edges=EDGES_ALL) {
} }
} }
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));
}
}
}
}
module phone() { module phone() {
s=get_phone_size(); s=get_phone_size();
color("gray") color("gray")
@ -148,26 +132,24 @@ module phone_harness() {
} }
module shell_backplane(groove) { module shell_backplane(groove) {
module groove_scale() { scale([groove?1.05:1, groove?1.05:1, groove?1.2:1]) children(); } module groove_scale() { scale([groove?1.05:1, groove?1.05:1, groove?1.2:1]) children(); }
down(hs.z/2 - shell_wall/3) up(backplane_rim_size.z/2) right(harness_divider.x) {
if (use_slideout_backplane()) { back(backplane_rim_size.y/2) {
down(hs.z/2 - shell_wall/3) up(backplane_rim_size.z/2) right(harness_divider.x) { teeth=backplane_teeth;
back(backplane_rim_size.y/2) { segment=backplane_rim_size.y/teeth;
teeth=backplane_teeth; tooth_size=[backplane_rim_size.x, segment/2, backplane_rim_size.z];
segment=backplane_rim_size.y/teeth; joiner_base=5;
tooth_size=[backplane_rim_size.x, segment/2, backplane_rim_size.z]; joiner_size=[joiner_base + (groove?backplane_pip_slideout:0), segment*1.5, backplane_rim_size.z];
joiner_base=5; for (i = [0:teeth-1]) {
joiner_size=[joiner_base + (groove?backplane_pip_slideout:0), segment*1.5, backplane_rim_size.z]; fwd(i*segment) fwd(tooth_size.y) {
for (i = [0:teeth-1]) { groove_scale() cubi(tooth_size, fillet=0.5, edges=EDGES_X_ALL);
fwd(i*segment) fwd(tooth_size.y) { if (i%2 == 0) {
groove_scale() cubi(tooth_size, fillet=0.5, edges=EDGES_X_ALL); 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);
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);
}
} }
} }
} }
} }
} }
} }
// ==== SHELL SLIDER AND RAIL ==== // ==== SHELL SLIDER AND RAIL ====
@ -245,22 +227,20 @@ module phone_harness() {
module bottom_speaker_cutout() { module bottom_speaker_cutout() {
s=[8, 49, 100]; s=[8, 49, 100];
left(ps.x/2 - 13) left(ps.x/2 - 13)
down(s.z/2 - ps.z/3) difference() {
dotted_grill_cutout(s, vents_x=4, vents_y=8, cut_corners=true, mesh=1); down(s.z/2 - ps.z/3) cubi(s, fillet=1);
} bars=8;
module bottom_vents_cutout() { down(ps.z/2)
vents_x=10; for (i = [0:bars-1]) {
vents_y=6; bs=[s.x+2, 1, 2];
vents_area=[35, 50, 10]; step=s.y/bars;
vents_pos=[45, 0, -ps.z/2]; fwd(i*step - s.y/2 + step/2) down(w) cube(bs, center=true);
mesh=1.5; }
translate(vents_pos) }
dotted_grill_cutout(vents_area, vents_x=vents_x, vents_y=vents_y, mesh=mesh, cut_corners=true);
} }
module bottom_cutout() { module bottom_cutout() {
back_camera_cutout(); back_camera_cutout();
bottom_speaker_cutout(); bottom_speaker_cutout();
bottom_vents_cutout();
} }
// -- RIGHT -- // -- RIGHT --
@ -311,7 +291,7 @@ module phone_harness() {
left(bs.x/2) { left(bs.x/2) {
difference() { difference() {
cubi(bs); cubi(bs);
back(1) cubi(cs); back(2) cubi(cs);
} }
} }
fwd(1) left(bs.x*0.8) cubi(touch_power_size, fillet=1); fwd(1) left(bs.x*0.8) cubi(touch_power_size, fillet=1);
@ -321,7 +301,7 @@ module phone_harness() {
cubi(pin_size); cubi(pin_size);
difference() { difference() {
cubi(bs); cubi(bs);
back(1) { back(2) {
left(bs.x/4) cubi(cs); left(bs.x/4) cubi(cs);
right(bs.x/4) cubi(cs); right(bs.x/4) cubi(cs);
} }
@ -396,10 +376,6 @@ module phone_harness() {
if (is_model(MODEL_HARNESS_LEFT)) model_harness_left(); if (is_model(MODEL_HARNESS_LEFT)) model_harness_left();
if (is_model(MODEL_HARNESS_RIGHT)) model_harness_right(); if (is_model(MODEL_HARNESS_RIGHT)) model_harness_right();
if (is_model_strict(MODEL_HARNESS_BOTTOM)) {
model_harness_left();
model_harness_right();
}
if (is_model_strict(MODEL_HARNESS_BOTTOM_PIP)) { if (is_model_strict(MODEL_HARNESS_BOTTOM_PIP)) {
model_harness_left(); model_harness_left();
right(backplane_pip_slideout) model_harness_right(); right(backplane_pip_slideout) model_harness_right();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff