Triangulator Methods |
The Triangulator type exposes the following members.
Name | Description | |
---|---|---|
AddHole | AddHole method can be used when Triangulator was created with a single polygon. It adds the specified array of positions as a hole in the original polygon. The orientation of positions (clockwise or anti-clockwise) in the hole must be different from the orientation of positions in the outer polygon. If the orientations are the same, then this method reverses the order of positions in the hole (in this case false is returned). To get triangulated positions and triangle indices call Triangulate(ListVector2, ListInt32) method. | |
CreateTriangleIndices | CreateTriangleIndices method triangulates the specified points and creates a list of triangle indices that define the polygon. | |
GetPositions | Returns the positions that are used by this polygon. | |
Project3DPositionTo2D(Vector3) | Returns an array of 2D points that are created by projecting the 3D positions onto the xy, xz or yz plane (removing one of the coordinates). The plane is determined by checking the normal of the first triangle and determining which component of the normal vector is the biggest (this coordinate is removed). This requires that the positions lie on the same plane. Input positions must not be null or have less than 3 elements. | |
Project3DPositionTo2D(Vector3, Int32) | Returns an array of 2D points that are created by projecting the 3D positions onto the xy, xz or yz plane (removing one of the coordinates). The plane is determined by checking the normal of the first triangle and determining which component of the normal vector is the biggest (this coordinate is removed). This requires that the positions lie on the same plane. Input positions and polygonIndices must not be null or have less than 3 elements. | |
Triangulate(Vector2) | Triangulate method triangulates the specified points and creates a list of triangle indices that define the polygon. | |
Triangulate(ListVector2, ListInt32) | Triangulate method triangulates the polygons that were specified in the constructor and holes that were added by the AddHole(Vector2) method. It sets the triangulated positions (the outer polygons and holes are connected into a single polygon) and triangle indices that can be used to create a 3D mesh. | |
Triangulate(Vector2, ListVector2, ListInt32) | Triangulate method triangulates the polygons with holes and returns positions and triangle indices that can be used to create a 3D mesh. Shape with holes is represented by multiple arrays of positions that are defined by the polygons property. The holes are identified by the orientation of positions (clockwise or anti-clockwise) that is different from the orientation of positions in the outer polygons. The orientation of the outer polygons is defined by the orientation of the first polygon. The method returns a list of triangulated positions (the outer polygons and holes are connected into a single polygon) and a list of triangle indices that used to create a 3D mesh. |