-
-
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
Fixes point not detected in polygon #46
Conversation
This value of epsilon currently set works well with the example meshes, but will fail with meshes at a smaller scale, which is what you're getting. I think changing the value has some small perf impact. Ideally instead of it being a const, it should be possible to set it like A value of delta / 10 would be a good default, in your case that would be 1e-3, is that small enough for your mesh? |
It will be a bigger change but I can make it. I assumed the I assume the performance implication is just less points being classified as edges and an edge uses less expansions? For the change, should I just change |
I think so Could be worth running the benches on another computer than mine, could you try running them on yours?
Maybe https://doc.rust-lang.org/std/primitive.f32.html#associatedconstant.EPSILON would actually make sense instead of another "magic" value |
I ran the benchmarks with 1e-6 as a baseline. Changing it back to 1e-2 most of the benches were within error except for these two which "regressed" (most likely just noise).
Changing it to
Edit: Sorry posted too soon |
Ok, I did a clean bench with 1e-2 as the base and another as f32::EPSILON. It didn't find any regressions so I think any changes in performance are just noise from running the test (positive and negative). |
Ok, I think this is probably the best I can get it outside being variable but that will have its own issues. To account for this, I added a more complicated line to test against. This failed for the For reference, the default in the cpp implementation is |
thanks for investigating! |
This fixes some cases where a path was not being found. Specifically when a point was close to the edge it was detected as an
Edge
and not as part of the polygon. This test was quick heavy handed which caused a lot of false positives.Most of the failures in mentioned in #45 were caused by this.