From 5f8eea9adf6744bd3c4d7e59cc665f65602df857 Mon Sep 17 00:00:00 2001 From: Chow Loong Jin Date: Sun, 6 Mar 2016 17:44:39 +0800 Subject: [PATCH] Don't use equality comparisons for floats This fixes an issue where F0 moves arise from 0-width (or 0 layer height?) support material segments when using autospeed. Fixes: #3261 --- lib/Slic3r/Print/GCode.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index e3022fef0..b7a48870a 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -75,7 +75,8 @@ sub BUILD { } } } - @mm3_per_mm = grep $_ != 0, @mm3_per_mm; + # filter out 0-width segments + @mm3_per_mm = grep $_ > 0.000001, @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