Hacker News new | past | comments | ask | show | jobs | submit login
Interactive Voronoi Diagram Generator with WebGL (alexbeutel.com)
75 points by kaffeemitsahne on June 18, 2017 | hide | past | favorite | 9 comments



If all you need is an image of colored Voronoi regions (and no actual graph structures), there are faster algorithms, for example based on http://fab.cba.mit.edu/classes/S62.12/docs/Meijster_distance... which run in O(width * height + number_of_points) instead of O(width * height + number_of_points * number_of_pixels_on_cone) as this GPU implementation does.


Cool. I suggest having it generate a diagram as soon as the page loads, because when I saw the black canvas I assumed that there was a problem with the WebGL support in my browser.


I made a similar thing couple of years ago http://www.makeitgo.ws/experiments/voronoi_painter/

(ignore the LAB color picker, no idea what I was thinking...)


I made a similar thing but for 3D Voronoi diagrams http://jimmyland.github.io/voro/


From the source:

> var height = coneRadius / Math.tan(45 * Math.PI / 180.0)

Doesn't that just divide coneRadius by 1? Is there something that I'm missing here?


Pretty neat :)

But sometimes straight lines have some kind of angle introduced which shouldn't be there in a correct Voronoi tessellation.

For example: {"sites":[355,413,372,413],"queries":[]} should be a straight line, but has two angles. Have I missed something?


this is something to do with the "triangles/cone" tunable. Changing from the default 50 to 48, the vertical line becomes actually vertical.


Just to be clear, I didn't make this myself, only found it and submitted.


Pretty neat, but would be even nicer if display of the points could be turned off, so that you could see just the resulting shapes, especially with the motion feature.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: