mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[overlay] fix case where a union is traveled. As it now appears, due
to new cluster handling, all uu turns can (and should) be discarded for intersections
This commit is contained in:
parent
7f157a2d56
commit
16f2bcf357
@ -345,6 +345,13 @@ inline void enrich_intersection_points(Turns& turns,
|
||||
{
|
||||
turn.discarded = true;
|
||||
}
|
||||
if (for_operation == detail::overlay::operation_intersection
|
||||
&& turn.both(detail::overlay::operation_union))
|
||||
{
|
||||
// For intersections, remove uu to avoid the need to travel
|
||||
// a union (during intersection) in uu/cc clusters (e.g. #31,#32,#33)
|
||||
turn.discarded = true;
|
||||
}
|
||||
if (turn.both(detail::overlay::operation_continue))
|
||||
{
|
||||
has_cc = true;
|
||||
|
@ -890,6 +890,14 @@ static std::string case_recursive_boxes_43[2] =
|
||||
"MULTIPOLYGON(((1 0,0 0,0 5,3 5,5 5,5 0,1 0),(1 0,2 1,1 1,1 0)))"
|
||||
};
|
||||
|
||||
static std::string case_recursive_boxes_44[2] =
|
||||
{
|
||||
// Needs discarding uu turns in intersections, either globally or in aggregations
|
||||
"MULTIPOLYGON(((4 1,5 1,5 0,4 0,4 1)),((4 1,2 1,2 2,4 2,4 1)),((2 2,1 2,1 1,2 1,2 0,0 0,0 3,2 3,2 2)))",
|
||||
"MULTIPOLYGON(((2 1,2 2,3 2,3 1,2 1)),((1 0,0 0,0 1,2 1,2 0,1 0)))"
|
||||
};
|
||||
|
||||
|
||||
static std::string pie_21_7_21_0_3[2] =
|
||||
{
|
||||
"MULTIPOLYGON(((2500 2500,2500 3875,2855 3828,3187 3690,3472 3472,3690 3187,3828 2855,3875 2500,3828 2144,3690 1812,3472 1527,3187 1309,2855 1171,2499 1125,2144 1171,1812 1309,1527 1527,1309 1812,1171 2144,1125 2499,1171 2855,1309 3187,2500 2500)))",
|
||||
|
@ -280,6 +280,7 @@ void test_areal()
|
||||
TEST_INTERSECTION(case_recursive_boxes_41, 1, 0, 23.5);
|
||||
TEST_INTERSECTION(case_recursive_boxes_42, 1, 29, 95.0);
|
||||
TEST_INTERSECTION(case_recursive_boxes_43, 2, 0, 22.5);
|
||||
TEST_INTERSECTION(case_recursive_boxes_44, 2, 0, 3.0);
|
||||
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ggl_list_20120915_h2_a",
|
||||
ggl_list_20120915_h2[0], ggl_list_20120915_h2[1],
|
||||
|
Loading…
x
Reference in New Issue
Block a user