Bugfix: fatal error in the rare case that a bridge has no anchor points. #1607

This commit is contained in:
Alessandro Ranellucci 2014-01-15 00:20:09 +01:00
parent 4da71e8f13
commit cfbbb539a5

View file

@ -585,8 +585,9 @@ sub _detect_bridge_direction {
# generate lines in this direction
my $bounding_box = Slic3r::Geometry::BoundingBox->new_from_points([ map @$_, map @$_, @$anchors ]);
# note that @$anchors might be empty
my @lines = ();
for (my $x = $bounding_box->x_min; $x <= $bounding_box->x_max; $x += $line_increment) {
for (my $x = ($bounding_box->x_min // 0); $x <= ($bounding_box->x_max // -1); $x += $line_increment) {
push @lines, [ [$x, $bounding_box->y_min], [$x, $bounding_box->y_max] ];
}