mirror of https://github.com/vitalif/Slic3r
Move support data to Slic3r::Layer::Support class and make skirt work with new support material
parent
e3cca78aa6
commit
4a3a4a2c78
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue