[OpenSCAD] help with 'if' statement?

Chris Gray chgray at gmail.com
Sat Sep 18 22:10:37 CEST 2010

this feels silly to me, being a programmer :)

but how does an if statement work in OpenSCAD?

I'd like to say

module foo(x)
      if(x == 0)
            y = 10;

      // do work with y

when I do this I get a parser error?  if I were to call a module instead of
doing an assignment everything would be fine

how would I do such a thing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20100918/81c0d1a2/attachment.html

More information about the OpenSCAD mailing list