[OpenSCAD] Accumulating variable in openSCAD

PhilipJ philip.h.jones at btinternet.com
Mon Oct 22 05:47:33 EDT 2018


Neon22 wrote
> Try two passes. First generate a list of the dia and offset as
>       pairs. 
>       Then consume the list while making the objects. 
>     dims = [ for (a=[0:20]) [1+a/10, 4+(1+a/10)*2]  ]; 
>       echo(dims); 
>       difference() { 
>           cube([90, 30, 5]); 
>           // 
>           for (d = dims) { 
>               #translate([d[1], 4, -1]) 
>                   cylinder(h=7, d=d[0]); 
>           } 
>       } 

Thanks for that, I'm always learning something :-)
PhilipJ




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



More information about the Discuss mailing list