From 8613e174e7986d3346d331090cdb40cb183d6d9c Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 2 Jun 2015 11:48:56 +0200 Subject: [PATCH] Fix error in autospeed. #2810 --- lib/Slic3r/GCode.pm | 2 +- lib/Slic3r/Print/GCode.pm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 955cdbee7..b10eb893f 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -313,7 +313,7 @@ sub _extrude_path { $speed ||= $self->volumetric_speed / $path->mm3_per_mm; } my $F = $speed * 60; # convert mm/sec to mm/min - + use XXX; YYY $path->role, $speed, $self->volumetric_speed if $F == 0; # extrude arc or line $gcode .= ";_BRIDGE_FAN_START\n" if $path->is_bridge && $self->enable_cooling_markers; my $path_length = unscale $path->length; diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index ce60996c4..8965687ae 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -75,8 +75,9 @@ sub BUILD { } } } - my $min_mm3_per_mm = min(@mm3_per_mm) // 0; - if ($min_mm3_per_mm > 0) { + @mm3_per_mm = grep $_ != 0, @mm3_per_mm; + if (@mm3_per_mm) { + my $min_mm3_per_mm = min(@mm3_per_mm); # In order to honor max_print_speed we need to find a target volumetric # speed that we can use throughout the print. So we define this target # volumetric speed as the volumetric speed produced by printing the