Fix of #7109 (Bulges with model's base color on multi-material painted models)

This commit is contained in:
Lukáš Hejl 2021-11-05 10:18:11 +01:00
parent f5a6e53298
commit e13be90283

View File

@ -630,6 +630,13 @@ static inline void apply_mm_segmentation(PrintObject &print_object, ThrowOnCance
if (mine.empty()) if (mine.empty())
break; 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()) { if (! mine.empty()) {
ByRegion &dst = by_region[layerm.region().print_object_region_id()]; ByRegion &dst = by_region[layerm.region().print_object_region_id()];
if (dst.expolygons.empty()) { if (dst.expolygons.empty()) {