diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index 2015d1836..5cca314df 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -339,10 +339,12 @@ struct buffered_piece_collection for (typename boost::range_iterator::type it = boost::begin(m_turns); it != boost::end(m_turns); ++it) { - if ( it->count_within > 0 - || it->count_on_occupied > 0 ) + if (it->count_within > 0) { - it->location = inside_buffer; + // Within can have in rare cases a rounding issue. We don't discard this + // point, so it can be used to continue started rings in traversal. But + // will never start a new ring from this type of points. + it->selectable_start = false; } } } @@ -550,7 +552,7 @@ struct buffered_piece_collection } - get_occupation(); + //get_occupation(); classify_turns(); diff --git a/test/algorithms/buffer/multi_polygon_buffer.cpp b/test/algorithms/buffer/multi_polygon_buffer.cpp index 810be9d49..aa0f42890 100644 --- a/test/algorithms/buffer/multi_polygon_buffer.cpp +++ b/test/algorithms/buffer/multi_polygon_buffer.cpp @@ -322,9 +322,7 @@ void test_all() test_one("rt_p14", rt_p14, join_miter, end_flat, 20.8284, 1.0); test_one("rt_p15", rt_p15, join_miter, end_flat, 23.6569, 1.0); test_one("rt_p16", rt_p16, join_miter, end_flat, 23.4853, 1.0); -#if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_FAILING_TESTS) test_one("rt_p17", rt_p17, join_miter, end_flat, 25.3137, 1.0); -#endif test_one("rt_p18", rt_p18, join_miter, end_flat, 23.3137, 1.0); test_one("rt_p19", rt_p19, join_miter, end_flat, 25.5637, 1.0); test_one("rt_p20", rt_p20, join_miter, end_flat, 25.4853, 1.0); diff --git a/test/algorithms/buffer/test_buffer.hpp b/test/algorithms/buffer/test_buffer.hpp index 8a586d22b..cd6685d95 100644 --- a/test/algorithms/buffer/test_buffer.hpp +++ b/test/algorithms/buffer/test_buffer.hpp @@ -118,9 +118,13 @@ struct svg_visitor std::string fill = "fill:rgb(0,255,0);"; switch(it->location) { - case bgdb::inside_buffer : fill = "fill:rgb(255,0,0);"; color = 'r'; break; + case bgdb::inside_buffer : fill = "fill:rgb(255,0,0);"; color = 'r'; break; // does not happen anymore case bgdb::inside_original : fill = "fill:rgb(0,0,255);"; color = 'b'; break; } + if (!it->selectable_start) + { + fill = "fill:rgb(255,192,0);"; color = 'o'; // orange + } if (it->blocked()) { fill = "fill:rgb(128,128,128);"; color = '-'; @@ -134,7 +138,7 @@ struct svg_visitor out << " " << bg::method_char(it->method) << ":" << bg::operation_char(it->operations[0].operation) << "/" << bg::operation_char(it->operations[1].operation); - out << " " << (it->count_within > 0 ? "w" : "") + out << " " << (!it->selectable_start ? "w" : "") << (it->count_on_multi > 0 ? "m" : "") << (it->count_on_occupied > 0 ? "o" : "") << (it->count_on_offsetted > 0 ? "b" : "") // b: offsetted border