Simplify layer change code now that we have distinct support layers

This commit is contained in:
Alessandro Ranellucci 2013-08-09 19:46:20 +02:00
parent 548b301432
commit 4862d832b5
3 changed files with 13 additions and 21 deletions

View file

@ -732,7 +732,7 @@ sub write_gcode {
# set up our extruder object
my $gcodegen = Slic3r::GCode->new(
config => $self->config,
extruders => $self->extruders,
extruders => $self->extruders, # we should only pass the *used* extruders (but maintain the Tx indices right!)
layer_count => $self->layer_count,
);
print $fh "G21 ; set units to millimeters\n" if $Slic3r::Config->gcode_flavor ne 'makerware';
@ -768,6 +768,10 @@ sub write_gcode {
}
}
# always start with first extruder
# TODO: make sure we select the first *used* extruder
print $fh $gcodegen->set_extruder($self->extruders->[0]);
# calculate X,Y shift to center print around specified origin
my $print_bb = $self->bounding_box;
my $print_size = $print_bb->size;