Enable retraction for support material too, but only when moving away from support islands. #831

This commit is contained in:
Alessandro Ranellucci 2012-12-20 18:47:40 +01:00
parent bf603b0221
commit d5537e7797
3 changed files with 23 additions and 13 deletions

View file

@ -163,10 +163,11 @@ sub extrude_path {
my $gcode = "";
# skip retract for support material
if ($path->role != EXTR_ROLE_SUPPORTMATERIAL) {
{
# retract if distance from previous position is greater or equal to the one specified by the user
my $travel = Slic3r::Line->new($self->last_pos->clone, $path->points->[0]->clone);
if ($travel->length >= scale $self->extruder->retract_before_travel) {
if ($travel->length >= scale $self->extruder->retract_before_travel
&& ($path->role != EXTR_ROLE_SUPPORTMATERIAL || !$self->layer->support_islands_enclose_line($travel))) {
# move travel back to original layer coordinates.
# note that we're only considering the current object's islands, while we should
# build a more complete configuration space