get_turns(L,A) - fixed turns generation for endpoints of collinear front/back segments, added some tests

This commit is contained in:
Adam Wulkiewicz
2014-03-03 19:21:12 +01:00
parent 325b2e2bb0
commit 02cdc305d3
2 changed files with 45 additions and 24 deletions

View File

@@ -32,6 +32,24 @@ void test_all()
typedef bg::model::linestring<pt> ls;
typedef bg::model::polygon<pt> poly;
test_geometry<ls, poly>("LINESTRING(15 5,24 5,20 2,19 0,13 -4,1 0,10 0,13 3,15 7,16 10,10 10,8 10,4 6,2 8,1 10)",
"POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))",
expected("miu")("iuu")("tcu")("tuu")("mcu")("miu")("muu")("tiu")("mcu")("miu")("mcu")("miu")("mxu").vec);
test_geometry<ls, poly>("LINESTRING(5 0,5 5,10 5)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
"miu", "mxu");
test_geometry<ls, poly>("LINESTRING(0 0,5 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
"tiu", "txu");
test_geometry<ls, poly>("LINESTRING(0 0,5 0,5 5,10 5,10 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
expected("tcu")("miu")("mcu")("txu").vec);
test_geometry<ls, poly>("LINESTRING(10 0,5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
expected("tcu")("miu")("mcu")("txu").vec);
test_geometry<ls, poly>("LINESTRING(0 0,10 0,10 10)",
"POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))",
expected("tcu")("miu")("mcu")("miu")("mxu").vec);
to_svg<ls, poly>("LINESTRING(15 5,24 5,20 2,19 0,13 -4,1 0,10 0,13 3,15 7,16 10,10 10,8 10,4 6,2 8,1 10)",
"POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))",
"ls_poly1.svg");