FIX: filament painting doesnt work properly #2078

STUDIO-3731

Change-Id: Ifc93baf194d5e81eb7e00facf85344bfc05878fc
This commit is contained in:
zhimin.zeng 2023-07-21 18:19:05 +08:00 committed by Lane.Wei
parent c522ed8ec0
commit 639bf63af5
1 changed files with 6 additions and 3 deletions

View File

@ -1662,9 +1662,12 @@ static inline std::vector<std::vector<ExPolygons>> mmu_segmentation_top_and_bott
self = union_ex(self);
}
// Trim one region by the other if some of the regions overlap.
for (size_t color_idx = 1; color_idx < triangles_by_color_merged.size(); ++ color_idx)
triangles_by_color_merged[color_idx][layer_idx] = diff_ex(triangles_by_color_merged[color_idx][layer_idx],
triangles_by_color_merged[color_idx - 1][layer_idx]);
ExPolygons painted_regions;
for (size_t color_idx = 1; color_idx < triangles_by_color_merged.size(); ++color_idx) {
triangles_by_color_merged[color_idx][layer_idx] = diff_ex(triangles_by_color_merged[color_idx][layer_idx], painted_regions);
append(painted_regions, triangles_by_color_merged[color_idx][layer_idx]);
}
triangles_by_color_merged[0][layer_idx] = diff_ex(triangles_by_color_merged[0][layer_idx], painted_regions);
}
});