-
Notifications
You must be signed in to change notification settings - Fork 21
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
The selection of distance #16
Comments
Hi, and sorry about the late reply. Well! It was five years ago, and all I remember I was panicking and going by trial and error :D. Anyhow, let's reverse engineer this. This is about the f) point of the algorithm (nonconvex case, p8). As usual with the paper, the wording is extremely vague: "store the nearest intersection into the priority queue", nearest to what. Originally I thought "the event that would happen the earliest" (distance to the edge), but that gives incorrect results (run the demo on south_africa with the earlier version and you'll see the problem in the lower right corner. Also, if it were the earliest event, we could just dump all events to the priority queue, and the selection would take care of it, so "nearest to the vertex" sounds better. Why is it better, though? I can't formulate it, but I think it's got something to do with locality. The three possible events generated have no regard to the other vertices, other events. The likeliest of these to occur is the one that's closest to the current vertex, the one that implies the least slope, the one the current vertex affects the most. At least that's how I imagine it. I wish I could be of more help. |
Ahhhh, I knew we fail horribly for highly symmetrical polygons with vertex edges, but I didn't realize it's THIS horrible :D. I should mention this in the readme. At least it's consistent, though! Originally I made this as a part of a map labeling system which used country shapes as inputs. The issue doesn't surface there, as countries are rarely if ever symmetrical. No, I didn't read the paper, but I know about the CGAL implementation of course. Cacciola introduced "multi-events" for when there are multiple events happening at the same point. Polyskel merrily ignores these (the first event happens, then it invalidates the further events). And that causes this behavior, at least I always assumed so. Now I'm not so certain. I may look into it this weekend (pull requests are welcome, though!) |
Good Morning, Botffy. Don't know where you live, greeting from UTC+8. |
Hi, Botffy
Thanks for your great job, it helps me a lot.
I have a question about the selection of distance when compare the priority of events. I saw you chose the distance between two points rather than the distance between the intersect point and the edge, which is described in the paper. Here is the change you made in one of your commit:
I'm a bit of confused, Can you explain why you made this change?
Thank you so much~
The text was updated successfully, but these errors were encountered: