Click or drag to resize
DigitalRuneGeometryHelperTriangulate Method (IListVector3F, IListInt32)
Triangulates a polygon specified by a list of vertices.

Namespace: DigitalRune.Geometry
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public static int Triangulate(
	IList<Vector3F> polygonVertices,
	IList<int> triangleIndices
)

Parameters

polygonVertices
Type: System.Collections.GenericIListVector3F
The vertices.
triangleIndices
Type: System.Collections.GenericIListInt32
The list that stores the resulting triangles: Each value in the list is an index into polygonVertices; three indices define a triangle.

Return Value

Type: Int32
The number of triangles added to triangleIndices.
Exceptions
ExceptionCondition
ArgumentNullExceptionpolygonVertices or triangleIndices is .
Remarks

The method supports triangulation of convex and concave polygons. The polygon needs to be planar. Either the x, y, or z component of the vertices should be constant.

Polygons with duplicate points, holes, or self-intersections are not supported. (The result can be a partially or incorrectly triangulated polygon.)

The resulting triangles have the same winding order as the polygon vertices.

See Also