Get voronoi cells?

Jan 25, 2012 at 12:34 PM

I understand the latest release renames VoronoiMesh.Cells to Vertices, but how do I get the cells so that I can render a solid (random) color per-cell, like you do per-triangle?

Developer
Jan 25, 2012 at 4:21 PM

There is currently no data structure for the voronoi cell (that's why I renamed it to vertices). Your best bet is to extend the DelaunayAndVoronoiWPF example and create polygons from the "voronoi edges" computed in the function btnFindVoronoi_Click.

The best way to do this would probably be to find all adjacent triangles to a vertex, sort their circumcenters in clockwise (or counter clockwise) order and then reconstruct the polygon as edges between consecutive vertices.

Jun 12, 2016 at 3:49 PM
I did some extensions based on the MIConvexHull library that include the ability to retrieve polygons from the mesh points
with arbitrary boundary points. ( actually it works only for 2D )
There is an example here https://github.com/devel0/SearchAThing.Sci.Examples#mesh2d-voronoi-convex-hull

Would nice if the MIConvexHull project here on CodePlex can migrated to Git version, I know this is possible from SVN simply asking at codeplex maintainers but may that feature is available from Mercurial to Git too.