Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Voronoi diagram  (Read 3507 times)

0 Members and 1 Guest are viewing this topic.

CH43

  • Newbie
  • *
  • Posts: 2
    • View Profile
Voronoi diagram
« on: July 19, 2018, 07:03:25 pm »
Hey!
So i want to programm a voronoi diagram.
I dont have any problems with the theory and stuff. The problem is the wikipedia entry where they illustrate it with radial growth like this:
https://upload.wikimedia.org/wikipedia/commons/d/d9/Voronoi_growth_euclidean.gif

So now of course i also want to make an animation like that. But i dont really get how the Polygon-Circle Shapes are being made(The lines where the Circles meet and form a partial circle if you know what i mean). I thought about a Circle as Convex Shape, calculating the "Voronoi Lines" and recalculating the convex Shapes(Problem here is, that i would need to calculate a Circle in the first place). That just doesn't seem so right/elegant...Is there some kind of efficient/more elegant way of doint it?
Someone here with a better Idea?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Voronoi diagram
« Reply #1 on: July 19, 2018, 08:40:11 pm »
You could use Selba Ward's Pie Chart or Ring to draw a sector of a circle.

Was the sector your problem?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

CH43

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Voronoi diagram
« Reply #2 on: July 19, 2018, 09:06:45 pm »
Awesome! I think that should do it, thanks! :)

Yeah, i didnt know how to draw a circle without segments. But im still interested on how to calculate/program that by myself(well, i know how to calculate a segment but i guess you know what i mean :P).

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Voronoi diagram
« Reply #3 on: July 20, 2018, 08:10:38 pm »
Just realised that you might actually need the segment of a circle (edge piece with a flat line), which those classes don't do. Yet. It's not something I'd considered but now is something I'd like to add to Selba Ward - eventually ;D

The sector that I mentioned previously is a 'pizza slice'.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*