DesignEngrLab / MIConvexHull

A .Net fast convex hull library for 2, 3, and higher dimensions.
http://designengrlab.github.io/MIConvexHull/
MIT License
338 stars 60 forks source link

Delaunay Triangles Created Incorrectly #48

Open bnguyenKns opened 2 years ago

bnguyenKns commented 2 years ago

So I tried to find Delaunay Triangle for a set of 134 points. After getting the list of triangular cells, I tried to plot them on Python, but the result is incorrect. Did I miss something when trying to execute CreateDelaunay()?

private static IEnumerable<DefaultTriangulationCell> DelaunayTriangulation(Dictionary<Point, double> dataForInterpolation) { List vertices = new List(); foreach (var item in dataForInterpolation) { vertices.Add(new Vertex(item.Key.X, item.Key.Y)); } var delaunayTriangles = Triangulation.CreateDelaunay<Vertex, DefaultTriangulationCell>(vertices).Cells; return delaunayTriangles; } Figure_0