Rename $layer to $layerm in Slic3r::Fill too for consistency
This commit is contained in:
parent
a9090688f9
commit
c3d90a1ff8
@ -48,17 +48,17 @@ sub filler {
|
|||||||
|
|
||||||
sub make_fill {
|
sub make_fill {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($layer) = @_;
|
my ($layerm) = @_;
|
||||||
|
|
||||||
Slic3r::debugf "Filling layer %d:\n", $layer->id;
|
Slic3r::debugf "Filling layer %d:\n", $layerm->id;
|
||||||
|
|
||||||
# merge overlapping surfaces
|
# merge overlapping surfaces
|
||||||
my @surfaces = ();
|
my @surfaces = ();
|
||||||
{
|
{
|
||||||
my @surfaces_with_bridge_angle = grep defined $_->bridge_angle, @{$layer->fill_surfaces};
|
my @surfaces_with_bridge_angle = grep defined $_->bridge_angle, @{$layerm->fill_surfaces};
|
||||||
|
|
||||||
# give priority to bridges
|
# give priority to bridges
|
||||||
my @groups = Slic3r::Surface->group({merge_solid => 1}, @{$layer->fill_surfaces});
|
my @groups = Slic3r::Surface->group({merge_solid => 1}, @{$layerm->fill_surfaces});
|
||||||
@groups = sort { defined $a->[0]->bridge_angle ? -1 : 0 } @groups;
|
@groups = sort { defined $a->[0]->bridge_angle ? -1 : 0 } @groups;
|
||||||
|
|
||||||
foreach my $group (@groups) {
|
foreach my $group (@groups) {
|
||||||
@ -91,7 +91,7 @@ sub make_fill {
|
|||||||
|
|
||||||
# add spacing between adjacent surfaces
|
# add spacing between adjacent surfaces
|
||||||
{
|
{
|
||||||
my $distance = $layer->infill_flow->scaled_spacing / 2;
|
my $distance = $layerm->infill_flow->scaled_spacing / 2;
|
||||||
my @offsets = ();
|
my @offsets = ();
|
||||||
foreach my $surface (@surfaces) {
|
foreach my $surface (@surfaces) {
|
||||||
my $expolygon = $surface->expolygon;
|
my $expolygon = $surface->expolygon;
|
||||||
@ -125,8 +125,8 @@ sub make_fill {
|
|||||||
SURFACE: foreach my $surface (@surfaces) {
|
SURFACE: foreach my $surface (@surfaces) {
|
||||||
my $filler = $Slic3r::Config->fill_pattern;
|
my $filler = $Slic3r::Config->fill_pattern;
|
||||||
my $density = $Slic3r::Config->fill_density;
|
my $density = $Slic3r::Config->fill_density;
|
||||||
my $flow_spacing = $layer->infill_flow->spacing;
|
my $flow_spacing = $layerm->infill_flow->spacing;
|
||||||
my $is_bridge = $layer->id > 0 && $surface->is_bridge;
|
my $is_bridge = $layerm->id > 0 && $surface->is_bridge;
|
||||||
my $is_solid = $surface->is_solid;
|
my $is_solid = $surface->is_solid;
|
||||||
|
|
||||||
# force 100% density and rectilinear fill for external surfaces
|
# force 100% density and rectilinear fill for external surfaces
|
||||||
@ -135,7 +135,7 @@ sub make_fill {
|
|||||||
$filler = $Slic3r::Config->solid_fill_pattern;
|
$filler = $Slic3r::Config->solid_fill_pattern;
|
||||||
if ($is_bridge) {
|
if ($is_bridge) {
|
||||||
$filler = 'rectilinear';
|
$filler = 'rectilinear';
|
||||||
$flow_spacing = $layer->extruders->{infill}->bridge_flow->spacing;
|
$flow_spacing = $layerm->extruders->{infill}->bridge_flow->spacing;
|
||||||
} elsif ($surface->surface_type == S_TYPE_INTERNALSOLID) {
|
} elsif ($surface->surface_type == S_TYPE_INTERNALSOLID) {
|
||||||
$filler = 'rectilinear';
|
$filler = 'rectilinear';
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ sub make_fill {
|
|||||||
my @paths;
|
my @paths;
|
||||||
{
|
{
|
||||||
my $f = $self->filler($filler);
|
my $f = $self->filler($filler);
|
||||||
$f->layer_id($layer->id);
|
$f->layer_id($layerm->id);
|
||||||
@paths = $f->fill_surface(
|
@paths = $f->fill_surface(
|
||||||
$surface,
|
$surface,
|
||||||
density => $density,
|
density => $density,
|
||||||
@ -157,7 +157,7 @@ sub make_fill {
|
|||||||
my $params = shift @paths;
|
my $params = shift @paths;
|
||||||
|
|
||||||
# ugly hack(tm) to get the right amount of flow (GCode.pm should be fixed)
|
# ugly hack(tm) to get the right amount of flow (GCode.pm should be fixed)
|
||||||
$params->{flow_spacing} = $layer->extruders->{infill}->bridge_flow->width if $is_bridge;
|
$params->{flow_spacing} = $layerm->extruders->{infill}->bridge_flow->width if $is_bridge;
|
||||||
|
|
||||||
# save into layer
|
# save into layer
|
||||||
next unless @paths;
|
next unless @paths;
|
||||||
@ -170,7 +170,7 @@ sub make_fill {
|
|||||||
: $is_solid
|
: $is_solid
|
||||||
? ($surface->surface_type == S_TYPE_TOP ? EXTR_ROLE_TOPSOLIDFILL : EXTR_ROLE_SOLIDFILL)
|
? ($surface->surface_type == S_TYPE_TOP ? EXTR_ROLE_TOPSOLIDFILL : EXTR_ROLE_SOLIDFILL)
|
||||||
: EXTR_ROLE_FILL),
|
: EXTR_ROLE_FILL),
|
||||||
height => $surface->depth_layers * $layer->height,
|
height => $surface->depth_layers * $layerm->height,
|
||||||
flow_spacing => $params->{flow_spacing} || (warn "Warning: no flow_spacing was returned by the infill engine, please report this to the developer\n"),
|
flow_spacing => $params->{flow_spacing} || (warn "Warning: no flow_spacing was returned by the infill engine, please report this to the developer\n"),
|
||||||
), @paths,
|
), @paths,
|
||||||
],
|
],
|
||||||
@ -179,8 +179,8 @@ sub make_fill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# add thin fill regions
|
# add thin fill regions
|
||||||
push @fills, @{$layer->thin_fills};
|
push @fills, @{$layerm->thin_fills};
|
||||||
push @fills_ordering_points, map $_->unpack->points->[0], @{$layer->thin_fills};
|
push @fills_ordering_points, map $_->unpack->points->[0], @{$layerm->thin_fills};
|
||||||
|
|
||||||
# organize infill paths using a nearest-neighbor search
|
# organize infill paths using a nearest-neighbor search
|
||||||
@fills = @fills[ chained_path(\@fills_ordering_points) ];
|
@fills = @fills[ chained_path(\@fills_ordering_points) ];
|
||||||
|
Loading…
Reference in New Issue
Block a user