FIX: surfaces wrong detection

1. Top surfaces are detected as internal bridge. Can be seen in FDMTest
2. Fix bridge line overlap wall line

jira:NEW

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I73c47e8b3aba862f46c8438fc69e3fcc382d16cc
This commit is contained in:
xun.zhang 2024-05-07 14:31:58 +08:00 committed by Lane.Wei
parent 6d0280da16
commit dab3f24553
1 changed files with 6 additions and 0 deletions

View File

@ -2540,11 +2540,15 @@ void PrintObject::bridge_over_infill()
Polygons lightning_area;
Polygons expansion_area;
Polygons total_fill_area;
Polygons top_area;
for (LayerRegion *region : layer->regions()) {
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);
total_fill_area.insert(total_fill_area.end(), fill_polys.begin(), fill_polys.end());
Polygons top_polys = to_polygons(region->fill_surfaces.filter_by_type(stTop));
top_area.insert(top_area.end(), top_polys.begin(), top_polys.end());
if (region->region().config().sparse_infill_pattern == ipLightning) {
Polygons l = to_polygons(region->fill_surfaces.filter_by_type(stInternal));
lightning_area.insert(lightning_area.end(), l.begin(), l.end());
@ -2629,6 +2633,8 @@ 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);
// BBS: substract top area
bridging_area = diff(bridging_area, top_area);
// BBS: open and close again to filter some narrow parts
bridging_area = opening(bridging_area, flow.scaled_spacing());
bridging_area = closing(bridging_area, flow.scaled_spacing());