Bugfix: prevent fatal error in the rare case that no bridge anchors are found. #1607

issue1834
Alessandro Ranellucci 2014-01-15 00:24:37 +01:00
parent a40556ab56
commit dfd9bc8958
1 changed files with 36 additions and 34 deletions

View File

@ -484,6 +484,7 @@ sub _detect_bridge_direction {
1, # safety offset required to avoid Clipper from detecting empty intersection while Boost actually found some @edges
);
if (@$anchors) {
# we'll now try several directions using a rudimentary visibility check:
# bridge in several directions and then sum the length of lines having both
# endpoints within anchors
@ -523,6 +524,7 @@ sub _detect_bridge_direction {
# the best direction is the one causing most lines to be bridged
$bridge_angle = Slic3r::Geometry::rad2deg_dir($sorted_directions[-1]);
}
}
Slic3r::debugf " Optimal infill angle of bridge on layer %d is %d degrees\n",
$self->id, $bridge_angle if defined $bridge_angle;