From 121bb260db5c73c0f65922e1818372006c1f83da Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 10 Dec 2021 18:26:54 +0100 Subject: [PATCH] Fix of disabling thick bridges adds unnecessary support interfaces #7260 Improved numerical robustness when removing bridging perimeters from overhangs to be supported. --- src/libslic3r/SupportMaterial.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index 8a04b6439..1f3ecfa12 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -1340,7 +1340,10 @@ namespace SupportMaterialInternal { // so we take the largest value and also apply safety offset to be ensure no gaps // are left in between Flow perimeter_bridge_flow = layerm.bridging_flow(frPerimeter); - float w = float(std::max(perimeter_bridge_flow.scaled_width(), perimeter_bridge_flow.scaled_spacing())); + //FIXME one may want to use a maximum of bridging flow width and normal flow width, as the perimeters are calculated using the normal flow + // and then turned to bridging flow, thus their centerlines are derived from non-bridging flow and expanding them by a bridging flow + // may not expand them to the edge of their respective islands. + const float w = float(0.5 * std::max(perimeter_bridge_flow.scaled_width(), perimeter_bridge_flow.scaled_spacing())) + scaled(0.001); for (Polyline &polyline : overhang_perimeters) if (polyline.is_straight()) { // This is a bridge @@ -1355,7 +1358,7 @@ namespace SupportMaterialInternal { supported[j] = true; if (supported[0] && supported[1]) // Offset a polyline into a thick line. - polygons_append(bridges, offset(polyline, 0.5f * w + 10.f)); + polygons_append(bridges, offset(polyline, w)); } bridges = union_(bridges); }