Autogenerating points in a loop?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Autogenerating points in a loop?

Brian Korsedal
Is there any way I can use a loop inside of the polygon or polyhedron
functions to generate points using a mathmatical equation?

Is there a better way of doing this?

-Brian

Reply | Threaded
Open this post in threaded view
|

Re: Autogenerating points in a loop?

Giles Bathgate
On Sun, 2010-07-11 at 10:35 -0700, Brian Korsedal wrote:

> Is there any way I can use a loop inside of the polygon or polyhedron
> functions to generate points using a mathmatical equation?
>
> Is there a better way of doing this?
>
> -Brian
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad

This would be quite simple if there was an assignment operator, then you
might be able to do the following.


d=[[0,0],[0,0],[0,0]];

module main()
{
        for(i=[0:3])
        {
                d[i]=[1,1]; //or the result of some function
        }
       
        polygon(points=d,paths=[[0,1,2]]);
}

main();

But alas there is only the assign() function which can only apply
assignments to a subtree :( I understand that an assign operator is on
the TODO list?

Giles.