From 63a33c8d1a55966c36893c4f3654647083e9967b Mon Sep 17 00:00:00 2001 From: "salt.wei" Date: Fri, 30 Sep 2022 16:03:00 +0800 Subject: [PATCH] ENH: revert the bridge change Find some problem for the change of bridge, revert. Signed-off-by: salt.wei Change-Id: Ib195a9b4425fa54408bcd3842bbafc41a3c79409 --- src/libslic3r/BridgeDetector.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/BridgeDetector.cpp b/src/libslic3r/BridgeDetector.cpp index ee4b345cf2..03d671db47 100644 --- a/src/libslic3r/BridgeDetector.cpp +++ b/src/libslic3r/BridgeDetector.cpp @@ -119,27 +119,25 @@ bool BridgeDetector::detect_angle(double bridge_direction_override) } double total_length = 0; - double arachored_length = 0; double max_length = 0; { Lines clipped_lines = intersection_ln(lines, clip_area); for (size_t i = 0; i < clipped_lines.size(); ++i) { const Line &line = clipped_lines[i]; - double len = line.length(); - total_length += len; if (expolygons_contain(this->_anchor_regions, line.a) && expolygons_contain(this->_anchor_regions, line.b)) { // This line could be anchored. - arachored_length += len; + double len = line.length(); + total_length += len; max_length = std::max(max_length, len); } } } - if (arachored_length == 0.) + if (total_length == 0.) continue; have_coverage = true; // Sum length of bridged lines. - candidates[i_angle].coverage = arachored_length / total_length; + candidates[i_angle].coverage = total_length; /* The following produces more correct results in some cases and more broken in others. TODO: investigate, as it looks more reliable than line clipping. */ // $directions_coverage{$angle} = sum(map $_->area, @{$self->coverage($angle)}) // 0;