From 90afbc8bd929910366ab37c7ac2ac74be404060a Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 18 Jan 2015 13:01:00 +0100 Subject: [PATCH] Bugfix: don't crash when skirts > 0 but skirt_height = 0. Includes regression test. #2537 --- lib/Slic3r/Print.pm | 2 +- t/skirt_brim.t | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index f8d9d4929..b08d4fc46 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -203,7 +203,7 @@ sub make_skirt { # checking whether we need to generate them $self->skirt->clear; - if ($self->config->skirts == 0 + if (($self->config->skirts == 0 || $self->config->skirt_height == 0) && (!$self->config->ooze_prevention || @{$self->extruders} == 1)) { $self->set_step_done(STEP_SKIRT); return; diff --git a/t/skirt_brim.t b/t/skirt_brim.t index c7377abf8..878a78840 100644 --- a/t/skirt_brim.t +++ b/t/skirt_brim.t @@ -1,4 +1,4 @@ -use Test::More tests => 5; +use Test::More tests => 6; use strict; use warnings; @@ -79,6 +79,15 @@ use Slic3r::Test; ok Slic3r::Test::gcode($print), 'successful G-code generation when skirt is smaller than brim width'; } +{ + my $config = Slic3r::Config->new_from_defaults; + $config->set('skirts', 1); + $config->set('skirt_height', 0); + + my $print = Slic3r::Test::init_print('20mm_cube', config => $config); + ok Slic3r::Test::gcode($print), 'successful G-code generation when skirt_height = 0 and skirts > 0'; +} + { my $config = Slic3r::Config->new_from_defaults; $config->set('layer_height', 0.4);