Create composite shape of line list

Sep 30, 2010 at 1:36 PM

Hi,

I am looking for a method to create a composite shape of polgons from a point list that represents a concave polygon.

Is there such a method in the shapes library?

Coordinator
Nov 15, 2010 at 1:23 PM

Hi malignate88,

sorry for the late reply.

 

The shapes library uses a Vector2-Array to initialize a LineStrip. The Polygon constructor needs a LineStrip. so what you need is a Vector2-Array.

Because a Shapes-Library-Polygon is always 2D it wouldn't make sense to feed the constructor with a PointList (which has 3D-koordinates). But it shouldn't be too hard to write a PointList-Extension which drops an axis and converts it to a Vector2-Array... ;)

 

Composite Shapes is no problem. But there is no optimization for Polygon-Only-Compositions. Concave Polygons are also no problem. Note that the visualization of polygons is done by a scanline algorithm. There is no triangulation.

 

Fazit: it is possible, but you have to write a little bit of code yourself (if i understood your question correctly).