132 lines
2.5 KiB
OpenSCAD
132 lines
2.5 KiB
OpenSCAD
$fs = 0.5;
|
|
// epsilon
|
|
e = 0.1;
|
|
// tolerance
|
|
tol = 0.5;
|
|
// wall thickness
|
|
wall = 3;
|
|
|
|
// A cube with rounded edges
|
|
module rcube(s, r=4) {
|
|
hull() {
|
|
for (x = [r, s[0]-r]) {
|
|
for (y = [r, s[1]-r]) {
|
|
translate([x, y, 0])
|
|
cylinder(h=s[2], r=r);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Outer dimensions of the phone including a gel case
|
|
redminote4_s = [153, 78+tol, 9.4+tol];
|
|
|
|
module redminote4(s=redminote4_s) {
|
|
module body() {
|
|
hull() {
|
|
// Front
|
|
// 8 mm radius on the corners.
|
|
r = 8;
|
|
// Sides
|
|
// ~7mm on the edge, going to `t` over ~8mm
|
|
ts = 7;
|
|
|
|
// Bottom end
|
|
// 8 mm radius on the corners.
|
|
// Pulls in to 8 mm thick over the last 15 mm to the USB connector.
|
|
tb = 8;
|
|
translate([r, r, 0])
|
|
cylinder(h=ts, r=r);
|
|
translate([r, s[1]-r, 0])
|
|
cylinder(h=ts, r=r);
|
|
// Top end
|
|
// ~9 mm thick on the edge, going to `t` over ~8mm
|
|
tt = 9;
|
|
translate([s[0] - r, r, 0])
|
|
cylinder(h=ts, r=r);
|
|
translate([s[0] - r, s[1]-r, 0])
|
|
cylinder(h=ts, r=r);
|
|
// Back plate
|
|
in = 0;
|
|
bs = [s[0] - in-r, s[1]-in-r, 1];
|
|
translate([(s[0]-bs[0])/2, (s[1]-bs[1])/2, s[2]-bs[2]])
|
|
rcube(bs);
|
|
}
|
|
}
|
|
color("silver")
|
|
body();
|
|
// USB socket hole
|
|
us = [11+2+2, 9+2, 50];
|
|
translate([-us[2]/2+10, s[1]/2, us[1]/2])
|
|
rotate(90, [1, 0, 0])
|
|
rotate(90, [0, 1, 0])
|
|
translate(-us/2)
|
|
rcube(us, r=2);
|
|
};
|
|
|
|
tilt = 15;
|
|
|
|
module redminote4_up() {
|
|
rotate(90-tilt, [1, 0, 0])
|
|
rotate(180, [1, 0, 0])
|
|
rotate(-90, [0, 0, 1])
|
|
translate([0, -redminote4_s[1]/2, 0])
|
|
redminote4();
|
|
};
|
|
|
|
module redminote4_right() {
|
|
rotate(-90-10, [1, 0, 0])
|
|
rotate(180, [0, 0, 1])
|
|
translate([-redminote4_s[0]/2, 0, 0])
|
|
redminote4();
|
|
};
|
|
|
|
module stand(s, ph) {
|
|
module base() {
|
|
// Base
|
|
translate([-s[0]/2, 0, 0]) {
|
|
r = 4;
|
|
hull() {
|
|
for (x = [r, s[0]-r]) {
|
|
translate([x, r, 0])
|
|
cylinder(h=s[2], r=r);
|
|
translate([x, s[1]-r, 0])
|
|
cylinder(h=wall*1.5, r=r);
|
|
}
|
|
}
|
|
}
|
|
// Back stand
|
|
w = ph[1]+wall*2;
|
|
h = 72;
|
|
difference() {
|
|
rotate(-tilt, [1, 0, 0])
|
|
difference() {
|
|
translate([-w/2, 4, 0])
|
|
cube([w, 40, h]);
|
|
|
|
rotate(20, [1, 0, 0])
|
|
translate([-(s[0]+e)/2, 40, -20])
|
|
cube([s[0]+e, 40, 1000]);
|
|
}
|
|
// Cut of anything below the base
|
|
translate([-(s[0]+e)/2, 0, -s[2]])
|
|
cube([s[0]+e, s[1]+e, s[2]]);
|
|
}
|
|
}
|
|
difference() {
|
|
base(s, ph);
|
|
translate([0, wall, wall])
|
|
# redminote4_up();
|
|
}
|
|
}
|
|
|
|
module redminote4_stand() {
|
|
chin = 12;
|
|
s = [redminote4_s[1]+20, 50, chin];
|
|
stand(s, redminote4_s);
|
|
}
|
|
|
|
redminote4_stand();
|
|
//redminote4();
|
|
//motoe2lte();
|