mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 04:55:55 +08:00
Bugfix: some gaps were filled twice. #2836
This commit is contained in:
parent
31e0fc7f17
commit
7cc745969c
@ -95,7 +95,7 @@ sub process {
|
|||||||
my $loop_number = $self->config->perimeters + ($surface->extra_perimeters || 0);
|
my $loop_number = $self->config->perimeters + ($surface->extra_perimeters || 0);
|
||||||
$loop_number--; # 0-indexed loops
|
$loop_number--; # 0-indexed loops
|
||||||
|
|
||||||
my @gaps = (); # ExPolygons
|
my @gaps = (); # Polygons
|
||||||
|
|
||||||
my @last = @{$surface->expolygon->simplify_p(&Slic3r::SCALED_RESOLUTION)};
|
my @last = @{$surface->expolygon->simplify_p(&Slic3r::SCALED_RESOLUTION)};
|
||||||
if ($loop_number >= 0) { # no loops = -1
|
if ($loop_number >= 0) { # no loops = -1
|
||||||
@ -177,7 +177,7 @@ sub process {
|
|||||||
offset(\@last, -0.5*$pspacing),
|
offset(\@last, -0.5*$pspacing),
|
||||||
offset(\@offsets, +0.5*$pspacing + 10), # safety offset
|
offset(\@offsets, +0.5*$pspacing + 10), # safety offset
|
||||||
);
|
);
|
||||||
push @gaps, grep abs($_->area) >= $gap_area_threshold, @$diff;
|
push @gaps, map $_->clone, map @$_, grep abs($_->area) >= $gap_area_threshold, @$diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ sub process {
|
|||||||
require "Slic3r/SVG.pm";
|
require "Slic3r/SVG.pm";
|
||||||
Slic3r::SVG::output(
|
Slic3r::SVG::output(
|
||||||
"gaps.svg",
|
"gaps.svg",
|
||||||
expolygons => \@gaps,
|
expolygons => union_ex(\@gaps),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,6 +304,7 @@ sub process {
|
|||||||
->grow(scale $w/2)};
|
->grow(scale $w/2)};
|
||||||
} @gap_fill;
|
} @gap_fill;
|
||||||
@last = @{diff(\@last, \@filled)};
|
@last = @{diff(\@last, \@filled)};
|
||||||
|
@gaps = @{diff(\@gaps, \@filled)}; # prevent more gap fill here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,8 +455,8 @@ sub _fill_gaps {
|
|||||||
$min *= (1 - &Slic3r::INSET_OVERLAP_TOLERANCE);
|
$min *= (1 - &Slic3r::INSET_OVERLAP_TOLERANCE);
|
||||||
|
|
||||||
my $this = diff_ex(
|
my $this = diff_ex(
|
||||||
offset2([ map @$_, @$gaps ], -$min/2, +$min/2),
|
offset2($gaps, -$min/2, +$min/2),
|
||||||
offset2([ map @$_, @$gaps ], -$max/2, +$max/2),
|
offset2($gaps, -$max/2, +$max/2),
|
||||||
1,
|
1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user