Make qhull/qvoronoi limit Voronoi to convex hull or given polygon

对着背影说爱祢 提交于 2019-12-06 06:47:05

问题


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.

来源:https://stackoverflow.com/questions/5928738/make-qhull-qvoronoi-limit-voronoi-to-convex-hull-or-given-polygon

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!