Skip to content
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 pline intersect function to use pos_equal_eps #22

Merged
merged 3 commits into from Jul 2, 2022

Conversation

hhemul
Copy link
Contributor

@hhemul hhemul commented Jun 22, 2022

In case of segments not intersecting but close enough (in pos_equal_eps box) there will be incorrect behavior. If bound boxes isn't overlap but segments intrsects.
For examle: 2 perpendicular segments
*
|
|
*
-------
with distance between less than pos_equal_eps but greter than T::epsilon()
In that case should be intersection but it won't

In case of segments not intersecting but close enough (in pos_equal_eps box) there will be incorrect behavior. If bound boxes isn't overlap but segments intrsects.
For examle: 2 segments
    *
    |
    |
    *
*-------*
with distance between less than pos_equal_eps but greter than T::epsilon()
In that case should be intersection but it won't
@jbuckmccready
Copy link
Owner

Thanks for the pull request! Good catch, the "fuzz" variable was old code that I missed updating.

Can you add a unit test case which fails before the change and passes after the change in the test module at the bottom of the file?

I think it should be easy to trigger with two perpendicular lines as polylines similar to the ascii picture you made.

@jbuckmccready jbuckmccready changed the title It seems fuzz should be equal pos_equal_eps Fix pline intersect function to use pos_equal_eps Jul 2, 2022
@jbuckmccready jbuckmccready merged commit eefb207 into jbuckmccready:master Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants