// // RAMPS Case // // 2011-08-11 JvO, New // // parameters c=false; // center True/False th=2.0; length=105.0; width=65.0; height=46.0; fh=2.0; // feet height mrlh=7.5; // Left PCB mount ridge height mrh=5.0; // Right PCB mount ridge height rth=th+1; // ridge thickness mrw=3.0; // width mrd=2.0; // offset soh=6.0; // standoff height ch=5.0; // cover height cd=5.0; // steppercable diameter // DXF file and layers dxf="Ramps case.dxf"; shell="shell"; bottom="cover"; standoffs="standoffs"; scale=1.0; i=2; // cover1, cover2, case if (i==1) { difference() { rampsCover(); translate( [10.5,-15,0] ) cube( size=[4*cd,cd,2*th], center=true ); translate( [0,-15,0] ) cylinder( r=cd/2, h=2*th, center=true ); translate( [20.5,-15,0] ) cylinder( r=cd/2, h=2*th, center=true ); } } else if (i==2) { difference() { mirror() rampsCover(); //USB (13x12) translate( [-11,12,0] ) cube( size=[13,12,2*th], center=true ); //Powerconnector (23x9) translate( [21,-2,0] ) cube( size=[23,9,30], center=true ); } } else { rampsCase(); } module rampsCase() { //case linear_extrude( file=dxf, layer=shell, height=length, scale=scale, center=c); //PCB mount ridge left difference() { translate( [width/2-mrlh,0,0] ) cube( size=[mrlh,6,length], center=c); translate( [width/2-mrlh,mrw/2,0] ) cube( size=[2,2,length], center=c); } //right translate( [-width/2,mrd+mrw,0] ) cube( size=[mrh,mrw,length], center=c); //upper right (shortened to leave room for the reset switch) translate( [-width/2,0,0] ) cube( size=[mrh,mrw,length-30], center=c); //feet translate( [-25,25.5,0] ) cube( size=[5,fh,length], center=c); translate( [20,25.5,0] ) cube( size=[5,fh,length], center=c); //embellishment for ( z = [0:1:5] ) { translate( [5+z*1.25*th,-height/2-1.5*th,0] ) cylinder( r=th/2, h=length, center=c); } //bottom cover mount translate( [-width/2,height/2,12] ) rotate(v=[1,1,0], a=180) rotate( v=[0,0,1], a=45 ) mountCone(); translate( [-width/2,-height/2,12] ) rotate(v=[1,1,0], a=180) rotate( v=[0,0,1], a=-45 ) mountCone(); translate( [width/2,-height/2,12] ) rotate(v=[1,1,0], a=180) rotate( v=[0,0,1], a=-135 ) mountCone(); translate( [width/2,height/2,12] ) rotate(v=[1,1,0], a=180) rotate( v=[0,0,1], a=135 ) mountCone(); //top cover mount translate( [width/2,-height/2,105-12] ) rotate( v=[0,0,1], a=45 ) mountCone(); translate( [-width/2,-height/2,105-12] ) rotate( v=[0,0,1], a=-45 ) mountCone(); translate( [-width/2,height/2,105-12] ) rotate( v=[0,0,1], a=-135 ) mountCone(); translate( [width/2,height/2,105-12] ) rotate( v=[0,0,1], a=135 ) mountCone(); } module rampsCover() { //case linear_extrude( file=dxf, layer=shell, height=ch, scale=scale, center=c); //bottom translate( [0,0,0] ) linear_extrude( file=dxf, layer=bottom, height=th, scale=scale, center=c); //ridge translate( [0,(height-rth+1)/2,ch] ) cube( size=[width-12,rth,ch], center=true ); translate( [0,-(height-rth-1)/2,ch] ) cube( size=[width-12,rth,ch], center=true ); translate( [(width-rth)/2,0,ch] ) cube( size=[rth,height-12,ch], center=true ); translate( [-(width-rth)/2,0,ch] ) cube( size=[rth,height-12,ch], center=true ); //embellishment for ( z = [0:1:5] ) { translate( [5+z*1.25*th,-height/2-1.5*th,0] ) cylinder( r=th/2, h=ch, center=c); } //holes translate( [width/2,-height/2,-7] ) rotate( v=[0,0,1], a=45 ) mount(); translate( [-width/2,-height/2,-7] ) rotate( v=[0,0,1], a=-45 ) mount(); translate( [-width/2,height/2,-7] ) rotate( v=[0,0,1], a=-135 ) mount(); translate( [width/2,height/2,-7] ) rotate( v=[0,0,1], a=135 ) mount(); } module mountCone() { difference() { union() { for ( z = [0:0.5:7] ) { translate( [0,z/2,z] ) cylinder( r=z/2, h=1, center=c ); } mount(); } translate( [0,3,6] ) cylinder( r=1, h=6, center=c ); } } module mount() { difference() { translate( [0,3,7] ) cylinder( r=4, h=5, center=c ); translate( [0,3,6] ) cylinder( r=1, h=6, center=c ); } }