[OpenSCAD] Accumulating variable in openSCAD

PhilipJ philip.h.jones at btinternet.com
Mon Oct 22 09:45:08 EDT 2018

Hi again,

I tried your code suggestion and it worked as it was supposed to but it made
me realize I need a more complex set of offsets. Basically the offset needs
to be:
     the offset of the previous element + 2 * dia of the hole.

I'm not familiar with how to manipulate 'lists' so can you suggest how I
could do something like:

   dims[i] = dims[i-1] + 2 * dia;

I only know how to show this in 'C' so it's probably nonsense in OpenSCAD
I have looked through the online documentation but I can't find anything
that specifically explains this usage of creating a list or of the
for(d=dims) usage. Is this a general scripting form ? will I find it in
documentation for Python or Lua ?

Sorry for using up your time like this, I appreciate the help

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

More information about the Discuss mailing list