# Use of for statement

6 messages
Open this post in threaded view
|

## Use of for statement

 Hi List, How do you make use of the "for" statement when creating a list of points? Somehow i cannot get the syntax right: Something like (pseudo code): points = [ for(i=[0:5]) [cos(i*60),sin(i*60),0] ] Such a structure can then be used in, for example a polygon. (Of course, i can always expand this manually, but that is not the idea). Thx. _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscadhttp://openscad.org - https://flattr.com/thing/121566
Open this post in threaded view
|

## Re: Use of for statement

 Currently you can't but syntax like that has been proposed.On 8 May 2013 14:02, Ruud Vlaming wrote: Hi List, How do you make use of the "for" statement when creating a list of points? Somehow i cannot get the syntax right: Something like (pseudo code): points = [ for(i=[0:5]) [cos(i*60),sin(i*60),0] ] Such a structure can then be used in, for example a polygon. (Of course, i can always expand this manually, but that is not the idea). Thx. _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscad http://openscad.org - https://flattr.com/thing/121566 _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscadhttp://openscad.org - https://flattr.com/thing/121566
Open this post in threaded view
|

## Re: Use of for statement

 Administrator On 2013-05-08, at 15:36 , nop head wrote: > Currently you can't but syntax like that has been proposed. > Also, the bigger picture is to facilitate building (implicit) surfaces and solids programmatically. One part of that is generating vertices, another part is generating connectivity information. It would be interesting to think through some typical scenarios and propose a comprehensive syntax for making this possible.  -Marius _______________________________________________ OpenSCAD mailing list [hidden email] http://rocklinux.net/mailman/listinfo/openscadhttp://openscad.org - https://flattr.com/thing/121566
Open this post in threaded view
|