◆ ClipTriangle()
| static Triangle AsImpL.MathUtil.Triangulation.ClipTriangle |
( |
Vertex |
vertex, |
|
|
List< Vertex > |
vertices |
|
) |
| |
|
static |
◆ TriangulateByEarClipping()
| static List< Triangle > AsImpL.MathUtil.Triangulation.TriangulateByEarClipping |
( |
List< Vertex > |
origVertices, |
|
|
Vector3 |
planeNormal, |
|
|
string |
meshName, |
|
|
bool |
preserveOriginalVertices = true |
|
) |
| |
|
static |
Triangulate a ploygon using ear clipping algorithm.
- Parameters
-
| origVertices | Vertices of the polygon in 3D (assumed to be convex or concave). |
| planeNormal | This is basically a 2D algorithm, this is the normal of the plane used to project 3D vertices in 2D. |
| meshName | |
| preserveOriginalVertices | |
- Returns
- List of triangles as a result of the triangulation process.
Derived (adapted/refactored) from: https://www.habrador.com/tutorials/math/10-triangulation/. The points on the polygon should be ordered counter-clockwise. The ear clipping algorithm is O(n*n), another common algorithm is dividing it into trapezoids and it's O(n log n), one can maybe do it in O(n) time but no such version is known. Assumes we have at least 4 points.
◆ TriangulateConvexPolygon()
| static List< Triangle > AsImpL.MathUtil.Triangulation.TriangulateConvexPolygon |
( |
List< Vertex > |
vertices, |
|
|
bool |
preserveOriginalVertices = true |
|
) |
| |
|
static |
Triangulate a convex polygon maximizing its triangles areas.
- Parameters
-
| vertices | Vertices of the polygon (assumed to be convex). |
| preserveOriginalVertices | If true a copy is made to preserve the original list of vertices. |
- Returns
- List of computed triangles.
The documentation for this class was generated from the following file:
- F:/Unity3D/Projects/DATASET/AsImpL/Assets/AsImpL/Scripts/MathUtil/Triangulation.cs