mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Bugfix: division by zero when nothing in a single layer could be parsed. #100
This commit is contained in:
@@ -200,7 +200,9 @@ sub make_loops {
|
|||||||
my $total_discarded_length = 0;
|
my $total_discarded_length = 0;
|
||||||
$total_discarded_length += $_->length for map polyline_lines($_), @discarded_polylines;
|
$total_discarded_length += $_->length for map polyline_lines($_), @discarded_polylines;
|
||||||
$total_discarded_length += $_->length for @discarded_lines;
|
$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;
|
Slic3r::debugf " length ratio of discarded lines is %f\n", $discarded_ratio;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user