| GeometryHelperTriangulate Method (IListVector3F, Int32, Int32, IListInt32) |
Triangulates a polygon specified by a list of vertices.
Namespace: DigitalRune.GeometryAssembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax public static int Triangulate(
IList<Vector3F> polygonVertices,
int startIndex,
int vertexCount,
IList<int> triangleIndices
)
Public Shared Function Triangulate (
polygonVertices As IList(Of Vector3F),
startIndex As Integer,
vertexCount As Integer,
triangleIndices As IList(Of Integer)
) As Integer
public:
static int Triangulate(
IList<Vector3F>^ polygonVertices,
int startIndex,
int vertexCount,
IList<int>^ triangleIndices
)
static member Triangulate :
polygonVertices : IList<Vector3F> *
startIndex : int *
vertexCount : int *
triangleIndices : IList<int> -> int
Parameters
- polygonVertices
- Type: System.Collections.GenericIListVector3F
The vertices. - startIndex
- Type: SystemInt32
The index of the start vertex in polygonVertices.
- vertexCount
- Type: SystemInt32
The number of vertices in the polygon. - 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:
Int32The number of triangles added to
triangleIndices.
Exceptions 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 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