Restore thin walls and thin fills after last commit

This commit is contained in:
Alessandro Ranellucci 2012-07-20 15:02:25 +02:00
parent e71472e5d7
commit bce2663ed8
4 changed files with 13 additions and 18 deletions

View File

@ -33,11 +33,6 @@ sub pack {
return $o;
}
sub shortest_path {
my $self = shift;
return $self;
}
sub split_at_index {
my $self = shift;
my ($index) = @_;

View File

@ -58,11 +58,6 @@ sub pack {
# no-op, this allows to use both packed and non-packed objects in Collections
sub unpack { $_[0] }
sub shortest_path {
my $self = shift;
return $self;
}
sub clip_end {
my $self = shift;
my ($distance) = @_;

View File

@ -349,13 +349,14 @@ sub make_perimeters {
# add thin walls as perimeters
{
my @thin_paths = ();
my %properties = (
role => EXTR_ROLE_PERIMETER,
flow_spacing => $self->perimeters_flow->spacing,
);
for (@{ $self->thin_walls }) {
if ($_->isa('Slic3r::Polygon')) {
push @thin_paths, Slic3r::ExtrusionLoop->pack(polygon => $_, role => EXTR_ROLE_PERIMETER);
} else {
push @thin_paths, Slic3r::ExtrusionPath->pack(polyline => $_, role => EXTR_ROLE_PERIMETER);
}
$thin_paths[-1]->flow_spacing($self->perimeters_flow->spacing);
push @thin_paths, $_->isa('Slic3r::Polygon')
? Slic3r::ExtrusionLoop->pack(polygon => $_, %properties)
: Slic3r::ExtrusionPath->pack(polyline => $_, %properties);
}
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => \@thin_paths);
push @{ $self->perimeters }, $collection->shortest_path;

View File

@ -604,8 +604,12 @@ sub write_gcode {
$gcode .= $gcodegen->set_tool($Slic3r::infill_extruder-1);
$gcode .= $gcodegen->set_acceleration($Slic3r::infill_acceleration);
for my $fill (@{ $layer->fills }) {
$gcode .= $gcodegen->extrude($_, 'fill')
for $fill->shortest_path($gcodegen->last_pos);
if ($fill->isa('Slic3r::ExtrusionPath::Collection')) {
$gcode .= $gcodegen->extrude($_, 'fill')
for $fill->shortest_path($gcodegen->last_pos);
} else {
$gcode .= $gcodegen->extrude($fill, 'fill') ;
}
}
# extrude support material