Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
Math::Geometry::Voronoi
Math::Geometry::Voronoi
不错的 Python 演示和图形:http://home.scarlet.be/zoetrope/voronoi/ (回退时存档的副本)
Nice demos and graphics for Python: http://home.scarlet.be/zoetrope/voronoi/ (Archived copy at wayback)
刚刚找到这个页面。 在将 Benjamin Dittes 的 Steven Fortune 算法的 C# 版本翻译成 Javascript 后,我一直在使用 Javascript/canvas 开发一个 Voronoi 演示小程序(可在 Code Project 中找到,请参阅“Fortune's Voronoi 算法在 C# 中实现”)。 这是在 Javascript 中包含《财富》Voronoi 算法的页面:
http://www.raymondhill.net/voronoi/voronoi.php
这是第一次迭代,我计划进一步调整它以更好地适合 Javascript。 希望这可以帮助。
Just found this page. I've been working on a Voronoi demo applet using Javascript/canvas, after translating into Javascript a C# version of Steven Fortune's algorithm by Benjamin Dittes (available at Code Project, see "Fortune's Voronoi algorithm implemented in C#"). Here is the page which include Fortune's Voronoi algorithm in Javascript:
http://www.raymondhill.net/voronoi/voronoi.php
This is a first iteration, I plan to adapt it further to be better suited to Javascript. Hope this helps.
首先,这些线条并不奇怪:这是因为这不是正常的 Voronoi 曲面细分,而是面积加权 Voronoi (AWT) 曲面细分,甚至可能是质心 Voronoi 曲面细分 (CVT)。 话虽这么说,为了使 Voronoi 区域(多边形)具有显着不同的面积(这将反映数据的某些属性),您需要 AWT(最好实现为 CVT 以保留多边形的良好纵横比); 普通的 Voronoi 算法(如上面一些人所建议的)将无法帮助您。 对于这个问题可能没有直接的解决方案,尤其是对于脚本语言来说,因为 AWT 的迭代更新步骤导致的计算复杂性非常高。 您应该查找 Balzer 等人关于“Voronoi Treemaps”和“Dynamic Voronoi Treemaps”的工作。 和苏德等人。 了解该算法,然后自己实现它(您需要的一切都在他们的论文中)。
First of all, the lines are not strange: it's the result of the fact that this is not a normal Voronoi tessellation, but an area-weighted Voronoi (AWT) tessellation, possibly even a centroidal Voronoi tessellation (CVT). That being said, in order to have Voronoi regions (polygons) with significantly differing areas (which would reflect some attribute of the data), you need AWTs (preferably implemented as CVTs to retain nice aspect ratios for the polygons); a normal Voronoi algorithm (as suggested by some people above) will not be able to help you. There is probably no direct solution for this available, especially not for scripted languages, since the computational complexity due to iterative updating steps for AWTs is quite high. You should look up the work on "Voronoi Treemaps" and "Dynamic Voronoi Treemaps" by Balzer et al. and Sud et al. to get an idea of the algorithm and then implement it on your own (everything that you need is in their papers).
另一个Python答案似乎指向仅光栅解决方案。 我也有兴趣解决这个问题(在Python中),我认为以下脚本可以形成一个可用的起点:
http://www.oxfish.com/python/voronoi.py
(回程时存档的副本)
the other Python answer seems to point at a raster only solution. I am also interested in solving this problem (in Python) and I think the following script could form a usable starting point:
http://www.oxfish.com/python/voronoi.py
(Archived copy at wayback)
James Tauber 正在编写一个教程,该教程使用 JavaScript 和 Fortune 算法 在中绘制 Voronoi 图一个
canvas
元素: Voronoi Canvas 教程尚未完成(他已完成第 4 部分中的第 3 部分),但我认为已经足够完成它了。
James Tauber is writing a tutorial that uses JavaScript and Fortune's algorithm to draw a Voronoi diagram in a
canvas
element: Voronoi Canvas TutorialIt's not complete yet (he's at part 3 of 4) but there's enough there to complete it I think.
Macrofocus TreeMap 的最新版本 (2.0) 提供了 Voronoi 算法等选项。
The latest version (2.0) of Macrofocus TreeMap has the Voronoi algorithm as an option, among others.