Bugfix: division by zero when nothing in a single layer could be parsed. #100

This commit is contained in:
Alessandro Ranellucci 2011-12-07 20:18:12 +01:00
parent 525855dc7d
commit 99c1facec6

View File

@ -200,7 +200,9 @@ sub make_loops {
my $total_discarded_length = 0;
$total_discarded_length += $_->length for map polyline_lines($_), @discarded_polylines;
$total_discarded_length += $_->length for @discarded_lines;
my $discarded_ratio = $total_discarded_length / $total_detected_length;
my $discarded_ratio = $total_detected_length
? ($total_discarded_length / $total_detected_length)
: 0;
Slic3r::debugf " length ratio of discarded lines is %f\n", $discarded_ratio;