From 684b66125e6f9140448c6c0459466879c3ade6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Thu, 17 Jun 2021 18:26:16 +0200 Subject: [PATCH] Fixed an issue where multi-material segmentation ignored the last extruder. --- src/libslic3r/MultiMaterialSegmentation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index f943934b5..2fbdf85bc 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1156,7 +1156,7 @@ static inline std::vector> mmu_segmentation_top_and_bott const std::vector &input_expolygons, const std::function &throw_on_cancel_callback) { - const size_t num_extruders = print_object.print()->config().nozzle_diameter.size(); + const size_t num_extruders = print_object.print()->config().nozzle_diameter.size() + 1; const ConstLayerPtrsAdaptor layers = print_object.layers(); std::vector> triangles_by_color(num_extruders); triangles_by_color.assign(num_extruders, std::vector(layers.size())); @@ -1454,7 +1454,7 @@ std::vector>> multi_material_segmentati BOOST_LOG_TRIVIAL(debug) << "MMU segmentation - projection of painted triangles - begin"; for (const ModelVolume *mv : print_object.model_object()->volumes) { - const size_t num_extruders = print_object.print()->config().nozzle_diameter.size(); + const size_t num_extruders = print_object.print()->config().nozzle_diameter.size() + 1; for (size_t extruder_idx = 1; extruder_idx < num_extruders; ++extruder_idx) { throw_on_cancel_callback(); const indexed_triangle_set custom_facets = mv->mmu_segmentation_facets.get_facets(*mv, EnforcerBlockerType(extruder_idx));