Wrong bridge detection result (FOR TESTING ONLY) (#4678)

Fixed an issue that top surface was treated as internal bridge
This commit is contained in:
SoftFever 2024-04-07 22:43:00 +08:00 committed by GitHub
parent 95585b3539
commit ba414bb74a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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