ConstrainedVoronoiDiagram
The Voronoi diagram dual to a ConstrainedDelaunayTriangulation's points, with every cell clipped both to bounds and to the triangulation's ConstrainedDelaunayTriangulation.shape -- so cells never extend outside a non-convex outer contour or across a hole boundary.
This delegates the heavy lifting (circumcenters, exterior-cell rays, rectangle clipping) to an ordinary, unconstrained VoronoiDiagram of the same points, then additionally intersects each resulting cell with shape. When that intersection yields more than one polygon (a cell straddling a hole, for example), the largest (by area) is kept, since cellPolygon returns a single ShapeContour.
Properties
Functions
The centroid of cell i.
The centroids of every cell, in point order.
The Voronoi cell polygon for site i (index into triangulation's points), clipped to bounds.
The Voronoi cell polygons for every site, in point order.
The internal edges of the unconstrained diagram (see VoronoiDiagram.internalEdges) that lie strictly inside shape: both endpoints inside the shape and away from its contours, and the edge not crossing any contour.