SPE-2486: Limit the depth of the painted fuzzy skin regions to make regions cover just external perimeters.

This reduces the possibility of artifacts that could happen during regions merging.
This commit is contained in:
Lukáš Hejl 2024-10-25 16:11:20 +02:00 committed by Lukas Matena
parent 6dadcee6ab
commit fa2663f026

View File

@ -1868,7 +1868,15 @@ std::vector<std::vector<ExPolygons>> fuzzy_skin_segmentation_by_painting(const P
return {mv.fuzzy_skin_facets, mv.is_fuzzy_skin_painted(), false};
};
return segmentation_by_painting(print_object, extract_facets_info, num_facets_states, 0.f, 0.f, IncludeTopAndBottomLayers::No, throw_on_cancel_callback);
// Because we apply fuzzy skin just on external perimeters, we limit the depth of fuzzy skin
// by the maximal extrusion width of external perimeters.
float max_external_perimeter_width = 0.;
for (size_t region_idx = 0; region_idx < print_object.num_printing_regions(); ++region_idx) {
const PrintRegion &region = print_object.printing_region(region_idx);
max_external_perimeter_width = std::max<float>(max_external_perimeter_width, region.flow(print_object, frExternalPerimeter, print_object.config().layer_height).width());
}
return segmentation_by_painting(print_object, extract_facets_info, num_facets_states, max_external_perimeter_width, 0.f, IncludeTopAndBottomLayers::No, throw_on_cancel_callback);
}