Bugfix: flow wasn't adjusted for perimeters when a custom perimeters extrusion width was applied
This commit is contained in:
parent
07f2dab5f6
commit
c4b9a6cf61
4 changed files with 17 additions and 6 deletions
|
@ -8,6 +8,8 @@ has 'polygon' => (
|
|||
handles => [qw(is_printable nearest_point_to reverse)],
|
||||
);
|
||||
|
||||
has 'flow_spacing' => (is => 'rw');
|
||||
|
||||
# see EXTR_ROLE_* constants in ExtrusionPath.pm
|
||||
has 'role' => (is => 'rw', required => 1);
|
||||
|
||||
|
@ -52,6 +54,7 @@ sub split_at {
|
|||
return Slic3r::ExtrusionPath->new(
|
||||
polyline => Slic3r::Polyline->new(\@new_points),
|
||||
role => $self->role,
|
||||
flow_spacing => $self->flow_spacing,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -178,11 +178,17 @@ sub make_fill {
|
|||
}
|
||||
|
||||
# add thin fill regions
|
||||
push @fills, map {
|
||||
{
|
||||
my %args = (
|
||||
role => EXTR_ROLE_SOLIDFILL,
|
||||
flow_spacing => $layer->perimeters_flow->spacing,
|
||||
);
|
||||
push @fills, map {
|
||||
$_->isa('Slic3r::Polygon')
|
||||
? Slic3r::ExtrusionLoop->new(polygon => $_, role => EXTR_ROLE_SOLIDFILL)->split_at_first_point
|
||||
: Slic3r::ExtrusionPath->new(polyline => $_, role => EXTR_ROLE_SOLIDFILL),
|
||||
? Slic3r::ExtrusionLoop->new(polygon => $_, %args)->split_at_first_point
|
||||
: Slic3r::ExtrusionPath->new(polyline => $_, %args),
|
||||
} @{$layer->thin_fills};
|
||||
}
|
||||
push @fills_ordering_points, map $_->[0], @{$layer->thin_fills};
|
||||
|
||||
# organize infill paths using a shortest path search
|
||||
|
|
|
@ -158,7 +158,7 @@ sub extrude_path {
|
|||
$gcode .= $self->unretract if $self->retracted;
|
||||
|
||||
# calculate extrusion length per distance unit
|
||||
my $s = $path->flow_spacing || $self->layer ? $self->layer->flow->spacing : $Slic3r::flow->spacing;
|
||||
my $s = $path->flow_spacing || ($self->layer ? $self->layer->flow->spacing : $Slic3r::flow->spacing);
|
||||
my $h = $path->depth_layers * $self->layer->height;
|
||||
my $w = ($s - ($self->layer ? $self->layer->flow->min_spacing : $Slic3r::flow->min_spacing) * $Slic3r::overlap_factor) / (1 - $Slic3r::overlap_factor);
|
||||
|
||||
|
|
|
@ -354,6 +354,7 @@ sub make_perimeters {
|
|||
} else {
|
||||
push @thin_paths, Slic3r::ExtrusionPath->new(polyline => $_, role => EXTR_ROLE_PERIMETER);
|
||||
}
|
||||
$thin_paths[-1]->flow_spacing($self->perimeters_flow->spacing);
|
||||
}
|
||||
my $collection = Slic3r::ExtrusionPath::Collection->new(paths => \@thin_paths);
|
||||
push @{ $self->perimeters }, $collection->shortest_path;
|
||||
|
@ -366,8 +367,9 @@ sub add_perimeter {
|
|||
|
||||
return unless $polygon->is_printable($self->perimeters_flow->width);
|
||||
push @{ $self->perimeters }, Slic3r::ExtrusionLoop->new(
|
||||
polygon => $polygon,
|
||||
role => (abs($polygon->length) <= $Slic3r::small_perimeter_length) ? EXTR_ROLE_SMALLPERIMETER : ($role // EXTR_ROLE_PERIMETER), #/
|
||||
polygon => $polygon,
|
||||
role => (abs($polygon->length) <= $Slic3r::small_perimeter_length) ? EXTR_ROLE_SMALLPERIMETER : ($role // EXTR_ROLE_PERIMETER), #/
|
||||
flow_spacing => $self->perimeters_flow->spacing,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue