Make the qhull / qvoronoi Voronoi limit a convex hull or a given polygon

Voronoi’s flat design will always have unlimited polygons (infinite areas).

To report qhull / qvoronoi the intersection of tessellation using the convex hull of the starting points or explicitly with the polygon I specify (possibly a rectangle).

Specific example ( https://github.com/barrycarter/bcapps/blob/master/bc-temperature-voronoi.pl ):

  • I match the latitude / longitude (inaccurate) with the two-dimensional rectangle (-180,180) * (- 90.90) and apply qvoronoi to the result.

  • I can’t handle unlimited polygons and the Google Maps API doesn’t like polygons that wander outside (-180,180) (- 90.90) [in fact, it looks more like (-180,180) (- 85.85) because Google uses Mercator]

  • Can I make qhull / qvoronoi intersect the polygons with points of a 'convex hull and / or rectangle (-180,180) * (- 90.90)? Of course, the convex hull is entirely contained within the rectangle.

  • If not, can another program do this? I suspect I can write this but would prefer an existing solution.

+3
source share

All Articles