diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index d79b672f8..0db6e69e1 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -271,7 +271,7 @@ sub validate { # --skirt-height die "Invalid value for --skirt-height\n" - if $self->skirt_height < 0; + if $self->skirt_height < -1; # -1 means as tall as the object # --bridge-flow-ratio die "Invalid value for --bridge-flow-ratio\n" diff --git a/lib/Slic3r/GCode/Layer.pm b/lib/Slic3r/GCode/Layer.pm index d41f95499..f888ddac2 100644 --- a/lib/Slic3r/GCode/Layer.pm +++ b/lib/Slic3r/GCode/Layer.pm @@ -48,7 +48,7 @@ sub process_layer { # check whether we're going to apply spiralvase logic my $spiralvase = defined $self->spiralvase && ($layer->id > 0 || $self->gcodegen->config->brim_width == 0) - && ($layer->id >= $self->gcodegen->config->skirt_height) + && ($layer->id >= $self->gcodegen->config->skirt_height && $self->gcodegen->config->skirt_height != -1) && ($layer->id >= $self->gcodegen->config->bottom_solid_layers); # if we're going to apply spiralvase to this layer, disable loop clipping @@ -71,11 +71,12 @@ sub process_layer { }) . "\n" if $self->gcodegen->config->layer_gcode; # extrude skirt - if ((values %{$self->skirt_done}) < $self->gcodegen->config->skirt_height && !$self->skirt_done->{$layer->print_z}) { + if (((values %{$self->skirt_done}) < $self->gcodegen->config->skirt_height || $self->gcodegen->config->skirt_height == -1) + && !$self->skirt_done->{$layer->print_z}) { $self->gcodegen->set_shift(@{$self->shift}); $gcode .= $self->gcodegen->set_extruder($self->extruders->[0]); # skip skirt if we have a large brim - if ($layer->id < $self->gcodegen->config->skirt_height) { + if ($layer->id < $self->gcodegen->config->skirt_height || $self->gcodegen->config->skirt_height == -1) { # distribute skirt loops across all extruders my @skirt_loops = @{$self->print->skirt}; for my $i (0 .. $#skirt_loops) { diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 65b6628e8..58dd40690 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -292,7 +292,7 @@ sub init_extruders { # enforce tall skirt if using ooze_prevention # NOTE: this is not idempotent (i.e. switching ooze_prevention off will not revert skirt settings) if ($self->config->ooze_prevention && @{$self->extruders} > 1) { - $self->config->set('skirt_height', 9999999999); + $self->config->set('skirt_height', -1); $self->config->set('skirts', 1) if $self->config->skirts == 0; } } @@ -823,14 +823,17 @@ sub write_gcode { # calculate wiping points if needed if ($self->config->ooze_prevention) { - my $outer_skirt = convex_hull([ map @$_, @{$self->skirt} ]); - my @skirts = (); - foreach my $extruder (@{$self->extruders}) { - push @skirts, my $s = $outer_skirt->clone; - $s->translate(map scale($_), @{$extruder->extruder_offset}); + my @skirt_points = map @$_, @{$self->skirt}; + if (@skirt_points) { + my $outer_skirt = convex_hull(\@skirt_points); + my @skirts = (); + foreach my $extruder (@{$self->extruders}) { + push @skirts, my $s = $outer_skirt->clone; + $s->translate(map scale($_), @{$extruder->extruder_offset}); + } + my $convex_hull = convex_hull([ map @$_, @skirts ]); + $gcodegen->standby_points([ map $_->clone, map @$_, map $_->subdivide(scale 10), @{offset([$convex_hull], scale 3)} ]); } - my $convex_hull = convex_hull([ map @$_, @skirts ]); - $gcodegen->standby_points([ map $_->clone, map @$_, map $_->subdivide(scale 10), @{offset([$convex_hull], scale 3)} ]); } # prepare the layer processor