Boost C++ Libraries: Ticket #13096: boost::geometry::intersection results depend on polypoints inputorder https://svn.boost.org/trac10/ticket/13096 <p> Hello, </p> <p> when calculating the intersection of the givin polygons, the result depends on the order of the inputpoints. </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;&gt; boost_polygon; boost_polygon RedPoly, GreenPoly, RedPolyReverted, GreenPolyReverted; boost::geometry::read_wkt("POLYGON((864.11024748062812 524.94908797221251, 881.01048034069004 524.77831898197212, 877.68802698783907 501.82023487475703, 860.75736496460991 501.99865072086430, 864.11024748062812 524.94908797221251))", RedPoly); boost::geometry::read_wkt("POLYGON((864.62221751510151 524.94391475320754, 868.20628459909278 524.90769942280622, 864.93694798456659 502.47800172931238, 861.34657616182551 502.51580174027310, 864.62221751510151 524.94391475320754))", GreenPoly); boost::geometry::read_wkt("POLYGON((860.75736496460991 501.99865072086430, 877.68802698783907 501.82023487475703, 881.01048034069004 524.77831898197212, 864.11024748062812 524.94908797221251, 860.75736496460991 501.99865072086430))", RedPolyReverted); boost::geometry::read_wkt("POLYGON((861.34657616182551 502.51580174027310, 864.93694798456659 502.47800172931238, 868.20628459909278 524.90769942280622, 864.62221751510151 524.94391475320754, 861.34657616182551 502.51580174027310))", GreenPolyReverted); boost::geometry::correct(RedPoly); boost::geometry::correct(GreenPoly); boost::geometry::correct(RedPolyReverted); // reverts order of points and is now equal it RedPoly boost::geometry::correct(GreenPolyReverted); // reverts order of points and is now equal it GreenPoly std::list&lt;boost_polygon&gt; output; boost::geometry::intersection(RedPoly, GreenPoly, output); // error: output is empty std::list&lt;boost_polygon&gt; outputReverted; boost::geometry::intersection(RedPolyReverted, GreenPolyReverted, outputReverted); // correct: outputReverted.front equals GreenPoly return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13096 Trac 1.4.3 kle@… Mon, 26 Jun 2017 11:59:59 GMT attachment set https://svn.boost.org/trac10/ticket/13096 https://svn.boost.org/trac10/ticket/13096 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">examplePolys.png</span> </li> </ul> <p> Plot of example polygons </p> Ticket kle@… Mon, 26 Jun 2017 12:36:32 GMT <link>https://svn.boost.org/trac10/ticket/13096#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13096#comment:1</guid> <description> <p> In addition, if the Polygondefinition is changed from "clockWise-closed" to "clockWise-open", both intersection lists are empty </p> </description> <category>Ticket</category> </item> </channel> </rss>