One more fix for ooze_prevention and skirt_height == -1

This commit is contained in:
Alessandro Ranellucci 2013-12-24 15:33:54 +01:00
parent f9d38f6655
commit 57e4e5c8e1
2 changed files with 8 additions and 3 deletions

View File

@ -661,7 +661,7 @@ sub set_extruder {
}
# set the current extruder to the standby temperature
if ($self->config->ooze_prevention && defined $self->extruder) {
if ($self->standby_points && defined $self->extruder) {
# move to the nearest standby point
$gcode .= $self->travel_to($self->last_pos->nearest_point($self->standby_points));

View File

@ -607,9 +607,14 @@ sub make_skirt {
my @points = ();
foreach my $obj_idx (0 .. $#{$self->objects}) {
my $object = $self->objects->[$obj_idx];
my @layers = map $object->layers->[$_], 0..min($self->config->skirt_height-1, $#{$object->layers});
# get skirt layers
my $skirt_height = ($self->config->skirt_height == -1)
? 1 + $#{$object->layers}
: 1 + min($self->config->skirt_height-1, $#{$object->layers}+1);
my @layer_points = (
(map @$_, map @$_, map @{$_->slices}, @layers),
map @$_, map @$_, map @{$object->layers->[$_]->slices}, 0..($skirt_height-1),
);
if (@{ $object->support_layers }) {
my @support_layers = map $object->support_layers->[$_], 0..min($self->config->skirt_height-1, $#{$object->support_layers});