Boost C++ Libraries: Ticket #10976: Problem with polygon library versions 1.56 and 1.57 https://svn.boost.org/trac10/ticket/10976 <p> It seems that the problem is due to the change of polygon of boost version 1.56. The function is question is </p> <blockquote> <p> insert_vertex_sequence in polygon_set_data.hpp </p> </blockquote> <p> In the modified function in version 1.56 the check if the data submitted to the function refer to a hole is missing, as well as the corresponding inversion of the multiplier. Since the attribute is_hole is still present in the argument list of the function I presume that the check was lost. Insertion of this check produces the expected results. </p> <p> --- snip -------------------------------------------------------------- </p> <blockquote> <p> template &lt;class iT&gt; inline void insert_vertex_sequence(iT begin_vertex, iT end_vertex, direction_1d winding, bool is_hole) { </p> <blockquote> <p> if (begin_vertex == end_vertex) { </p> <blockquote> <p> <em> No edges to insert. return; </em></p> </blockquote> <p> } <em> Current edge endpoints. iT vertex0 = begin_vertex; iT vertex1 = begin_vertex; if (++vertex1 == end_vertex) { </em></p> <blockquote> <p> <em> No edges to insert. return; </em></p> </blockquote> <p> } int wmultiplier = (winding == COUNTERCLOCKWISE) ? 1 : -1; if(is_hole) wmultiplier *= -1; <em> &lt;-------------------------patch with respect to 1.55 dirty_ = true; unsorted_ = true; while (vertex0 != end_vertex) { </em></p> <blockquote> <p> point_type p0, p1; assign(p0, *vertex0); assign(p1, *vertex1); if (p0 != p1) { </p> <blockquote> <p> int hmultiplier = (p0.get(HORIZONTAL) == p1.get(HORIZONTAL)) ? -1 : 1; element_type elem(edge_type(p0, p1), hmultiplier * wmultiplier); insert_clean(elem); </p> </blockquote> <p> } ++vertex0; ++vertex1; if (vertex1 == end_vertex) { </p> <blockquote> <p> vertex1 = begin_vertex; </p> </blockquote> <p> } </p> </blockquote> <p> } </p> </blockquote> <p> } </p> </blockquote> <p> --- snap -------------------------------------------------------------- </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10976 Trac 1.4.3 Uwe Keller <Uwe.Keller@…> Wed, 28 Jan 2015 09:05:49 GMT <link>https://svn.boost.org/trac10/ticket/10976#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10976#comment:1</guid> <description> <p> Hi Luke, tried to contact you by email but it bounced back. So I chode this way, regards, Uwe. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Sun, 08 Feb 2015 22:12:34 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/10976#comment:2 https://svn.boost.org/trac10/ticket/10976#comment:2 <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 Björn Piltz <bjornpiltz@…> Fri, 06 Mar 2015 09:34:48 GMT cc changed https://svn.boost.org/trac10/ticket/10976#comment:3 https://svn.boost.org/trac10/ticket/10976#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">bjornpiltz@…</span> added </li> </ul> Ticket Andrii Sydorchuk Fri, 20 Mar 2015 20:49:13 GMT <link>https://svn.boost.org/trac10/ticket/10976#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10976#comment:4</guid> <description> <p> Hi Uwe, </p> <p> Thank you for your report. Indeed, the regression was introduced in Boost 1.56. I applied the fix and going to add unit tests to cover the issue. The fix will be merged into release branch of Boost 1.58. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Fri, 20 Mar 2015 21:44:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10976#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10976#comment:5</guid> <description> <p> The fix with the corresponding test was pushed to the develop branch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Fri, 20 Mar 2015 21:55:37 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10976#comment:6 https://svn.boost.org/trac10/ticket/10976#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> The fix was pushed to the master branch. </p> Ticket mhilferink@… Tue, 30 Jun 2015 10:50:14 GMT <link>https://svn.boost.org/trac10/ticket/10976#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10976#comment:7</guid> <description> <p> Note that <em>insert_vertex_sequence()</em> calls <em>insert_clean(elem)</em> which has <em>is_hole</em> as a second optional parameter and already has code to reverse the orientation. It would be cleaner to pass <em>is_hole</em> to <em>insert_clean</em> and avoid scattering the orientation logic around. </p> <p> BTW, why is on various places the orientation reversed if a edge is horizontal or vertical? I can see that intersected segments can have a reversed order of first and second point due to round off, making a vertical (S&lt;-N) segment from an (NW-&gt;SE) edge, or a (S-&gt;N) segment from a (SE&lt;-NW) edge. But reversing on specific directions such as in validate_scan, independent of whether point order did change or the points were actually swapped, seems something that is attempted to be compensated elsewhere, such as in _processEvent. </p> </description> <category>Ticket</category> </item> </channel> </rss>