//resolution $fn=200; width=95; length=185; height=9; //LIBRARY module roundedRect(size, radius) { x = size[0]; y = size[1]; z = size[2]; linear_extrude(height=z) hull() { translate([radius, radius, 0]) circle(r=radius); translate([x - radius, radius, 0]) circle(r=radius); translate([x - radius, y - radius, 0]) circle(r=radius); translate([radius, y - radius, 0]) circle(r=radius); } } module screw_hole() { union() { translate(v=[0,0,-0.5]) cylinder(h=1.5+0.5, r1=3.5, r2=1.5); translate(v=[0,0,-0.5]) cylinder(h=9+1.5, r=1.5); } } //MAIN union() { difference() { //outside roundedRect([width,length,height],3); //inside translate(v = [12.5,4,3]) cube(size=[70,177,6+1], center=false); //right curve translate(v=[953+(95-4.5),92.5,-1]) cylinder(h = 9+2, r=953); //left curve translate(v=[-(953-4.5),92.5,-1]) cylinder(h = 9+2, r=953); //bottom left translate(v=[5.5,3.5+1.5,0]) screw_hole(); //bottom right translate(v=[95-5.5,3.5+1.5,0]) screw_hole(); //top left translate(v=[5.5,185-(3.5+1.5),0]) screw_hole(); //top right translate(v=[95-5.5,185-(3.5+1.5),0]) screw_hole(); //middle left translate(v=[12.5-2-1.5,92.5,0]) screw_hole(); //middle right translate(v=[95-(12.5-2-1.5),92.5,0]) screw_hole(); //usb translate(v=[95-12.5-1,96,9-1.5]) cube(size=[12.5,11,1.5+1], center=false); //jack translate(v=[18,185-4-1,9-2.5]) cube(size=[11,4+2,2.5+1], center=false); //battery translate(v=[95-42-12.5,64+4-2.5,-1]) roundedRect([42,10+5,3+2], 3); //sim+uSD translate(v=[95-22-(12.5+9-2),112+4-2,-1]) roundedRect([18+4,27+4,3+2], 3); } //battery spacer translate(v=[18.5,56.5+4,1]) cube(size=[58,3,6+3-1], center=false); //left dentent translate(v=[12.5-3,12.5,9-1]) cube(size=[1.8,75,0.75+1], center=false); translate(v=[12.5-3,length-12.5-75,9-1]) cube(size=[1.8,75,0.75+1], center=false); //right dentent translate(v=[width-12.5+3-1.8,12.5,9-1]) cube(size=[1.8,75,0.75+1], center=false); translate(v=[width-12.5+3-1.8,length-12.5-65,9-1]) //different length, because of USB cube(size=[1.8,65,0.75+1], center=false); //bottom dentent translate(v=[12.5,4-3,9-1]) cube(size=[70,1.8,0.75+1], center=false); //top dentent translate(v=[12.5+20,length-4+3-1.8,9-1]) //different width, because of Jack cube(size=[50,1.8,0.75+1], center=false); }