From e13be902836e52b0f859be00dbe39fd96d5b035a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Fri, 5 Nov 2021 10:18:11 +0100 Subject: [PATCH] Fix of #7109 (Bulges with model's base color on multi-material painted models) --- src/libslic3r/PrintObjectSlice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index a8936c32e..84b212938 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -630,6 +630,13 @@ static inline void apply_mm_segmentation(PrintObject &print_object, ThrowOnCance if (mine.empty()) break; } + // Filter out unprintable polygons produced by subtraction multi-material painted regions from layerm.region(). + // ExPolygon returned from multi-material segmentation does not precisely match ExPolygons in layerm.region() + // (because of preprocessing of the input regions in multi-material segmentation). Therefore, subtraction from + // layerm.region() could produce a huge number of small unprintable regions for the model's base extruder. + // This could, on some models, produce bulges with the model's base color (#7109). + if (! mine.empty()) + mine = opening(union_ex(mine), float(scale_(5 * EPSILON)), float(scale_(5 * EPSILON))); if (! mine.empty()) { ByRegion &dst = by_region[layerm.region().print_object_region_id()]; if (dst.expolygons.empty()) {