a=30.5; //Diameter of Optics c=15; //Thickness of Optics b=30; //Height d=9.22; //Optic Ring diameter e=13; //Nut Diameter f=6; //Nut Height g=8; //Threaded Rod Diameter x=98.5; //Length of the Carriage y=51; // Width of the Carriage z=5; //Thickness of the Carriage //optics_holder(); carriage(); module carriage(){ difference(){ carriage(); translate([70,-1,-1])cube([x+2,y+2,z+1]); translate([-1,-1,z/2])cube([x+2,y+2,z]); } translate([0,-75,0])carriage(); module carriage(){ difference(){ cube([x,y,z]); translate([14,6,0])cylinder(z,3,3); translate([58,6,0])cylinder(z,3,3); translate([14,33,0])cylinder(z,3,3); translate([58,33,0])cylinder(z,3,3); translate([78,5,0])cylinder(z,2,2); translate([92,5,0])cylinder(z,2,2); translate([78,15,0])cylinder(z,2,2); translate([92,15,0])cylinder(z,2,2); translate([85,25,z/2])cube([14,10,z], center = true); translate([78,35,0])cylinder(z,2,2); translate([92,35,0])cylinder(z,2,2); translate([78,45,0])cylinder(z,2,2); translate([92,45,0])cylinder(z,2,2); translate([35,21,0])cylinder(z,4.5,4.5); #translate([35,((a+7)/2+5)+20,0])cylinder(z*2,(g+1)/2,(g+1)/2); #translate([35,((a+7)/-2-5)+20,0])cylinder(z,(g+1)/2,(g+1)/2); } } translate([35,-55,0]){ difference(){ hull(){ translate([0,(a+7)/-2-5,0])cylinder(z,(g+7)/2,(g+7)/2); translate([0,(a+7)/2+5,0])cylinder(z,(g+7)/2,(g+7)/2); } translate([0,(a+7)/-2-5,0])cylinder(z,(g+1)/2,(g+1)/2); #translate([0,(a+7)/2+5,0])cylinder(z,(g+1)/2,(g+1)/2); cylinder(z,4.5,4.5); } } } module optics_holder(){ difference(){ cylinder((c)+8,(a+7)/2, (a+7)/2); translate([0,0,5])cylinder(c+1,(a+1)/2, (a+1)/2); translate([0,(a+1)/-2,5])cube([a+100,a+1,c+1]); translate([0,0,1])cylinder((c/2),(d+1)/2, (d+1)/2); translate([0,(d+1)/-2,1])cube([a+100,d+1,c+1]); cylinder(5,3,3); translate([0,0,(c+7)])cylinder(b-(c+8)+2, 4.5,4.5); translate([10,(a+1)/-2,5])cube([a+100,a+1,c*2]); translate([0,9/-2,b/2+7])cube([a+100,9,b/2]); translate([0,(a+7)/2+5,0])hexagon((f+1), (e+3)/2, (e+3)/2); translate([0,(a+7)/-2-5,0])hexagon((f+1), (e+3)/2, (e+3)/2); } difference(){ translate([0,0,(c+8)])cylinder((b-(c+8)),(a/2)-5,(a/2)-5); translate([0,0,(c+7)])cylinder(b-(c+8)+2, 4.5,4.5); #translate([0,9/-2,b/2+8])cube([a+100,9,b/2]); } difference(){ translate([0,((a+7)/2)-((e/2-2)),(f+4)/2])cube([e+6,e+6,f+4], center = true); translate([0,(a+7)/2+5,0])hexagon((f+1), (e+3)/2, (e+3)/2); translate([0,(a+7)/2+5,f+2])cylinder((f), (g+1)/2, (g+1)/2); translate([0,0,5])cylinder(c+1,(a+1)/2, (a+1)/2); translate([0,(a+1)/-2,5])cube([a+100,a+1,c+1]); translate([0,0,1])cylinder((c/2),(d+1)/2, (d+1)/2); translate([0,(d+1)/-2,1])cube([a+100,d+1,c+1]); } difference(){ translate([0,(a+7)/2+5,0])cylinder(f+4,(e+6)/2,(e+6)/2); translate([0,(a+7)/2+5,0])hexagon((f+1), (e+3)/2, (e+3)/2); translate([0,(a+7)/2+5,f+2])cylinder((f), (g+1)/2, (g+1)/2); translate([0,0,5])cylinder(c+1,(a+1)/2, (a+1)/2); translate([0,(a+1)/-2,5])cube([a+100,a+1,c+1]); translate([0,0,1])cylinder((c/2),(d+1)/2, (d+1)/2); translate([0,(d+1)/-2,1])cube([a+100,d+1,c+1]); } difference(){ translate([0,((a+7)/-2)+((e/2-2)),(f+4)/2])cube([e+6,e+6,f+4], center = true); translate([0,(a+7)/-2-5,0])hexagon((f+1), (e+3)/2, (e+3)/2); translate([0,(a+7)/-2-5,f+2])cylinder((f), (g+1)/2, (g+1)/2); translate([0,0,5])cylinder(c+1,(a+1)/2, (a+1)/2); translate([0,(a+1)/-2,5])cube([a+100,a+1,c+1]); translate([0,0,1])cylinder((c/2),(d+1)/2, (d+1)/2); translate([0,(d+1)/-2,1])cube([a+100,d+1,c+1]); } difference(){ translate([0,(a+7)/-2-5,0])cylinder(f+4,(e+6)/2,(e+6)/2); #translate([0,(a+7)/-2-5,0])hexagon((f+1), (e+3)/2, (e+3)/2); translate([0,(a+7)/-2-5,f+2])cylinder((f), (g+1)/2, (g+1)/2); translate([0,0,5])cylinder(c+1,(a+1)/2, (a+1)/2); translate([0,(a+1)/-2,5])cube([a+100,a+1,c+1]); translate([0,0,1])cylinder((c/2),(d+1)/2, (d+1)/2); translate([0,(d+1)/-2,1])cube([a+100,d+1,c+1]); } } module reg_polygon(sides,radius) { function dia(r) = sqrt(pow(r*2,2)/2); //sqrt((r*2^2)/2) if only we had an exponention op if(sides<2) square([radius,0]); if(sides==3) triangle(radius); if(sides==4) square([dia(radius),dia(radius)],center=true); if(sides>4) circle(r=radius,$fn=sides); } module hexagon_f(radius) { reg_polygon(6,radius); } module hexagon(height,radius) { linear_extrude(height=height) hexagon_f(radius); }