mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 19:49:03 +08:00
Bugfix: sometimes first layer extrusion width was not applied
This commit is contained in:
parent
49916b6178
commit
a0fe93e8cf
@ -3,7 +3,7 @@ use Moo;
|
|||||||
|
|
||||||
use Slic3r::Geometry::Clipper qw(union_ex);
|
use Slic3r::Geometry::Clipper qw(union_ex);
|
||||||
|
|
||||||
has 'id' => (is => 'rw', required => 1); # sequential number of layer, 0-based
|
has 'id' => (is => 'rw', required => 1, trigger => 1); # sequential number of layer, 0-based
|
||||||
has 'object' => (is => 'ro', weak_ref => 1, required => 1);
|
has 'object' => (is => 'ro', weak_ref => 1, required => 1);
|
||||||
has 'regions' => (is => 'ro', default => sub { [] });
|
has 'regions' => (is => 'ro', default => sub { [] });
|
||||||
has 'slicing_errors' => (is => 'rw');
|
has 'slicing_errors' => (is => 'rw');
|
||||||
@ -20,6 +20,11 @@ has 'slices' => (is => 'rw');
|
|||||||
# ordered collection of extrusion paths to fill surfaces for support material
|
# ordered collection of extrusion paths to fill surfaces for support material
|
||||||
has 'support_fills' => (is => 'rw');
|
has 'support_fills' => (is => 'rw');
|
||||||
|
|
||||||
|
sub _trigger_id {
|
||||||
|
my $self = shift;
|
||||||
|
$_->_trigger_layer for @{$self->regions || []};
|
||||||
|
}
|
||||||
|
|
||||||
# Z used for slicing
|
# Z used for slicing
|
||||||
sub _build_slice_z {
|
sub _build_slice_z {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -11,11 +11,12 @@ has 'layer' => (
|
|||||||
is => 'ro',
|
is => 'ro',
|
||||||
weak_ref => 1,
|
weak_ref => 1,
|
||||||
required => 1,
|
required => 1,
|
||||||
|
trigger => 1,
|
||||||
handles => [qw(id slice_z print_z height flow)],
|
handles => [qw(id slice_z print_z height flow)],
|
||||||
);
|
);
|
||||||
has 'region' => (is => 'ro', required => 1);
|
has 'region' => (is => 'ro', required => 1);
|
||||||
has 'perimeter_flow' => (is => 'lazy');
|
has 'perimeter_flow' => (is => 'rw');
|
||||||
has 'infill_flow' => (is => 'lazy');
|
has 'infill_flow' => (is => 'rw');
|
||||||
|
|
||||||
# collection of spare segments generated by slicing the original geometry;
|
# collection of spare segments generated by slicing the original geometry;
|
||||||
# these need to be merged in continuos (closed) polylines
|
# these need to be merged in continuos (closed) polylines
|
||||||
@ -47,18 +48,16 @@ has 'perimeters' => (is => 'rw', default => sub { [] });
|
|||||||
# ordered collection of extrusion paths to fill surfaces
|
# ordered collection of extrusion paths to fill surfaces
|
||||||
has 'fills' => (is => 'rw', default => sub { [] });
|
has 'fills' => (is => 'rw', default => sub { [] });
|
||||||
|
|
||||||
sub _build_perimeter_flow {
|
sub _trigger_layer {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->id == 0
|
|
||||||
? $self->region->first_layer_flows->{perimeter}
|
|
||||||
: $self->region->flows->{perimeter}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub _build_infill_flow {
|
$self->perimeter_flow($self->id == 0
|
||||||
my $self = shift;
|
? $self->region->first_layer_flows->{perimeter}
|
||||||
return $self->id == 0
|
: $self->region->flows->{perimeter});
|
||||||
|
|
||||||
|
$self->infill_flow($self->id == 0
|
||||||
? $self->region->first_layer_flows->{infill}
|
? $self->region->first_layer_flows->{infill}
|
||||||
: $self->region->flows->{infill}
|
: $self->region->flows->{infill});
|
||||||
}
|
}
|
||||||
|
|
||||||
# build polylines from lines
|
# build polylines from lines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user