diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index cdf26c9e0..c381ce95c 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -625,11 +625,14 @@ EOF sub make_skirt { my $self = shift; + + # since this method must be idempotent, we clear skirt paths *before* + # checking whether we need to generate them + $self->skirt->clear; + return unless $self->config->skirts > 0 || ($self->config->ooze_prevention && @{$self->extruders} > 1); - $self->skirt->clear; # method must be idempotent - # First off we need to decide how tall the skirt must be. # The skirt_height option from config is expressed in layers, but our # object might have different layer heights, so we need to find the print_z @@ -737,9 +740,12 @@ sub make_skirt { sub make_brim { my $self = shift; - return unless $self->config->brim_width > 0; - $self->brim->clear; # method must be idempotent + # since this method must be idempotent, we clear brim paths *before* + # checking whether we need to generate them + $self->brim->clear; + + return unless $self->config->brim_width > 0; # brim is only printed on first layer and uses support material extruder my $first_layer_height = $self->objects->[0]->config->get_abs_value('first_layer_height'); diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index a43123a88..61b3da837 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -965,6 +965,9 @@ sub combine_infill { sub generate_support_material { my $self = shift; + + # TODO: make this method idempotent by removing all support layers + # before checking whether we need to generate support or not return unless ($self->config->support_material || $self->config->raft_layers > 0) && scalar(@{$self->layers}) >= 2;