Boost C++ Libraries: Ticket #10642: polygon_set_data<int> bug with small coordinates https://svn.boost.org/trac10/ticket/10642 <p> The attached test program creates a small polygon with a hole and adds it to a polygon_set_data&lt;int&gt;. The internal representation of the polygon set is rather messed up, as you can confirm by calling .get() or .get_trapezoids(). </p> <p> This test program demonstrates the bug by comparing the area of the polygon to the area of a polygon set containing that single polygon. The area of the polygon is correctly computed as 32; the area of the polygon set is incorrectly computed as 30. </p> <p> Doubling all coordinates avoids the bug. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10642 Trac 1.4.3 lopresti@… Thu, 09 Oct 2014 18:53:37 GMT attachment set https://svn.boost.org/trac10/ticket/10642 https://svn.boost.org/trac10/ticket/10642 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boostbug.cc</span> </li> </ul> <p> Small test case demonstrating bug in Boost.Polygon polygon_set_data </p> Ticket Andrii Sydorchuk Wed, 12 Nov 2014 22:06:52 GMT owner changed https://svn.boost.org/trac10/ticket/10642#comment:1 https://svn.boost.org/trac10/ticket/10642#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Lucanus Simonson</span> to <span class="trac-author">Andrii Sydorchuk</span> </li> </ul> Ticket Andrii Sydorchuk Wed, 01 Apr 2015 01:41:07 GMT status, version changed; resolution set https://svn.boost.org/trac10/ticket/10642#comment:2 https://svn.boost.org/trac10/ticket/10642#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.56.0</span> → <span class="trac-field-new">Boost 1.58.0</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Hi Patrick, </p> <p> Thank you for your report. The issue was fixed as part of ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10976" title="#10976: Bugs: Problem with polygon library versions 1.56 and 1.57 (closed: fixed)">#10976</a> . I added your example as another unittest. The fix was merged into master and develop branches and will be part of the Boost 1.58 release. </p> Ticket Andrii Sydorchuk Fri, 03 Apr 2015 22:47:27 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/10642#comment:3 https://svn.boost.org/trac10/ticket/10642#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket anonymous Sat, 04 Apr 2015 16:40:59 GMT <link>https://svn.boost.org/trac10/ticket/10642#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10642#comment:4</guid> <description> <p> Are you sure this is fixed in master? I ask because I just pulled a fresh copy from github and this test case still fails. </p> <p> Also the patch adding the unit test (commit 3189de98d8299075d725bb59beb5c89cf53195e4) appears to have a typo... It reads: </p> <blockquote> <p> BOOST_CHECK_EQUAL(32.0, area(polygon)); BOOST_CHECK_EQUAL(32.0, area(polygon)); </p> </blockquote> <p> I believe one of those should be "area(pset)" instead of "area(polygon)". </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 04 Apr 2015 16:43:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10642#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10642#comment:5</guid> <description> <p> Are you sure this is fixed in master? I ask because I just pulled a fresh copy from github and this test case still fails. </p> <p> Also the patch adding the unit test (commit 3189de98d8299075d725bb59beb5c89cf53195e4) appears to have a typo... It reads: </p> <blockquote> <p> BOOST_CHECK_EQUAL(32.0, area(polygon)); BOOST_CHECK_EQUAL(32.0, area(polygon)); </p> </blockquote> <p> I believe one of those should be "area(pset)" instead of "area(polygon)". </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Sat, 04 Apr 2015 16:48:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10642#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10642#comment:6</guid> <description> <p> No, it's not fixed. That's why the ticket was reopened yesterday. I am going to do a deeper investigation of the issue this weekend. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Mon, 06 Apr 2015 21:16:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10642#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10642#comment:7</guid> <description> <p> The issue is related to the integer grid snapping logic the Polygon uses to handle boolean ops. Basically, any edge of the polygon that has another vertex of a polygon located within an integer 1x1 square has a chance to be broken into two separate edges at that point. That is what happens in this case. One way of fixing it, is to scale polygon to make sure that it doesn't have vertices and edges in 1x1 grid proximity. The best solution would be to fix snapping implementation, however this requires too many changes to the large legacy code base. Thus, I am skipping this option, being a single maintainer. </p> <p> I am going to update the documentation that Polygon operations require sufficient proximity between polygon elements. </p> </description> <category>Ticket</category> </item> </channel> </rss>