Making a dynamic plane from points

GenericJoe

06-07-2010 13:11:11

Hi guys, can someone give me some advice on how to do this please?

I have a set of 3d points, that make a flat shape (e.g. rectangle, hexagon, square, many sided polygon etc.)
I can use these points to draw lines between them, so I can see the boundary in line form, and it works great.

My problem is that I want to create a plane from the volume! In other words, I want my function to accept an array of points, and return a plane that represents the inner area of these points.
The points are always on the same height plane, so I guess these are 2D shapes.

Any ideas?

zarfius

07-07-2010 04:27:20

Are you using ManualObject?

The problem your describing can be simple or complex depending on your set of points. If your shape is always convex, flat and the points are in order it shouldn't be too difficult.

Basically, you'll want to write some code to generate the triangles using an index pattern like this:

0,1,2
0,2,3
0,3,4
0,4,5
and so on..

Just remember this only works for ordered indexed vertices and will produce convex shapes like the one you listed.