-->

Make qhull/qvoronoi limit Voronoi to convex hull o

2020-07-22 10:21发布

问题:

A planar Voronoi tesselation will always have unbounded polygons (infinite regions).

How do I tell qhull/qvoronoi to intersect the tesselation with either the original points' convex hull, or with a polygon I explicitly specify (probably a rectangle).

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

  • I map latitudes/longitudes (inaccurately) to the 2-D rectangle (-180,180)*(-90,90), and apply qvoronoi to the result.

  • I can't handle unbounded polygons and Google Maps API dislikes polygons that wander outside (-180,180)(-90,90) [actually, it's more like (-180,180)(-85,85) because Google uses Mercator]

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

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

标签: qhull