Пример #1
0
 void Start()
 {
     points = new List <Vector3>(test.points);
     monotones.Clear();
     if (points.Count >= 3)
     {
         monotones = NonMonotoneTriangulation.GetMonotones(points);
     }
     else
     {
         Debug.Log("Polygon Vertex is less than 3! Check it!");
     }
     Debug.Log(monotones[0].Count);
 }
Пример #2
0
 public void Triangulation()
 {
     DiagonalsIndex.Clear();
     Diagonals.Clear();
     triangles.Clear();
     monotones.Clear();
     if (points.Count >= 3)
     {
         triangles = NonMonotoneTriangulation.Triangulate(points);
     }
     else
     {
         Debug.Log("Polygon Vertex is less than 3! Check it!");
     }
 }
Пример #3
0
 public void Monotone()
 {
     DiagonalsIndex.Clear();
     Diagonals.Clear();
     triangles.Clear();
     monotones.Clear();
     if (points.Count >= 3)
     {
         monotones = NonMonotoneTriangulation.GetMonotones(points);
     }
     else
     {
         Debug.Log("Polygon Vertex is less than 3! Check it!");
     }
     foreach (var v in monotones[0])
     {
         Debug.Log("m : " + v);
     }
 }
Пример #4
0
 public void CheckDiagonal()
 {
     DiagonalsIndex.Clear();
     Diagonals.Clear();
     if (points.Count >= 3)
     {
         DiagonalsIndex = NonMonotoneTriangulation.GetDiagonal(points);
     }
     else
     {
         Debug.Log("Polygon Vertex is less than 3! Check it!");
     }
     //対角線インデックスリストを対角線リストに変換する
     foreach (Vector2Int d in DiagonalsIndex)
     {
         Diagonals.Add(new List <Vector3>()
         {
             points[d.x], points[d.y]
         });
     }
 }