diff --git a/src/utils/polygon.cpp b/src/utils/polygon.cpp index 54a6168730..4f724dc7e8 100644 --- a/src/utils/polygon.cpp +++ b/src/utils/polygon.cpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include "utils/ListPolyIt.h" @@ -845,14 +847,14 @@ Polygons Polygons::toPolygons(ClipperLib::PolyTree& poly_tree) | ranges::views::transform( [](const auto& path) { - const auto path_str = path + const auto line_string = ranges::views::concat(path, path | ranges::views::take(1)) | ranges::views::transform( [](const auto& point) { return fmt::format("{} {}", point.X, point.Y); }) | ranges::views::join(ranges::views::c_str(", ")) | ranges::to(); - return "(" + path_str + ")"; + return "(" + line_string + ")"; }) | ranges::views::join(ranges::views::c_str(", ")) | ranges::to(); stream << paths_str;