diff --git a/src/libslic3r/TriangleMeshSlicer.cpp b/src/libslic3r/TriangleMeshSlicer.cpp index 38db18043..05936f139 100644 --- a/src/libslic3r/TriangleMeshSlicer.cpp +++ b/src/libslic3r/TriangleMeshSlicer.cpp @@ -1866,9 +1866,13 @@ std::vector slice_mesh_ex( //FIXME simplify if (this_mode == MeshSlicingParams::SlicingMode::PositiveLargestContour) keep_largest_contour_only(expolygons); - if (resolution != 0.) - for (ExPolygon &ex : expolygons) - ex.simplify(resolution); + if (resolution != 0.) { + ExPolygons simplified; + simplified.reserve(expolygons.size()); + for (const ExPolygon &ex : expolygons) + append(simplified, ex.simplify(resolution)); + expolygons = std::move(simplified); + } } }); // BOOST_LOG_TRIVIAL(debug) << "slice_mesh make_expolygons in parallel - end";