diff --git a/lib/Slic3r/GCode/Layer.pm b/lib/Slic3r/GCode/Layer.pm index 16d7aa57..5c361494 100644 --- a/lib/Slic3r/GCode/Layer.pm +++ b/lib/Slic3r/GCode/Layer.pm @@ -86,7 +86,7 @@ sub process_layer { # extrude support material before other things because it might use a lower Z # and also because we avoid travelling on other things when printing it - if ($self->print->has_support_material) { + if ($self->print->has_support_material && $layer->isa('Slic3r::Layer::Support')) { $gcode .= $self->gcodegen->move_z($layer->support_material_contact_z) if ($layer->support_contact_fills && @{ $layer->support_contact_fills->paths }); $gcode .= $self->gcodegen->set_extruder($self->extruders->[$Slic3r::Config->support_material_extruder-1]); diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 2a12b14c..d62257d0 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -19,11 +19,6 @@ has 'support_material_contact_height' => (is => 'rw'); # layer height of contac # also known as 'islands' (all regions are merged here) has 'slices' => (is => 'rw'); -# ordered collection of extrusion paths to fill surfaces for support material -has 'support_islands' => (is => 'rw'); -has 'support_fills' => (is => 'rw'); -has 'support_contact_fills' => (is => 'rw'); - sub _trigger_id { my $self = shift; $_->_trigger_layer for @{$self->regions || []}; @@ -87,4 +82,9 @@ package Slic3r::Layer::Support; use Moo; extends 'Slic3r::Layer'; +# ordered collection of extrusion paths to fill surfaces for support material +has 'support_islands' => (is => 'rw'); +has 'support_fills' => (is => 'rw'); +has 'support_contact_fills' => (is => 'rw'); + 1; diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 7de99862..c6f4060a 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -581,10 +581,11 @@ sub make_skirt { my $skirt_height = $Slic3r::Config->skirt_height; $skirt_height = $self->objects->[$obj_idx]->layer_count if $skirt_height > $self->objects->[$obj_idx]->layer_count; my @layers = map $self->objects->[$obj_idx]->layers->[$_], 0..($skirt_height-1); + my @support_layers = map $self->objects->[$obj_idx]->support_layers->[$_], 0..($skirt_height-1); my @layer_points = ( (map @$_, map @$_, map @{$_->slices}, @layers), (map @$_, map @{$_->thin_walls}, map @{$_->regions}, @layers), - (map @{$_->unpack->polyline}, map @{$_->support_fills->paths}, grep $_->support_fills, @layers), + (map @{$_->unpack->polyline}, map @{$_->support_fills->paths}, grep $_->support_fills, @support_layers), ); push @points, map move_points($_, @layer_points), @{$self->objects->[$obj_idx]->copies}; } diff --git a/lib/Slic3r/Test/SectionCut.pm b/lib/Slic3r/Test/SectionCut.pm index 20326694..6ba799ec 100644 --- a/lib/Slic3r/Test/SectionCut.pm +++ b/lib/Slic3r/Test/SectionCut.pm @@ -58,7 +58,7 @@ sub export_svg { ); $group->( - filter => sub { $_[0]->support_fills, $_[0]->support_contact_fills }, + filter => sub { $_[0]->isa('Slic3r::Layer::Support') ? ($_[0]->support_fills, $_[0]->support_contact_fills) : () }, style => { 'stroke-width' => 1, 'stroke' => '#444444',