Commit 563e5363 authored by Angus Ainslie's avatar Angus Ainslie
Browse files

PhoneCase.scad: add an adjustable phone case



The parameters in PhoneOutline.scad can be adjusted for dogwood or
evergreen.
Signed-off-by: default avatarAngus Ainslie <angus@akkea.ca>
parent aa13c0ac
//
// Copyright (C) 2020 Purism SPC
//
// SPDX-License-Identifier: GPL-3.0+
//
// This can create a dogwood or evergreen case by changing the dimensions
// in the PhomeOutline.scad file
include <PhoneOutline.scad>;
// Case thickness
cX = 3.5;
cY = 2.5;
cZ = 2;
// Case outside Dimesions
oY = pY+2*cY;
oX = pX+2*cX;
oZ = pZ+2*cZ;
$fn=60;
r=8;
module case_base() {
hull() {
//Main Case
translate([r,r,4])
cylinder(h=oZ-6, r=r);
translate([r,oY-r,4])
cylinder(h=oZ-6, r=r);
translate([oX-r,oY-r,4])
cylinder(h=oZ-6, r=r);
translate([oX-r,r,4])
cylinder(h=oZ-6, r=r);
// back bezel
// h = 4
// d = 4
bO = r+5;
translate([bO,bO,0])
cylinder(h=4, r=r-2);
translate([bO, oY-bO,0])
cylinder(h=4, r=r-2);
translate([oX-bO,oY-bO,0])
cylinder(h=4, r=r-2);
translate([oX-bO,bO,0])
cylinder(h=4, r=r-2);
// top bezel
// h = 2
// d = 1
tO = r+1;
translate([tO,tO,oZ-2])
cylinder(h=2, r=r-1);
translate([tO, oY-tO,oZ-2])
cylinder(h=2, r=r-1);
translate([oX-tO,oY-tO,oZ-2])
cylinder(h=2, r=r-1);
translate([oX-tO,tO,oZ-2])
cylinder(h=2, r=r-1);
}
}
module display_cut() {
hull() {
offset = r+4;
translate([offset,offset,oZ-3])
cylinder(h=4, r=r-1);
translate([offset, oY-offset,oZ-3])
cylinder(h=4, r=r-1);
translate([oX-offset,oY-offset,oZ-3])
cylinder(h=4, r=r-1);
translate([oX-offset,offset,oZ-3])
cylinder(h=4, r=r-1);
}
}
module camera_cuts() {
// Camera
translate([13.5+cX,49.5+cY,-cZ/2])
cylinder(h=2*cZ, r1=6, r2=4);
// Flash
translate([13.5+cX,37+cY,-cZ/2])
scale([2.5,1,1])
cylinder(h=2*cZ, r1=4, r2=2);
}
module hks_cut() {
hull() {
translate([cX+24, -cY/2, cZ+7.25])
cube([34, cY*2, 5]);
// bezel edge
translate([cX+22, -cY, cZ+6.25])
cube([38, cY, 7]);
}
}
module vol_cut() {
hull() {
translate([cX+21, pY+cY-cY/2, cZ+8.25])
cube([36, cY*2, 4]);
// bezel edge
translate([cX+18, pY+2*cY, cZ+7.25])
cube([42, cY, 6]);
}
}
module top_cuts() {
// Headphone plug
translate([-cX/2, cY+19, cZ+10])
rotate([0, 90, 0])
cylinder(h=cX*2, r1=5, r2=4);
}
module bottom_cuts() {
// Mic
translate([pX+cX/2, pY/2-20+cY, cZ+8.5])
cube([cX*2, 10, 3]);
// Speaker
translate([pX+cX/2, pY/2+10+cY, cZ+8.5])
cube([cX*2, 10, 3]);
// USB C
cutY1=14;
translate([pX+cX/2, pY/2-cutY1/2+cY, cZ+6.5])
cube([cX*2, cutY1, 7]);
}
module case() {
difference() {
case_base();
union() {
display_cut();
translate([cX, cY, cZ]) phone();
camera_cuts();
hks_cut();
vol_cut();
top_cuts();
bottom_cuts();
}
}
}
case();
//translate([cX, cY, cZ]) color("red") phone();
//
// Copyright (C) 2020 Purism SPC
//
// SPDX-License-Identifier: GPL-3.0+
//
// Evergreen Dimensions
pX = 153;
pY = 75;
pZ = 15;
// Dogwood Dimensions
//pX = 150;
//pY = 75;
//pZ = 15;
module phone() {
$fn=60;
r=8;
hull() {
//Main phone
translate([r,r,4])
cylinder(h=pZ-6, r=r);
translate([r,pY-r,4])
cylinder(h=pZ-6, r=r);
translate([pX-r,pY-r,4])
cylinder(h=pZ-6, r=r);
translate([pX-r,r,4])
cylinder(h=pZ-6, r=r);
// back bezel
// h = 4
// d = 4
offsetB = r+5;
translate([offsetB,offsetB,0])
cylinder(h=4, r=r-4);
translate([offsetB, pY-offsetB,0])
cylinder(h=4, r=r-4);
translate([pX-offsetB,pY-offsetB,0])
cylinder(h=4, r=r-4);
translate([pX-offsetB,offsetB,0])
cylinder(h=4, r=r-4);
// top bezel
// h = 2
// d = 1
offsetT = r+1;
translate([offsetT,offsetT,pZ-2])
cylinder(h=2, r=r-1);
translate([offsetT, pY-offsetT,pZ-2])
cylinder(h=2, r=r-1);
translate([pX-offsetT,pY-offsetT,pZ-2])
cylinder(h=2, r=r-1);
translate([pX-offsetT,offsetT,pZ-2])
cylinder(h=2, r=r-1);
}
}
// phone();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment