Nabble has removed Mailing-list integration.
Posts created here DO NOT GET SENT TO THE MAILING LIST.
Mailing-list emails DO NOT GET POSTED TO THE FORUM.
So basically the Forum is now out of date, we are looking into migrating the history.

# building flat array with successive functions and tests in functions....

5 messages
Open this post in threaded view
|

## building flat array with successive functions and tests in functions....

Open this post in threaded view
|

## Re: building flat array with successive functions and tests in functions....

 Yes, the list comprehension is not a general expression. I'm not sure it's possible to change that. Both branches look the same anyway, so I'd use w = 180/res*n + above ? 180 : 0 As for nesting, check this post: http://forum.openscad.org/2D-SVG-concat-points-point-no-output-loops-amp-conditionals-vector-declarations-td29068.html#a29070You can drop one nesting level using 'each' For some extra ideas for drawing using math, check out https://www.desmos.com/artciao,   Torsten. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Torsten
Open this post in threaded view
|

## Re: building flat array with successive functions and tests in functions....

 In reply to this post by bboett You can't use a a?b:c conditional within a list comprehension. You must use if (a) b else c instead. Try replacing the list comprehension with this:[  if (above == true)       for(n = [0:1:res])           let (w = 180 + 180/res*n)             [pt[0]+rad*cos(w),pt[1], pt[2]+rad*sin(w)]      else        for(n = [0:1:res])            let (w = 180/res*n)              [pt[0]+rad*cos(w),pt[1], pt[2]+rad*sin(w)]    ];Doug Moen._______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org