This project is read-only.

Voronoi regions in Beta 4?

Jun 22 at 2:21 PM
where can I enumerate Voronoi regions (and its points) in the Beta 4 implementation?

Could you just point me to the right direction?
Jun 22 at 10:18 PM
Edited Jun 23 at 9:48 AM
It's the Faces property of the DCEL:
var voronoi = new StandardVoronoi(mesh);

foreach (var face in voronoi.Faces)
    HalfEdge e = null;

    foreach (var edge in face.EnumerateEdges())
        e = edge;


    if (!face.Bounded)
EDIT: added code to report points of the Voronoi region.

For unbounded regions, the first and last point reported are not part of the Voronoi diagram (meaning they aren't dual to any triangle), so you decide if you want to have them included or not.
Jun 23 at 12:33 PM
Thanks for that!

I have some code integrating Triangle.NET into Unity here, I can now update it to beta 4. Awesome tools, thanks!