| GeometryHelperTriangulate Method (IListVector3F, 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,
IList<int> triangleIndices
)
Public Shared Function Triangulate (
polygonVertices As IList(Of Vector3F),
triangleIndices As IList(Of Integer)
) As Integer
public:
static int Triangulate(
IList<Vector3F>^ polygonVertices,
IList<int>^ triangleIndices
)
static member Triangulate :
polygonVertices : IList<Vector3F> *
triangleIndices : IList<int> -> int
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:
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 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