ENH: some change for external bridge

1 move thick bridge from support to quality page

2 Fix the issue that some times the external bridge angle
is not the best, and the bridge line is not the shortest one.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Ie26570fb289898f6b62960f9333e79aa92c08ae4
This commit is contained in:
salt.wei 2022-09-27 11:34:22 +08:00 committed by Lane.Wei
parent d41e0db18f
commit 80575cd269
3 changed files with 8 additions and 6 deletions

View file

@ -119,25 +119,27 @@ 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.
double len = line.length();
total_length += len;
arachored_length += len;
max_length = std::max(max_length, len);
}
}
}
if (total_length == 0.)
if (arachored_length == 0.)
continue;
have_coverage = true;
// Sum length of bridged lines.
candidates[i_angle].coverage = total_length;
candidates[i_angle].coverage = arachored_length / 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;