From 43a155c4762aa0606028b869e22540a67c0b0ab8 Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Mon, 27 Feb 2023 12:52:46 +0100 Subject: [PATCH] improve the filters of regions that will be turned into bridges --- src/libslic3r/PrintObject.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index ca9516d202..b67e68f60d 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1777,15 +1777,22 @@ void PrintObject::bridge_over_infill() assert(candidate->surface_type == stInternalSolid); Polygons bridged_area = expand(to_polygons(candidate->expolygon), flow.scaled_spacing()); Polygons infill_region = to_polygons(surface_to_region[candidate]->fill_expolygons()); - bool touches_perimeter = !diff(bridged_area, infill_region).empty(); - bool touches_solid_region_under = !intersection(bridged_area, not_sparse_infill).empty(); bridged_area = intersection(bridged_area, lower_layers_sparse_infill); // cut off parts which are not over sparse infill - material overflow - if ((touches_perimeter || touches_solid_region_under) && shrink(bridged_area, 5.0 * flow.scaled_spacing()).empty()) { - continue; + { + Polygons area_without_perimeter_boundary_sections = intersection(bridged_area, + closing(infill_region, flow.scaled_width(), + flow.scaled_width() + + 4.0 * flow.scaled_spacing())); + Polygons and_further_without_solid_supported_sections = diff(area_without_perimeter_boundary_sections, + expand(not_sparse_infill, 4.0 * flow.scaled_spacing())); + + if (and_further_without_solid_supported_sections.empty()) { + continue; + } } Polygons max_area = expand_area;