mdally / Voronoi

C++ implementation of Fortune's Algorithm for computing bounded Voronoi diagrams
MIT License
25 stars 14 forks source link

Crash and bug #4

Open alphaonex86 opened 7 years ago

alphaonex86 commented 7 years ago

Hi, I have try your lib: https://github.com/alphaonex86/CatchChallenger/tree/20e0af50e4c60611bea6dab2c2c02db4759feed8/tools/map-procedural-generation-terrain

1) it's buggy, the polygon is deformed 2) it crash if I have 9999 sites (points) and https://github.com/alphaonex86/CatchChallenger/blob/20e0af50e4c60611bea6dab2c2c02db4759feed8/tools/map-procedural-generation-terrain/main.cpp#L424 for 999 loop 3) Example genRandomSites() is unclear about BoundingBox& bbox, mostly with this unintuitive line bbox = BoundingBox(0, dimension, dimension, 0);

Cheers,

mdally commented 7 years ago
  1. Hm, I haven't had any issues with deformed polygons on my end. Can you attach a text file with the point coordinates and bounding box you used that resulted in deformed cells?

  2. Every time you run relax(), it generates a completely new diagram and does not delete the old one. If you want to avoid memory leaks, you must delete the old one yourself.

  3. The bounding box follows an old computer graphics convention that y=0 at the top of the screen and increases as it goes down. Sorry about the confusion, I may change how this works in a later update.

alphaonex86 commented 7 years ago

1) http://ultracopier.first-world.info/temp/all.tmx 2) I don't have memory leak, but a SEGFAULT

mdally commented 7 years ago

Sorry, for 1 & 2, I need a file that has just the stuff you pass to my library, the bounding box info and source point coordinates, so I can run through it on my end.

Something like this:

box: 0 10000 10000 0 p1: 245.234 234.754 p2: 987.323 853.234 ...... etc.

alphaonex86 commented 7 years ago

Hi,

You can compil my code, the debug will be more efficience to debug: https://github.com/alphaonex86/CatchChallenger/blob/20e0af50e4c60611bea6dab2c2c02db4759feed8/tools/map-procedural-generation-terrain/main.cpp#L421 -> replace 30 by 999 https://codeload.github.com/alphaonex86/CatchChallenger/zip/20e0af50e4c60611bea6dab2c2c02db4759feed8

Cheers,