-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find_separator_target() FATAL ERROR #18
Comments
add polygon example that causes problems (issue #18)
Thanks for reporting this. |
It's written in java, and I'm not comfortable with C++ enough to port it back. Here's the code: https://gist.github.com/Rogach/a6c75cd90221c09e0f9d It's part of my port of openvoronoi to java - it's almost finished, and I'll upload it to github soon (under GPL 3, of course). |
@aewallin - just in case, want to notify you that I released port of openvoronoi to java, https://github.com/Rogach/jopenvoronoi. Thank you for all your work on this amazing library! |
Thanks for the link. I will include it in the readme for my c++ openvoronoi. On Wed, Feb 11, 2015 at 8:11 PM, Rogach [email protected] wrote:
|
I managed to fix this issue, others that I have opened against openvoronoi and lots of others in java port.
I'll need your permission before I can start backporting this stuff into openvoronoi. Also, I would greatly appreciate any insight on better solutions to aforementioned problems. |
Hi, Have you read the papers by Held on his VRONI implementation? (drop me an Anders On Wed, Feb 25, 2015 at 7:53 PM, Rogach [email protected] wrote:
|
Hi! About tests - I do have a simple text format I used for test-case storage. First goes list of points in "%f,%f" form, then goes list of segments in "%f,%f->%f,%f" form (except that I used Java's %s specifier, that correctly prints doubles to the last significant decimal place, while %f for some reason only prints 6 decimal places). Yes, zipping is nice, Java and Python definitely have readily available facilities for it. Yes, Sugihara's and Held's papers were the real eye-openers for me. My changes were primarily motivated by the fact that in corner cases current implementation fails to provide any solution due to fatal errors after some vertices were positioned extremely incorrectly. The biggest heat comes from the fact that Some praise is in order - while I read quite a bit of source code of different projects, yours is clearly outstanding - I consider it one of the best examples of code structuring. As for the logic/topology, it is presented in the very readable way, almost exactly as it was described in the papers - I don't think that it can be improved further. And multi-step approach to numerical calculations is verbatim right there in VertexPositioner.position() - my changes actually only obscured the intent. |
I'll see what I can do about polygon generator. There are now several interesting things I created to track down bugs in the code:
I don't like C++, but I'll try to build openvoronoi's python bindings on my machine, after that it shouldn't be too hard to port above stuff. |
A common format for text-input is a good idea. We obviously sometimes want 'islands' inside an outer polygon - I'm not For the future I would also like to represent circular arcs somehow. These Hopefully I can find time to cook up a text-file format and some test-cases On Thu, Feb 26, 2015 at 10:51 AM, Rogach [email protected] wrote:
|
Repeating geometry twice makes implementation a bit simpler (all you need is a hasmap on the read side), but that's extremely small matter, so let's use vertex ids. Why do we need to bake particular geometric structure into the text format? From mathematical standpoint, polygon is just a collection of segments, but not every collection of segments is a polygon - and since voronoi diagram is defined for any collection of segments, it doesn't seem right to restrict us to polygons. That is, inside/outside doesn't matter when generating voronoi diagram, or am I forgetting something here? Yes, having shared test base is going to be awesome. |
many downstream algorithms such as medial-axis and offset generation I hope to work on this a bit in the evening. On Fri, Feb 27, 2015 at 6:38 PM, Rogach [email protected] wrote:
|
The following sequence of points gives errors:
Here's the code and output: https://gist.github.com/Rogach/29cf52b69f40cc941fc6
The image of the polygon:
The polygon looks relatively harmless, and I have no idea what the problem may be.
The error is relatively rare with smaller random polygons, but happens often with bigger polygons -it took ~300 random polygons with 4096 points to generate this error, ~30000 with 1024 points, and several million to find a case with 32 points - which I then simplified to the one in above image. (I used my own random polygon generator, not the one used in tests, so it may not happen in your tests)
The text was updated successfully, but these errors were encountered: