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 optics_holder(); 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); }