void ConvertTriangulationToVoronoi() { // check if there are invalid triangles int invalids = CountInvalidTriangles(triangles, points, true); // findFirst=true if (invalids > 0) { Debug.LogError("Found invalid triangles; triangulation is faulty."); } voronoi = new Voronoi(max_x, max_z); if (invalids == 0) { voronoi.ComputeVoronoi(triangles, points); voronoi.Cleanup(onlyUseVoronoiWithinBoundaries, removeOpenVoronoiCells, removeLonerVoronoiCells); } }