diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index f8ed199bf5..077b226668 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1982,7 +1982,7 @@ void PrintObject::discover_vertical_shells() #ifdef DEBUG_BRIDGE_OVER_INFILL template void debug_draw(std::string name, const T& a, const T& b, const T& c, const T& d) { - std::vector colors = {"red", "green", "blue", "orange"}; + std::vector colors = {"red", "green", "blue", "orange"}; BoundingBox bbox = get_extents(a); bbox.merge(get_extents(b)); bbox.merge(get_extents(c)); @@ -2656,7 +2656,10 @@ void PrintObject::bridge_over_infill() Polygons lightning_area; Polygons expansion_area; Polygons total_fill_area; + Polygons total_top_area; for (const LayerRegion *region : layer->regions()) { + Polygons top_polys = to_polygons(region->fill_surfaces.filter_by_types({stTop})); + total_top_area.insert(total_top_area.end(), top_polys.begin(), top_polys.end()); Polygons internal_polys = to_polygons(region->fill_surfaces.filter_by_types({stInternal, stInternalSolid})); expansion_area.insert(expansion_area.end(), internal_polys.begin(), internal_polys.end()); Polygons fill_polys = to_polygons(region->fill_expolygons); @@ -2746,6 +2749,7 @@ void PrintObject::bridge_over_infill() bridging_area = closing(bridging_area, flow.scaled_spacing()); bridging_area = intersection(bridging_area, limiting_area); bridging_area = intersection(bridging_area, total_fill_area); + bridging_area = diff(bridging_area, total_top_area); expansion_area = diff(expansion_area, bridging_area); #ifdef DEBUG_BRIDGE_OVER_INFILL