discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] staggered arrangement Syntax for cylinders

P
Parkinbot
Fri, Apr 28, 2017 9:05 AM

You create your staggered arrangement in some double loop and decide randomly
for each position, whether you put a cylinder or not. This directly
translates into code.

--
View this message in context: http://forum.openscad.org/staggered-arrangement-Syntax-for-cylinders-tp21392p21393.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You create your staggered arrangement in some double loop and decide randomly for each position, whether you put a cylinder or not. This directly translates into code. -- View this message in context: http://forum.openscad.org/staggered-arrangement-Syntax-for-cylinders-tp21392p21393.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Fri, Apr 28, 2017 6:38 PM

One way doing that staggered arrangement of cylinders...

linear_extrude(40)
for (x = [0 : 9], y = [0 : 9])
if ((x + y) % 2 == 0)
translate(10 * [x, y])
circle(3);

One way doing that staggered arrangement of cylinders... linear_extrude(40) for (x = [0 : 9], y = [0 : 9]) if ((x + y) % 2 == 0) translate(10 * [x, y]) circle(3);