Fixed regression causing a long string between copies
This commit is contained in:
parent
68c2ac601b
commit
ab2b31672f
2 changed files with 14 additions and 8 deletions
|
@ -47,6 +47,16 @@ my %role_speeds = (
|
||||||
&EXTR_ROLE_SUPPORTMATERIAL => 'perimeter',
|
&EXTR_ROLE_SUPPORTMATERIAL => 'perimeter',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sub set_shift {
|
||||||
|
my $self = shift;
|
||||||
|
my @shift = @_;
|
||||||
|
|
||||||
|
$self->shift_x($shift[X]);
|
||||||
|
$self->shift_y($shift[Y]);
|
||||||
|
|
||||||
|
$self->last_pos->translate(map -$_, @shift);
|
||||||
|
}
|
||||||
|
|
||||||
# this method accepts Z in scaled coordinates
|
# this method accepts Z in scaled coordinates
|
||||||
sub move_z {
|
sub move_z {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
|
@ -744,8 +744,7 @@ sub write_gcode {
|
||||||
|
|
||||||
# extrude skirt
|
# extrude skirt
|
||||||
if ($skirt_done < $Slic3r::Config->skirt_height) {
|
if ($skirt_done < $Slic3r::Config->skirt_height) {
|
||||||
$gcodegen->shift_x($shift[X]);
|
$gcodegen->set_shift(@shift);
|
||||||
$gcodegen->shift_y($shift[Y]);
|
|
||||||
$gcode .= $gcodegen->set_extruder($self->extruders->[0]); # move_z requires extruder
|
$gcode .= $gcodegen->set_extruder($self->extruders->[0]); # move_z requires extruder
|
||||||
$gcode .= $gcodegen->move_z($gcodegen->layer->print_z);
|
$gcode .= $gcodegen->move_z($gcodegen->layer->print_z);
|
||||||
$gcode .= $gcodegen->set_acceleration($Slic3r::Config->perimeter_acceleration);
|
$gcode .= $gcodegen->set_acceleration($Slic3r::Config->perimeter_acceleration);
|
||||||
|
@ -768,8 +767,7 @@ sub write_gcode {
|
||||||
if ($layer_id == 0 && !$brim_done) {
|
if ($layer_id == 0 && !$brim_done) {
|
||||||
$gcode .= $gcodegen->move_z($gcodegen->layer->print_z);
|
$gcode .= $gcodegen->move_z($gcodegen->layer->print_z);
|
||||||
$gcode .= $gcodegen->set_extruder($self->extruders->[$Slic3r::Config->support_material_extruder-1]);
|
$gcode .= $gcodegen->set_extruder($self->extruders->[$Slic3r::Config->support_material_extruder-1]);
|
||||||
$gcodegen->shift_x($shift[X]);
|
$gcodegen->set_shift(@shift);
|
||||||
$gcodegen->shift_y($shift[Y]);
|
|
||||||
$gcode .= $gcodegen->extrude_loop($_, 'brim') for @{$self->brim};
|
$gcode .= $gcodegen->extrude_loop($_, 'brim') for @{$self->brim};
|
||||||
$brim_done = 1;
|
$brim_done = 1;
|
||||||
}
|
}
|
||||||
|
@ -778,8 +776,7 @@ sub write_gcode {
|
||||||
my ($obj_idx, $copy) = @$obj_copy;
|
my ($obj_idx, $copy) = @$obj_copy;
|
||||||
my $layer = $self->objects->[$obj_idx]->layers->[$layer_id];
|
my $layer = $self->objects->[$obj_idx]->layers->[$layer_id];
|
||||||
|
|
||||||
$gcodegen->shift_x($shift[X] + unscale $copy->[X]);
|
$gcodegen->set_shift(map $shift[$_] + unscale $copy->[$_], X,Y);
|
||||||
$gcodegen->shift_y($shift[Y] + unscale $copy->[Y]);
|
|
||||||
|
|
||||||
# extrude support material before other things because it might use a lower Z
|
# 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
|
# and also because we avoid travelling on other things when printing it
|
||||||
|
@ -879,8 +876,7 @@ sub write_gcode {
|
||||||
# this happens before Z goes down to layer 0 again, so that
|
# this happens before Z goes down to layer 0 again, so that
|
||||||
# no collision happens hopefully.
|
# no collision happens hopefully.
|
||||||
if ($finished_objects > 0) {
|
if ($finished_objects > 0) {
|
||||||
$gcodegen->shift_x($shift[X] + unscale $copy->[X]);
|
$gcodegen->set_shift(map $shift[$_] + unscale $copy->[$_], X,Y);
|
||||||
$gcodegen->shift_y($shift[Y] + unscale $copy->[Y]);
|
|
||||||
print $fh $gcodegen->retract;
|
print $fh $gcodegen->retract;
|
||||||
print $fh $gcodegen->G0(Slic3r::Point->new(0,0), undef, 0, 'move to origin position for next object');
|
print $fh $gcodegen->G0(Slic3r::Point->new(0,0), undef, 0, 'move to origin position for next object');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue