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); }
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!"); } }
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); } }
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] }); } }