revarbat / BOSL

The Belfry OpenScad Library - A library of tools, shapes, and helpers to make OpenScad easier to use.
https://github.com/revarbat/BOSL/wiki
BSD 2-Clause "Simplified" License
571 stars 62 forks source link

[BUG] spread(n, spacing=10) should be equivalent to spread(n, spacing=[10, 0, 0]) #90

Open ameuret opened 2 years ago

ameuret commented 2 years ago

I expect spread(n, spacing=10) to behave exactly as spread(n, spacing=[10, 0, 0])

That is:

image

Current behaviour

spread(n=3, spacing=10) cube(size=[3,2,1], center=true);

produces image

fe60 commented 2 years ago

From documentation about spread():

spacing A 3D vector indicating which direction and distance to place each subsequent copy at.

I don't think it's a bug. The module expects a vector for parameter spacing.

xspread does what you are looking for.

spread(n=3, spacing=[10,0,0]) cube(size=[3,2,1], center=true);

ymove(5)
xspread(n=3, spacing=10) cube(size=[3,2,1], center=true);