mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-05 06:14:04 +08:00
Bugfix: model with rounded walls had small useless infill regions. #177
This commit is contained in:
parent
7893480fd7
commit
ad8c9d4ea1
1
MANIFEST
1
MANIFEST
@ -49,3 +49,4 @@ t/geometry.t
|
|||||||
t/polyclip.t
|
t/polyclip.t
|
||||||
t/stl.t
|
t/stl.t
|
||||||
utils/post-processing/z-every-line.pl
|
utils/post-processing/z-every-line.pl
|
||||||
|
utils/split_stl.pl
|
||||||
|
@ -263,7 +263,9 @@ sub discover_horizontal_shells {
|
|||||||
my $layer = $self->layers->[$i];
|
my $layer = $self->layers->[$i];
|
||||||
foreach my $type (qw(top bottom)) {
|
foreach my $type (qw(top bottom)) {
|
||||||
# find surfaces of current type for current layer
|
# find surfaces of current type for current layer
|
||||||
my @surfaces = grep $_->surface_type eq $type, @{$layer->fill_surfaces} or next;
|
# and offset them to take perimeters into account
|
||||||
|
my @surfaces = map $_->offset($Slic3r::perimeters * scale $Slic3r::flow_width),
|
||||||
|
grep $_->surface_type eq $type, @{$layer->fill_surfaces} or next;
|
||||||
my $surfaces_p = [ map $_->p, @surfaces ];
|
my $surfaces_p = [ map $_->p, @surfaces ];
|
||||||
Slic3r::debugf "Layer %d has %d surfaces of type '%s'\n",
|
Slic3r::debugf "Layer %d has %d surfaces of type '%s'\n",
|
||||||
$i, scalar(@surfaces), $type;
|
$i, scalar(@surfaces), $type;
|
||||||
|
@ -37,6 +37,14 @@ sub group {
|
|||||||
return values %unique_types;
|
return values %unique_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub offset {
|
||||||
|
my $self = shift;
|
||||||
|
return (ref $self)->new(
|
||||||
|
expolygon => $self->expolygon->offset_ex(@_),
|
||||||
|
map { $_ => $self->$_ } qw(surface_type depth_layers bridge_angle),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sub add_hole {
|
sub add_hole {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($hole) = @_;
|
my ($hole) = @_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user