Arrange cylinders in circle like barrels of a gatling gun

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Arrange cylinders in circle like barrels of a gatling gun

Experimentalist
Hi

Can anyone help me with some code to arrange cylinders equidistant around a
circle, much like the arrangement of barrels on a gatling gun. I want to use
these to cut holes in a box lid using difference.

I am sure it is simple but I am unsure of how to go about it

Thanks for looking

Ex.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Arrange cylinders in circle like barrels of a gatling gun

shadowwynd
count = 8;
outer_r = 40;
cyl_d = 20;
cyl_h = 30;

for (i=[0:360/count:359])
{
        rotate ([0, 0, i])
                translate ([outer_r, 0, 0])
                        cylinder (d=cyl_d, h=cyl_h);


}



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Arrange cylinders in circle like barrels of a gatling gun

Experimentalist
Perfect, thanks. As ever its easy when you know how :0)



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org