Discussion:
[OpenSCAD] Arrange cylinders in circle like barrels of a gatling gun
Experimentalist
2018-10-17 22:36:37 UTC
Permalink
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/
shadowwynd
2018-10-17 23:00:06 UTC
Permalink
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/
Experimentalist
2018-10-18 06:30:04 UTC
Permalink
Perfect, thanks. As ever its easy when you know how :0)



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

Loading...