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 e5458f6be..ab49f70ad 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -941,8 +941,12 @@ struct buffered_piece_collection piece pc; pc.type = type; pc.index = static_cast(boost::size(m_pieces)); + + current_segment_id.piece_index = pc.index; + pc.first_seg_id = current_segment_id; + // Assign left/right (for first/last piece per ring they will be re-assigned later) pc.left_index = pc.index - 1; pc.right_index = pc.index + 1; diff --git a/include/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp b/include/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp index e77a163dd..5447c8813 100644 --- a/include/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp @@ -38,6 +38,7 @@ struct segment_identifier , multi_index(-1) , ring_index(-1) , segment_index(-1) + , piece_index(-1) {} inline segment_identifier(signed_size_type src, @@ -48,6 +49,7 @@ struct segment_identifier , multi_index(mul) , ring_index(rin) , segment_index(seg) + , piece_index(-1) {} inline bool operator<(segment_identifier const& other) const @@ -85,6 +87,9 @@ struct segment_identifier signed_size_type multi_index; signed_size_type ring_index; signed_size_type segment_index; + + // For buffer - todo: move this to buffer-only + signed_size_type piece_index; }; diff --git a/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp b/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp index 78c168b5d..376f3b96e 100644 --- a/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp @@ -278,7 +278,7 @@ struct side_sorter std::map handled; find_open_generic < - &segment_identifier::multi_index + &segment_identifier::piece_index >(handled); } else diff --git a/test/algorithms/buffer/buffer_linestring.cpp b/test/algorithms/buffer/buffer_linestring.cpp index 5b0b799a6..87fed599a 100644 --- a/test/algorithms/buffer/buffer_linestring.cpp +++ b/test/algorithms/buffer/buffer_linestring.cpp @@ -175,10 +175,8 @@ void test_all() test_one("overlapping_asym_150_100", overlapping, join_miter, end_flat, 64.984, 1.5, 1.0); // Having flat end -#ifdef BOOST_GEOMETRY_TEST_FAIL_TANGENCIES test_one("for_collinear", for_collinear, join_round, end_flat, 68.561, 2.0, 2.0); test_one("for_collinear", for_collinear, join_miter, end_flat, 72, 2.0, 2.0); -#endif #if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_FAILING_TESTS) test_one("for_collinear2", for_collinear2, join_round, end_flat, 74.387, 2.0, 2.0); test_one("for_collinear2", for_collinear2, join_miter, end_flat, 78.0, 2.0, 2.0); diff --git a/test/algorithms/buffer/buffer_multi_polygon.cpp b/test/algorithms/buffer/buffer_multi_polygon.cpp index 09b88222a..93b748159 100644 --- a/test/algorithms/buffer/buffer_multi_polygon.cpp +++ b/test/algorithms/buffer/buffer_multi_polygon.cpp @@ -355,9 +355,7 @@ void test_all() test_one("degenerate1", degenerate1, join_round, end_flat, 5.708, 1.0); test_one("degenerate2", degenerate2, join_round, end_flat, 133.0166, 0.75); -#ifdef BOOST_GEOMETRY_TEST_FAIL_TANGENCIES test_one("rt_a", rt_a, join_round, end_flat, 34.5381, 1.0); -#endif test_one("rt_a", rt_a, join_miter, end_flat, 36, 1.0); test_one("rt_b", rt_b, join_round, end_flat, 31.4186, 1.0); test_one("rt_b", rt_b, join_miter, end_flat, 34, 1.0); diff --git a/test/algorithms/buffer/buffer_polygon.cpp b/test/algorithms/buffer/buffer_polygon.cpp index 34bfcdb77..31a91d024 100644 --- a/test/algorithms/buffer/buffer_polygon.cpp +++ b/test/algorithms/buffer/buffer_polygon.cpp @@ -358,9 +358,7 @@ void test_all() test_one("gammagate1", gammagate, join_miter, end_flat, 88, 1); test_one("fork_a1", fork_a, join_miter, end_flat, 88, 1); test_one("fork_b1", fork_b, join_miter, end_flat, 154, 1); -#ifdef BOOST_GEOMETRY_TEST_FAIL_TANGENCIES test_one("fork_c1", fork_c, join_miter, end_flat, 152, 1); -#endif test_one("triangle", triangle, join_miter, end_flat, 14.6569, 1.0); test_one("degenerate0", degenerate0, join_round, end_round, 0.0, 1.0);