Boost C++ Libraries: Ticket #13566: difference and intersection yield wrong result https://svn.boost.org/trac10/ticket/13566 <p> 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 <a class="assigned ticket" href="https://svn.boost.org/trac10/ticket/13522" title="#13522: Bugs: Invalid empty result using boost::geometry::difference (assigned)">#13522</a> and <a class="assigned ticket" href="https://svn.boost.org/trac10/ticket/13553" title="#13553: Bugs: intersection gives wrong result (assigned)">#13553</a>), which are a central part of the algorithm. </p> <p> I posted my original problem as a comment in <a class="assigned ticket" href="https://svn.boost.org/trac10/ticket/13522" title="#13522: Bugs: Invalid empty result using boost::geometry::difference (assigned)">#13522</a> (<a class="ext-link" href="https://wandbox.org/permlink/ThHHAW13DOdHbgEx"><span class="icon">​</span>https://wandbox.org/permlink/ThHHAW13DOdHbgEx</a>) </p> <p> After reading <a class="assigned ticket" href="https://svn.boost.org/trac10/ticket/13553" title="#13553: Bugs: intersection gives wrong result (assigned)">#13553</a> 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 (<a class="ext-link" href="https://wandbox.org/permlink/8YH8EiIRMtsUd1LH"><span class="icon">​</span>https://wandbox.org/permlink/8YH8EiIRMtsUd1LH</a>) The two polygons have finite, not too small intersection, but both the intersection and the difference are empty. </p> <p> 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. </p> <p> Changing the coordinate (0.0054) in the green polygon only slightly yields the correct result. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13566 Trac 1.4.3 Henrik Zimmer <henrik@…> Wed, 16 May 2018 07:01:10 GMT <link>https://svn.boost.org/trac10/ticket/13566#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13566#comment:1</guid> <description> <p> Further description of the problems: </p> <p> 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) </p> <p> 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. </p> </description> <category>Ticket</category> </item> </channel> </rss>