// 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= 5; servoArmSlothLength = marbleRadius*2.5 ; cercvoMountSlothPos=18.5; cervoMountSlothSize = [5, 15, baseHeight]; railfactor = 1.8; difference() { base(); translate([10,00,0]){ // color("green") rail(position=[-marbleRadius*railfactor,0,0]); // 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], true); } } } // translate([10,00,0]){ // color("green") rail(position=[-marbleRadius*railfactor,0,0]); // // 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], true); // } // } // 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(){ square(size=[baseDept,baseWidth], center= true); } module rail(width = baseWidth, position = [0,0,0], rotation=[0,0,0]){ translate(position){ rotate(rotation){ color("red") square([marbleRadius*railfactor,width], 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,0], mountslot = true){ // marble([position[0]+marbleRadius, position[1],marbleRadius/2*3-marbleGateMargin]); // rail(width = marbleRadius*3, position = [-3, position[1]], rotation=[0,0,90]); translate([0, position[1], 0]){ color("black") square([servoArmSlothLength, servoArmSlothWidth], center=true); }if(mountslot){ translate([marbleRadius, position[1]+cercvoMountSlothPos, position[2]+marbleGateMargin - baseHeight/2]){ color("black") square([cervoMountSlothSize[0],cervoMountSlothSize[1] ], 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] ] ); } } } }