From 79784d1a2e3772b51c661a2dc144f7ea142acbb5 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 3 Sep 2021 11:45:01 +0200 Subject: [PATCH] Fix of "Support on build plate only" no longer overridden by support painting (#6863) This is a regression to a late PrusaSlicer 2.4.0-alpha0 change 8dfc0422a878c5e44d4233c6ce522c77a0c3280f Faster and hopefully more reliable projection of paint-on support blockers and enforcers on a sliced mesh. Previous d89f01c71795e324f510939e2cece05b9586291c did not fix it. --- src/libslic3r/PrintObject.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 526b7b874a..808bdd8a1b 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -2301,7 +2301,14 @@ void PrintObject::project_and_append_custom_facets( else { std::vector projected; slice_mesh_slabs(custom_facets, zs_from_layers(this->layers()), this->trafo_centered() * mv->get_matrix(), nullptr, &projected, [](){}); - append(out, std::move(projected)); + // Merge these projections with the output, layer by layer. + assert(! projected.empty()); + assert(out.empty() || out.size() == projected.size()); + if (out.empty()) + out = std::move(projected); + else + for (size_t i = 0; i < out.size(); ++ i) + append(out[i], std::move(projected[i])); } } }