-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fix/issue 1183 get distance measure #1193
Fix/issue 1183 get distance measure #1193
Conversation
The added unit test for float
double
long double
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
My understanding is that replacing distance_measure
with side computation (side_by_triange
seems to have enough accuracy for the tested use cases) resolves the issue.
Is it possible that other issues can be fixed by replacing distance_measure
everywhere in the library? Seems redundant (and also fault sensitive).
Yes, we should deprecate this I first found out that it was more precise, and in some cases it was - but in other cases, it's less precise so it shouldn't been used. |
b93315f
to
914de8d
Compare
Fixes #1183
The
get_distance_measure
(which I introduced some years ago, it's not used much) is not reliable for large values and subtle changes. I have to verify other usages too.For the reported bug, where two segments are equal and the next are nearly equal, we could just use the side value (I don't remember why it was not like that earlier). It also makes that part of the code simpler. The
verify_side
constant is not necessary either.Visual image of the problem:
(green and blue are the two input polygons, red/green outline is union)
It took the wrong continuation after two segments are equal.