voronoi diagrams
play

Voronoi diagrams Marko Tht Content Voronoi diagram Delauney - PowerPoint PPT Presentation

Voronoi diagrams Marko Tht Content Voronoi diagram Delauney triangulation How to create Voronoi diagram Uses of voronoi diagrams Voronoi diagram Voronoi diagram is partitioning of space into areas based on distance to


  1. Voronoi diagrams Marko Täht

  2. Content • Voronoi diagram • Delauney triangulation • How to create Voronoi diagram • Uses of voronoi diagrams

  3. Voronoi diagram • Voronoi diagram is partitioning of space into areas based on distance to points in a specific subset of the space.

  4. Voronoi properties • Is a dual graph for Delauney Triangulation • Closest pair of points correspond to adjaisent cells in diagram • Small change in a site location corresponds to a small change in Diagram (http://blog.ivank.net/voronoi-diagram-in-javascript.html)

  5. Centroidal Voronoi Tesselation • Voronoi tessellation is centroidal if each of the point is also the center of mass for its cell.

  6. Weighted Voronoi Diagram • Multiplicative weighted Voronoi diagram • Distance between points is multiplied by positive weights • Also known as circular Dirichlet tesselation

  7. • Additively weighted Voronoi Diagram • Positive weights are subtracted from distance between points • Also known as hyperpolic Dirichlet tesselation

  8. Delauney triangulation • On a plane triangulation of a set of points, in such way that no point is in a circumcircle of any triangle.

  9. Delauney properties • Connecting the circumcircle centers you get the Voronoi graph for the given set of points • Maximises the minimum angle not the edge length Maximise minumum angle

  10. Terrain generation using Delauney • https://straypixels.net/delaunay-triangulation-terrain/

  11. How to create voronoi diagram • Brute force method • Fortunes algorithm • Bowyer-Watson algorithm

  12. Brute force • Choose a point • Calculate distance to every other point • Choose the point closest • Make a bisecting edge between the 2 points • Remove all the points in the direction of the other point that are further away than the point. • Repeat until no more points can be removed • Find intersections of adjaicent eges • Connect edges on intersection points

  13. Brute force • Easy to implement • Sufficient for small number of points • Too slow for large number of poitns

  14. Fortune algorithm • Also known as sweepline algorithm • Runs in O(n log n) • Required data structures: • Binary tree (beach line) • Sweepline (y coordinate of sweeplie) • Priority queue (sort events by y coordinate) • Event types: • Site event (new arc added to beach line) • Circle event (Arc is removed from beach line)

  15. Beachline Used to easily find arc under a new site and to check for circle events.

  16. Site event • New point from the queue is added to the beachline.

  17. Circle event • Arc is removed from the beachline

  18. Algorithm Q = queue P = set of points For each p in P: Q.add(new SiteEvent(P)) While Q is not empty: q = Q.pop() if q is site event: handleSiteEvent(q) else handleCircleEvent(q)

  19. • Pros: • Fast • Cons: • Difficult to understand • Difficult to implement • Implementation can have many special cases • Lose the benefits when extended to higher dimensions

  20. Bowyer-Watson algorithm • Used to create Delauney triangulation in N-dimension • Algorithm: • List triangulation Add triangle that envelops all the points in the triangulation list 1. Add point 2. Find all triangles where the new point is in (bad triangles) 3. Find all edges that are between bad triangle and good triangle 4. Construct new triangles with the edges 5. Remove bad triangles 6. Repeat until no more points can be added Remove all triangles that have a vertex from the super triangle

  21. Pros: • Works in N-dimensions • Easy to implement • With optimizations runs in O(N log N) • Cons: • Worst case performance O(N^2) • Delauney -> Voronoi: • Find all the circumcenters of the tringles • Connect adjaisent triangle circumcenters with edge.

  22. Centroidal Voronoi Diagram Creation • Created using Lloyds algorithm • Random points are generated • Voronoi diagram Is calculated • For each cell calculate center of mass • Move point to the center of mass • Repeat

  23. Uses of Voronoi diagram • Use for AI • Procedual generation • Art • Calculate cracks in objects

  24. Voronoi diagram for AI control • https://gamedevelopment.tutsplus.com/tutorials/how-to-use- voronoi-diagrams-to-control-ai--gamedev-11778 • Find nearest health pack, safe point, etc. • Find safest route to finish. Closeness to points adds weight to voronoi edges. Use some pathfinding algorithm over the edges to find the path with minimum weight.

  25. Terrain generation using Voronoi diagram • https://squeakyspacebar.github.io/2017/07/12/Procedural-Map- Generation-With-Voronoi-Diagrams.html • http://www-cs-students.stanford.edu/~amitp/game- programming/polygon-map-generation/ • https://watabou.itch.io/medieval-fantasy-city-generator

  26. Art • http://www.jfernquist.com/voronoiArt.html • Convert images into voronoi diagrams. • Edges and darker colors get more points. Each cell is colored with the mean color of the original pixels in the cell.

  27. • Or having more control on over where the points are generated or how they are colored, can be used to generate art.

  28. Calculate cracks in objects • https://www.microsoft.com/en-us/research/wp- content/uploads/2016/12/Efficient-Computation-of-3D-Clipped- Voronoi-Diagram.pdf • Calculate Voronoi diagram. • Clip it into shape.

  29. Used literature • https://en.wikipedia.org/wiki/Fortune%27s_algorithm • https://en.wikipedia.org/wiki/Voronoi_diagram • https://en.wikipedia.org/wiki/Delaunay_triangulation • https://en.wikipedia.org/wiki/Lloyd%27s_algorithm • https://en.wikipedia.org/wiki/Bowyer%E2%80%93Watson_algorithm • http://blog.ivank.net/fortunes-algorithm-and-implementation.html • http://old.cescg.org/CESCG99/RCuk/index.html • http://www.ams.org/samplings/feature-column/fcarc-voronoi • https://www.desmos.com/calculator/ejatebvup4 • https://www.codeproject.com/Articles/882739/Simple-approach-to-Voronoi-diagrams • http://www.gdmc.nl/publications/2002/Bowyer_Watson_algorithm.pdf • https://takisword.wordpress.com/2009/08/17/bowyerwatson-algorithm-3d/

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend