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

voronoi diagrams
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Voronoi diagrams

Marko Täht

slide-2
SLIDE 2

Content

  • Voronoi diagram
  • Delauney triangulation
  • How to create Voronoi diagram
  • Uses of voronoi diagrams
slide-3
SLIDE 3

Voronoi diagram

  • Voronoi diagram is partitioning of space into areas based on distance

to points in a specific subset of the space.

slide-4
SLIDE 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)

slide-5
SLIDE 5

Centroidal Voronoi Tesselation

  • Voronoi tessellation is centroidal if each of the point is also the center
  • f mass for its cell.
slide-6
SLIDE 6

Weighted Voronoi Diagram

  • Multiplicative weighted Voronoi diagram
  • Distance between points is multiplied by positive weights
  • Also known as circular Dirichlet tesselation
slide-7
SLIDE 7
  • Additively weighted Voronoi Diagram
  • Positive weights are subtracted from distance between points
  • Also known as hyperpolic Dirichlet tesselation
slide-8
SLIDE 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.

slide-9
SLIDE 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

slide-10
SLIDE 10

Terrain generation using Delauney

  • https://straypixels.net/delaunay-triangulation-terrain/
slide-11
SLIDE 11

How to create voronoi diagram

  • Brute force method
  • Fortunes algorithm
  • Bowyer-Watson algorithm
slide-12
SLIDE 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
slide-13
SLIDE 13

Brute force

  • Easy to implement
  • Sufficient for small number of points
  • Too slow for large number of poitns
slide-14
SLIDE 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)
slide-15
SLIDE 15

Beachline

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

slide-16
SLIDE 16

Site event

  • New point from the queue is added to the beachline.
slide-17
SLIDE 17

Circle event

  • Arc is removed from the beachline
slide-18
SLIDE 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)

slide-19
SLIDE 19
  • Pros:
  • Fast
  • Cons:
  • Difficult to understand
  • Difficult to implement
  • Implementation can have many special cases
  • Lose the benefits when extended to higher dimensions
slide-20
SLIDE 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

slide-21
SLIDE 21
slide-22
SLIDE 22

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.
slide-23
SLIDE 23

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
slide-24
SLIDE 24

Uses of Voronoi diagram

  • Use for AI
  • Procedual generation
  • Art
  • Calculate cracks in objects
slide-25
SLIDE 25

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.

slide-26
SLIDE 26

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
slide-27
SLIDE 27

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.

slide-28
SLIDE 28
  • Or having more control on over where the points are generated or

how they are colored, can be used to generate art.

slide-29
SLIDE 29

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.
slide-30
SLIDE 30
slide-31
SLIDE 31

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/