$fs = 0.5; // epsilon e = 0.1; // tolerance tol = 0.5; // wall thickness wall = 1.5; // 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 a40_s = [144.4+tol, 69.2, 7.9+tol]; module a40() { rcube(a40_s); translate([a40_s.x, (a40_s.y-10)/2, (a40_s.z-3)/2]) cube([3, 10, 3]); } inc = 30; module main() { h = 27; rotate(-inc, [1, 0, 0]) translate([0, -a40_s.z-wall, 0]) { difference() { translate([0, 0, -5]) cube([a40_s.x+wall*2, a40_s.z+wall*2, h+5]); // Body translate([wall, a40_s.z+wall, 1]) rotate(90,[1, 0, 0]) a40(); translate([wall*2, wall*2, wall*2]) rotate(90, [1, 0, 0]) rcube([a40_s.x-wall*2, 30, 20]); // LCD cutout translate([a40_s.x+10, wall*1.5, 10]) rotate(-90, [0, 1, 0]) { rcube([14, a40_s.z-wall, 20], r=wall); // Jack hole } } } } module base() { i = 10; rotate(-inc, [1, 0, 0]) translate([0, -a40_s.z-wall, 0]) { translate([wall+i/2, a40_s.z+wall*2, 0]) rotate(90, [1, 0, 0]) rcube([a40_s.x-i, a40_s.y*1/3, wall]); } // Base plate translate([wall+i/2, wall, 0]) rcube([a40_s.x-i, 15+a40_s.y*sin(inc)/2, wall]); module upright() { hull() { rotate(90-inc, [1, 0, 0]) translate([0, a40_s.y*1/3, -wall]) cylinder(r=wall*1.5, wall); translate([0, 28, 0]) cylinder(r=wall*1.5, wall); translate([0, 3, 0]) cylinder(r=wall*1.5, wall); } } translate([a40_s.x*1/3, wall/2, 0]) upright(); translate([a40_s.x*2/3, wall/2, 0]) upright(); } difference() { union() { main(); base(); } translate([-10, -100, -200]) cube([200, 200, 200]); } module phone() { translate([wall, 0, 0]) rotate(90-inc,[1, 0, 0]) color("darkgreen") a40(); } //phone();