// title = first impression rail design openSCAD // author = Joey van der Bie // license = MIT License // revision = 0.001 //dimensions are in mm // baseDept = 800; //width for 1 gate = 40mm cellWidth = 39; baseDept = 40; baseWidth = 800; baseHeight = 16; marbleRadius = 8;//marbles are 16mm marbleGateMargin = 0.2; servoArmSlothWidth= 4; servoArmSlothLength = marbleRadius*2.5 ; cercvoMountSlothPos=18.5; cervoMountSlothSize = [5, 15, baseHeight]; railfactor = 1.8; difference(){ base(); translate([10,00,0]){ rail(position=[-marbleRadius*railfactor,0,baseHeight-marbleRadius]); // cell(); for(cellPosition = [0:cellWidth:baseWidth/2-cellWidth ]){ cell([-marbleRadius/3, -cellPosition-15,baseHeight-marbleRadius-marbleGateMargin]); } for(cellPosition = [0:cellWidth:baseWidth/2- cellWidth]){ cell([-marbleRadius/3, cellPosition+20,baseHeight-marbleRadius-marbleGateMargin]); } } } // rail(); translate([3,0,0]){ marble([-marbleRadius,cellWidth/3+8, baseHeight-marbleRadius/2]); for(marblePos= [0:cellWidth: baseWidth/2-cellWidth]){ marble([marbleRadius, marblePos+cellWidth/3+8,marbleRadius/2*3-marbleGateMargin]); cervo([baseDept/2-cervoMountSlothSize[0]-3,marblePos+33+(cellWidth/3),-baseHeight/2]); } for(marblePos= [0:cellWidth: baseWidth/2-cellWidth]){ // marble([marbleRadius, -marblePos+cellWidth/3+11,marbleRadius/2*3-marbleGateMargin]); cervo([baseDept/2-cervoMountSlothSize[0]-3,-marblePos+cellWidth/3-2,-baseHeight/2], block=true); } } // cube([ marbleRadius,marbleRadius, marbleRadius/2], center = true); module base(){ cube(size=[baseDept,baseWidth,baseHeight], center= true); } module rail(width = baseWidth, position = [0,0,baseHeight-marbleRadius], rotation=[0,0,0]){ translate(position){ rotate(rotation){ cube([marbleRadius*railfactor,width,marbleRadius*railfactor-marbleRadius], center= true) ; } } } module marble(position=[0,baseWidth/3, baseHeight-marbleRadius/2]){ translate(position){ color("LightSeaGreen", 0.8) sphere(r= marbleRadius, center=true); } } module cell(position = [-marbleRadius/3,cellWidth/3,baseHeight-marbleRadius-marbleGateMargin]){ // marble([position[0]+marbleRadius, position[1],marbleRadius/2*3-marbleGateMargin]); rail(width = marbleRadius*3, position = position, rotation=[0,0,90]); translate([0, position[1], position[2]+marbleGateMargin - baseHeight/2]){ cube([servoArmSlothLength, servoArmSlothWidth, baseHeight], center=true); } translate([marbleRadius, position[1]+cercvoMountSlothPos, position[2]+marbleGateMargin - baseHeight/2]){ cube(cervoMountSlothSize, center=true); } } cervoWidth= 20; cervoHeight= 20; cervoDepth= 10; cervoMount= [5,cervoDepth, 2] ; cervoMountHeight = 15; //cervo(); module cervo(position = [baseDept/2-cervoMountSlothSize[0],cellWidth/3,-baseHeight/2], block= false){ translate(position){ rotate([90,180,0]){ //arm in block mode if(block){ translate([cervoDepth/2-1.5,-20, cervoWidth+cervoDepth/2]){ color("White",1)cube(size=[3,30,2]); } }else{ //arm in no block mode rotate([0,0,90]){ translate([cervoDepth/2-1.5,-cervoDepth/2, cervoWidth+cervoDepth/2]){ color("White",1)cube(size=[3,30,2]); } } } translate([cervoDepth/2,cervoDepth/2, cervoWidth]){ color("White",1) cylinder(h=cervoDepth/2, r=cervoDepth/2); } translate([-cervoMount[0],0, cervoMountHeight]){ color("SteelBlue",1) cube(size=cervoMount); } translate([cervoWidth,0, cervoMountHeight]){ color("SteelBlue",1) cube(size=cervoMount); } color("SteelBlue",1) cube(size=[cervoHeight,cervoDepth, cervoWidth ] ); //mount translate([-cervoMount[0],-baseHeight, 0]){ color("BurlyWood") cube(size=[cervoMountSlothSize[0],baseHeight+cervoDepth, cervoMountSlothSize[2] ] ); } } } }