Fix one and zero perimeter case - no bridging was generated

This commit is contained in:
PavelMikus 2023-03-14 11:38:16 +01:00 committed by Pavel Mikuš
parent 4af37ca4a5
commit 257837c071

View File

@ -2090,7 +2090,7 @@ void PrintObject::bridge_over_infill()
if (area_to_be_bridge.empty()) if (area_to_be_bridge.empty())
continue; continue;
Polygons boundary_area = union_(expansion_area, expand(area_to_be_bridge, flow.scaled_spacing())); Polygons boundary_area = union_(expansion_area, area_to_be_bridge);
Polylines boundary_plines = to_polylines(boundary_area); Polylines boundary_plines = to_polylines(boundary_area);
double bridging_angle = 0; double bridging_angle = 0;
Polygons tmp_expanded_area = expand(area_to_be_bridge, 3.0 * flow.scaled_spacing()); Polygons tmp_expanded_area = expand(area_to_be_bridge, 3.0 * flow.scaled_spacing());
@ -2118,7 +2118,7 @@ void PrintObject::bridge_over_infill()
Polygons bridging_area = construct_anchored_polygon(area_to_be_bridge, to_lines(boundary_plines), flow, bridging_angle); Polygons bridging_area = construct_anchored_polygon(area_to_be_bridge, to_lines(boundary_plines), flow, bridging_angle);
bridging_area = intersection(bridging_area, boundary_area); bridging_area = intersection(bridging_area, boundary_area);
bridging_area = opening(bridging_area, flow.scaled_spacing()); bridging_area = opening(bridging_area, flow.scaled_spacing());
expansion_area = diff(expansion_area, bridging_area); expansion_area = diff(expansion_area, bridging_area);
#ifdef DEBUG_BRIDGE_OVER_INFILL #ifdef DEBUG_BRIDGE_OVER_INFILL
debug_draw(std::to_string(lidx) + "_" + std::to_string(cluster_idx) + "_" + std::to_string(job_idx) + debug_draw(std::to_string(lidx) + "_" + std::to_string(cluster_idx) + "_" + std::to_string(job_idx) +