Boost C++ Libraries: Ticket #13072: boost::geometry::intersection different results for CCW and CW https://svn.boost.org/trac10/ticket/13072 <p> Hello,<br /> </p> <p> when calculating the intersection between these two polygons the results differ dependent on the orientation (CW vs CCW). </p> <pre class="wiki"> #include &lt;boost/geometry/geometry.hpp&gt; #include &lt;boost/geometry/geometries/polygon.hpp&gt; #include &lt;boost/geometry/geometries/point_xy.hpp&gt; int main(int argc, char* argv[]) { typedef boost::geometry::model::polygon&lt;boost::geometry::model::d2::point_xy&lt;double&gt;, true, false &gt; boost_polygon_CW_Open; typedef boost::geometry::model::polygon&lt;boost::geometry::model::d2::point_xy&lt;double&gt;, false, false &gt; boost_polygon_CCW_Open; const std::string strPoly1( "POLYGON((986.53314901320903 603.61376367962623, 1014.6804499149767 602.74037774442763, 1018.1411735073581 623.97665453539310, 990.14493850604447 624.49725628790509))" ); const std::string strPoly2( "POLYGON((986.77183669558929 603.60635741124452, 998.79457181965154 603.23330253835934, 1002.2613711877982 623.79581100129735, 990.30090761267468 624.02156931285253))" ); boost_polygon_CW_Open p1_cw_open, p2_cw_open; boost::geometry::read_wkt(strPoly1, p1_cw_open); boost::geometry::read_wkt(strPoly2, p2_cw_open); boost::geometry::correct(p1_cw_open); // reverts order of points boost::geometry::correct(p2_cw_open); // reverts order of points std::vector&lt;boost_polygon_CW_Open&gt; output_cw; boost::geometry::intersection(p1_cw_open, p2_cw_open, output_cw); // correct: output_cw.front equals poly2 boost_polygon_CCW_Open p1_ccw_open, p2_ccw_open; boost::geometry::read_wkt(strPoly1, p1_ccw_open); boost::geometry::read_wkt(strPoly2, p2_ccw_open); boost::geometry::correct(p1_ccw_open); // no modification boost::geometry::correct(p2_ccw_open); // no modification std::vector&lt;boost_polygon_CCW_Open&gt; output_ccw; boost::geometry::intersection(p1_ccw_open, p2_ccw_open, output_ccw); // incorrect: output_cw is empty!!! return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13072 Trac 1.4.3 kle@… Wed, 14 Jun 2017 10:58:26 GMT attachment set https://svn.boost.org/trac10/ticket/13072 https://svn.boost.org/trac10/ticket/13072 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">examplePolys.png</span> </li> </ul> <p> Plot of example polygons </p> Ticket Barend Gehrels Wed, 14 Jun 2017 13:13:25 GMT status changed https://svn.boost.org/trac10/ticket/13072#comment:1 https://svn.boost.org/trac10/ticket/13072#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket