diff options
author | Merill <merill@free.fr> | 2020-11-15 17:08:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 17:08:02 +0300 |
commit | ef42a5a6f66ae7ec226932d2566f8837b466a232 (patch) | |
tree | f611b8399ebf50b73d98559e927d7ae47c2dd19b | |
parent | e93b84e2a66d92271a5c131c8f87b9dc73bd4f38 (diff) |
Fix support doesn't ignore overhangs bridge anymorepatch-4
commit 564eddd99d6368396dca37bbbf9c5ef7a3d3a958 break the support material overhang bridge detection
simple exemple stl to reproduce (there shouldn't be any bridge, but it can't detect the bridge because each end is on its own island):
here is a patch to come back to the old behavior.
-rw-r--r-- | src/libslic3r/SupportMaterial.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index 1669f60d2..1bcdd8d61 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -906,13 +906,19 @@ namespace SupportMaterialInternal { polyline.extend_start(fw); polyline.extend_end(fw); // Is the straight perimeter segment supported at both sides? - for (size_t i = 0; i < lower_layer.lslices.size(); ++ i) - if (lower_layer.lslices_bboxes[i].contains(polyline.first_point()) && lower_layer.lslices_bboxes[i].contains(polyline.last_point()) && - lower_layer.lslices[i].contains(polyline.first_point()) && lower_layer.lslices[i].contains(polyline.last_point())) { - // Offset a polyline into a thick line. - polygons_append(bridges, offset(polyline, 0.5f * w + 10.f)); - break; - } + bool first_point_supported = false; + for (size_t i = 0; i < lower_layer.lslices.size(); ++ i) + if (lower_layer.lslices_bboxes[i].contains(polyline.first_point()) &&lower_layer.lslices[i].contains(polyline.first_point()) ) { + first_point_supported = true; + break; + } + if(first_point_supported) + for (size_t i = 0; i < lower_layer.lslices.size(); ++i) + if (lower_layer.lslices_bboxes[i].contains(polyline.last_point()) && lower_layer.lslices[i].contains(polyline.last_point())) { + // Offset a polyline into a thick line. + polygons_append(bridges, offset(polyline, 0.5f * w + 10.f)); + break; + } } bridges = union_(bridges); } |