![]() |
• Math Library | ||||||||||||||
|
API Links
Developer Links
|
Math::TriangulatePolygonalComplexDefined in:
Triangulates a convex or concave polygon having nonzero genus.
C4Computation.hPrototype
Parameters
Description
The TriangulatePolygonalComplex function takes an arbitrary planar polygon having any number of polygonal holes cut out of it, triangulates it, and returns the number of triangles that were generated. The polygonal complex is specified by one or more windings representing the boundary of the interior area. Except in cases in which there are degenerate vertices, the number of triangles generated will be n − 2 + 2g, where n is the sum of the values in the vertexCount array, and g is the genus of the complex, equal to one less than the value of the windingCount parameter.Each of the windings may be convex or concave and may contain sets of collinear vertices. The first winding, whose vertices are specified by the first entries of the vertexCount and vertexIndex arrays, represents the (positive) outer boundary of the complex. It should be wound counterclockwise about the normal direction specified by the normal parameter. The remaining windings represent the boundaries of the (negative) holes that are cut out of the complex. These windings should be wound clockwise (so that the interior of the complex is always on the left-hand side when travelling along any winding). The negative windings must not intersect or enclose any other winding, and each must be completely contained within the positive winding. If these requirements are not met, then the results are undefined.The results are undefined if any input winding is self-intersecting or if the vertices do not lie in a plane that is perpendicular to the normal direction specified by the normal parameter. If any array of vertices contains degenerate entries (a pair of vertices that are very close to each other), then the result may be a subset of the fully triangulated polygonal complex, indicated by the return value being less than n − 2 + 2g.The resulting triangles are returned in the array specified by the triangle parameter. The input vertices are reordered and stored in the array specified by the result parameter. The indexes contained in the triangle array refer to vertices in the result array.If the windingCount parameter is 1 (the minimum value), then this function behaves exactly like the Math::TriangulatePolygon function.
See Also
|