Permalink
Browse files

Always move Z at travel speed. #1093

  • Loading branch information...
1 parent 6b98920 commit 94ed6cd2397c495f2d38b57dac3086e2cda8bdce @alexrj committed Apr 8, 2013
Showing with 11 additions and 1 deletion.
  1. +4 −1 lib/Slic3r/GCode.pm
  2. +5 −0 t/fill.t
  3. +2 −0 t/retraction.t
View
@@ -364,13 +364,13 @@ sub retract {
}
# prepare moves
- $self->speed('retract');
my $retract = [undef, undef, -$length, $comment];
my $lift = ($self->extruder->retract_lift == 0 || defined $params{move_z}) && !$self->lifted
? undef
: [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during travel'];
if (($Slic3r::Config->g0 || $Slic3r::Config->gcode_flavor eq 'mach3') && $params{travel_to}) {
+ $self->speed('travel');
if ($lift) {
# combine lift and retract
$lift->[2] = $retract->[2];
@@ -382,6 +382,7 @@ sub retract {
}
} elsif (($Slic3r::Config->g0 || $Slic3r::Config->gcode_flavor eq 'mach3') && defined $params{move_z}) {
# combine Z change and retraction
+ $self->speed('travel');
my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"];
$gcode .= $self->G0(@$travel);
} else {
@@ -395,9 +396,11 @@ sub retract {
$gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE");
}
} else {
+ $self->speed('retract');
$gcode .= $self->G1(@$retract);
}
if (!$self->lifted) {
+ $self->speed('travel');
if (defined $params{move_z} && $self->extruder->retract_lift > 0) {
my $travel = [undef, $params{move_z} + $self->extruder->retract_lift, 0, 'move to next layer (' . $self->layer->id . ') and lift'];
$gcode .= $self->G0(@$travel);
View
@@ -39,6 +39,11 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
$surface->expolygon->rotate(Slic3r::Geometry::deg2rad($angle), [0,0]);
my ($params, @paths) = $filler->fill_surface($surface, flow_spacing => 0.69, density => 0.4);
is scalar @paths, 1, 'one continuous path';
+ use Slic3r::SVG;
+ Slic3r::SVG::output("fill.svg",
+ expolygons => [$surface->expolygon],
+ polylines => [@paths],
+ );exit;
}
}
View
@@ -52,6 +52,7 @@ my $test = sub {
if !_eq($info->{dist_Z}, -$print->extruders->[$tool]->retract_lift);
$lifted = 0;
}
+ fail 'move Z at travel speed' if ($args->{F} // $self->F) != $conf->travel_speed * 60;
}
if ($info->{retracting}) {
$retracted[$tool] = 1;
@@ -89,6 +90,7 @@ my $test = sub {
};
$config->set('first_layer_height', $config->layer_height);
+$config->set('first_layer_speed', '100%');
$config->set('start_gcode', ''); # to avoid dealing with the nozzle lift in start G-code
$config->set('retract_length', [1.5]);
$config->set('retract_before_travel', [3]);

0 comments on commit 94ed6cd

Please sign in to comment.