From cfbbb539a5b0b8577ec6e172e8519de320bdbde9 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 15 Jan 2014 00:20:09 +0100 Subject: [PATCH] Bugfix: fatal error in the rare case that a bridge has no anchor points. #1607 --- lib/Slic3r/Layer/Region.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index 1cb7ae155..2f3487c3d 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -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] ]; }