From 510d59687b3b19c4a0f4e6540620d0694dd1b7ac Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 5 Oct 2023 14:13:14 +0200 Subject: [PATCH] Follow-up 1b451cdf: Fixed #11415 - Connectors disappear when slicing => only when using multiple cut planes AND excluding parts Note: With this issue was related crash on perform a cut (SPE-1938), because a variable with ended lifetime was used --- src/libslic3r/CutUtils.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/CutUtils.cpp b/src/libslic3r/CutUtils.cpp index 2a97f8b2297..081b86c209b 100644 --- a/src/libslic3r/CutUtils.cpp +++ b/src/libslic3r/CutUtils.cpp @@ -464,6 +464,12 @@ const ModelObjectPtrs& Cut::perform_by_contour(std::vector parts, int dowe // Just add Upper and Lower objects to cut_object_ptrs post_process(upper, lower, cut_object_ptrs); + + // Now merge all model parts together: + merge_solid_parts_inside_object(cut_object_ptrs); + + // replace initial objects in model with cut object + finalize(cut_object_ptrs); } else if (volumes.size() > cut_parts_cnt) { // Means that object is cut with connectors @@ -490,17 +496,18 @@ const ModelObjectPtrs& Cut::perform_by_contour(std::vector parts, int dowe // Add Upper and Lower objects to cut_object_ptrs post_process(upper, lower, cut_object_ptrs); - // Add Dowel-connectors as separate objects to cut_object_ptrs + // Now merge all model parts together: + merge_solid_parts_inside_object(cut_object_ptrs); + + // replace initial objects in model with cut object + finalize(cut_object_ptrs); + + // Add Dowel-connectors as separate objects to model if (cut_connectors_obj.size() >= 3) for (size_t id = 2; id < cut_connectors_obj.size(); id++) - cut_object_ptrs.push_back(cut_connectors_obj[id]); + m_model.add_object(*cut_connectors_obj[id]); } - // Now merge all model parts together: - merge_solid_parts_inside_object(cut_object_ptrs); - - finalize(cut_object_ptrs); - return m_model.objects; }