jbuckmccready / cavalier_contours

2D polyline/shape library for offsetting, combining, etc.
Apache License 2.0
144 stars 12 forks source link

Fix pline intersect function to use pos_equal_eps #22

Closed hhemul closed 2 years ago

hhemul commented 2 years ago
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

jbuckmccready commented 2 years ago

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.