Opened 4 years ago
Last modified 4 years ago
#13566 new Bugs
difference and intersection yield wrong result
Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|
Milestone: | To Be Determined | Component: | geometry |
Version: | Boost 1.66.0 | Severity: | Showstopper |
Keywords: | Cc: | henrik@… |
Description
We are developing new algorithm that will hopefully be based on boost::geometry. Unfortunately we have come across some errors in the difference and intersection computations (possibly related to #13522 and #13553), which are a central part of the algorithm.
I posted my original problem as a comment in #13522 (https://wandbox.org/permlink/ThHHAW13DOdHbgEx)
After reading #13553 I tried out the define BOOST_GEOMETRY_NO_ROBUSTNESS which at first seemed to work. However, I then ran into a problem at another position (https://wandbox.org/permlink/8YH8EiIRMtsUd1LH) The two polygons have finite, not too small intersection, but both the intersection and the difference are empty.
The problem seems be that the two geometries overlap almost exactly in one vertex (0.0054, -0.02436) - this is the second vertex of the green polygon and the first vertex of the blue polygon.
Changing the coordinate (0.0054) in the green polygon only slightly yields the correct result.
Further description of the problems:
In the first problem scenario (without using define BOOST_GEOMETRY_NO_ROBUSTNESS) the two polygons barely touched, hence I would except the intersection to be empty and the difference to be equal to one of the input polygons. (But it was also empty)
In the second problem scenario (with define BOOST_GEOMETRY_NO_ROBUSTNESS) the two polygons had a clear intersection, hence I would expect neither difference nor intersection to be empty.