Boost C++ Libraries: Ticket #6958: boost::geometry::intersection on two polygons creates self-intersecting polygon https://svn.boost.org/trac10/ticket/6958 <p> This program intersects two non-self-intersecting polygons and receives a self-intersecting polygon as output. The expected result was a polygon that does not intersect itself. I tested this on SVN revision 78784, and it failed with: </p> <p> A B terminate called after throwing an instance of 'boost::geometry::overlay_invalid_input_exception' </p> <blockquote> <p> what(): Boost.Geometry Overlay invalid input exception </p> </blockquote> <p> Aborted </p> <p> Thanks! Craig </p> <pre class="wiki">#include &lt;cstdio&gt; #include &lt;vector&gt; #include &lt;boost/geometry.hpp&gt; #include &lt;boost/geometry/geometries/point_xy.hpp&gt; #include &lt;boost/geometry/geometries/polygon.hpp&gt; #include &lt;boost/geometry/geometries/register/point.hpp&gt; #include &lt;boost/geometry/geometries/register/ring.hpp&gt; #include &lt;boost/geometry/io/wkt/wkt.hpp&gt; #include &lt;boost/geometry/multi/geometries/multi_polygon.hpp&gt; typedef boost::geometry::model::d2::point_xy&lt;double&gt; pt; typedef boost::geometry::model::polygon&lt;pt&gt; polygon; typedef boost::geometry::model::multi_polygon&lt;polygon&gt; multi_polygon; int main() { polygon green, blue; multi_polygon output; boost::geometry::read_wkt( "POLYGON((0.63872330997599124913 0.25963790394761232516 ," " 0.51901482278481125832 0.36860892060212790966 ," " 0.24443514109589159489 0.62663296470418572426 ," " 0.41175117865081167778 0.47178476291601745274 ," " 0.63872330997599124913 0.25963790394761232516))", green); boost::geometry::read_wkt( "POLYGON((0.52364358028948876367 0.36823021165656988352 ," " 0.7762673462275415659 0.13443113025277850237 ," " 0.59446187055393329146 0.29992923303868185281 ," " 0.52364358028948876367 0.36823021165656988352))",blue); boost::geometry::correct(green); boost::geometry::correct(blue); boost::geometry::detail::overlay::has_self_intersections(green); boost::geometry::detail::overlay::has_self_intersections(blue); printf("A\n"); boost::geometry::intersection(green,blue,output); printf("B\n"); boost::geometry::detail::overlay::has_self_intersections(output); printf("C\n"); return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6958 Trac 1.4.3 Craig Schroeder <snubdodecahedron@…> Thu, 31 May 2012 19:59:55 GMT <link>https://svn.boost.org/trac10/ticket/6958#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6958#comment:1</guid> <description> <p> Try to claim my bug report so I get correspondence. </p> </description> <category>Ticket</category> </item> <item> <author>Craig Schroeder <snubdodecahedron@…></author> <pubDate>Thu, 31 May 2012 20:02:22 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/6958#comment:2 https://svn.boost.org/trac10/ticket/6958#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">snubdodecahedron@…</span> added </li> </ul> Ticket Craig Schroeder <snubdodecahedron@…> Fri, 01 Jun 2012 19:15:47 GMT summary changed https://svn.boost.org/trac10/ticket/6958#comment:3 https://svn.boost.org/trac10/ticket/6958#comment:3 <ul> <li><strong>summary</strong> <span class="trac-field-old">boost::geometry::intersection on two triangles creates self-intersecting polygon</span> → <span class="trac-field-new">boost::geometry::intersection on two polygons creates self-intersecting polygon</span> </li> </ul> Ticket anonymous Fri, 01 Jun 2012 19:34:55 GMT <link>https://svn.boost.org/trac10/ticket/6958#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6958#comment:4</guid> <description> <p> Thanks for the report - I can reproduce your problem but it is not yet fixed </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Fri, 01 Jun 2012 19:36:40 GMT</pubDate> <title>status, milestone changed https://svn.boost.org/trac10/ticket/6958#comment:5 https://svn.boost.org/trac10/ticket/6958#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> Ticket Sybren <sybren@…> Thu, 28 Mar 2013 08:17:39 GMT <link>https://svn.boost.org/trac10/ticket/6958#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6958#comment:6</guid> <description> <p> What is the status of this issue? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Tue, 27 Aug 2013 20:17:54 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/6958#comment:7 https://svn.boost.org/trac10/ticket/6958#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.51.0</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> <p> Fixed in commit 85451, was caused by a generated spike. I will add a unit-test-case for this issue to avoid future regressions. It will be released in Boost 1.55 </p> Ticket