From b6a077b128cd6af9b2ad792ca0c3c34bee226f5c Mon Sep 17 00:00:00 2001 From: "yifan.wu" Date: Wed, 28 Sep 2022 18:08:27 +0800 Subject: [PATCH] FIX: top shell filament does not hide the internal filament Signed-off-by: yifan.wu Change-Id: I143b49075992bb9556f248886ab5f1a442db8deb --- src/libslic3r/MultiMaterialSegmentation.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index ebad9a117..46e31970f 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1483,10 +1483,9 @@ static inline std::vector> mmu_segmentation_top_and_bott top_ex = opening_ex(top_ex, stat.small_region_threshold); if (! top_ex.empty()) { append(triangles_by_color_top[color_idx][layer_idx + layer_idx_offset], top_ex); - // BBS: propagate only 1 layer below float offset = 0.f; ExPolygons layer_slices_trimmed = input_expolygons[layer_idx]; - for (int last_idx = int(layer_idx) - 1; last_idx >= std::max(int(layer_idx - 1), int(0)); --last_idx) { + for (int last_idx = int(layer_idx) - 1; last_idx >= std::max(int(layer_idx - stat.top_shell_layers), int(0)); --last_idx) { //BBS: offset width should be 2*spacing to avoid too narrow area which has overlap of wall line //offset -= stat.extrusion_width ; offset -= (stat.extrusion_spacing + stat.extrusion_width); @@ -1504,10 +1503,9 @@ static inline std::vector> mmu_segmentation_top_and_bott bottom_ex = opening_ex(bottom_ex, stat.small_region_threshold); if (! bottom_ex.empty()) { append(triangles_by_color_bottom[color_idx][layer_idx + layer_idx_offset], bottom_ex); - // BBS: propogate only 1 layer above float offset = 0.f; ExPolygons layer_slices_trimmed = input_expolygons[layer_idx]; - for (size_t last_idx = layer_idx + 1; last_idx < std::min(layer_idx + 2, num_layers); ++last_idx) { + for (size_t last_idx = layer_idx + 1; last_idx < std::min(layer_idx + stat.bottom_shell_layers, num_layers); ++last_idx) { //BBS: offset width should be 2*spacing to avoid too narrow area which has overlap of wall line //offset -= stat.extrusion_width; offset -= (stat.extrusion_spacing + stat.extrusion_width);