Better linear gap fill, now with adaptive extrusion width
This commit is contained in:
parent
98b7ae0022
commit
f344426873
@ -280,21 +280,35 @@ sub make_perimeters {
|
|||||||
|
|
||||||
# fill gaps
|
# fill gaps
|
||||||
{
|
{
|
||||||
# inset gap area to get the right spacing with the surrounding perimeters
|
my $fill_gaps = sub {
|
||||||
@gaps = @{offset_ex([ map @$_, @gaps ], -$pspacing/2)};
|
my ($min, $max, $w) = @_;
|
||||||
|
|
||||||
my %path_args = (
|
my $this = diff_ex(
|
||||||
role => EXTR_ROLE_GAPFILL,
|
offset2([ map @$_, @gaps ], -$min/2, +$min/2),
|
||||||
mm3_per_mm => $solid_infill_flow->mm3_per_mm($self->height),
|
offset2([ map @$_, @gaps ], -$max/2, +$max/2),
|
||||||
);
|
1,
|
||||||
$self->thin_fills->append(map {
|
);
|
||||||
$_->isa('Slic3r::Polygon')
|
|
||||||
? Slic3r::ExtrusionLoop->new(polygon => $_, %path_args)->split_at_first_point # should we keep these as loops?
|
my $flow = $self->flow(FLOW_ROLE_SOLID_INFILL, 0, $w);
|
||||||
: Slic3r::ExtrusionPath->new(polyline => $_, %path_args),
|
my %path_args = (
|
||||||
} map @{$_->medial_axis($pwidth/2, $pwidth/10)}, @gaps);
|
role => EXTR_ROLE_GAPFILL,
|
||||||
|
mm3_per_mm => $flow->mm3_per_mm($self->height),
|
||||||
|
);
|
||||||
|
my @polylines = map @{$_->medial_axis($max, $min/2)}, @$this;
|
||||||
|
$self->thin_fills->append(map {
|
||||||
|
$_->isa('Slic3r::Polygon')
|
||||||
|
? Slic3r::ExtrusionLoop->new(polygon => $_, %path_args)->split_at_first_point # should we keep these as loops?
|
||||||
|
: Slic3r::ExtrusionPath->new(polyline => $_, %path_args),
|
||||||
|
} @polylines);
|
||||||
|
|
||||||
Slic3r::debugf " %d gaps filled with extrusion width = %s\n", scalar @gaps, $pwidth
|
Slic3r::debugf " %d gaps filled with extrusion width = %s\n", scalar @$this, $w
|
||||||
if @{ $self->thin_fills };
|
if @$this;
|
||||||
|
};
|
||||||
|
|
||||||
|
# where $pwidth < thickness < 2*$pspacing, infill with width = 1.5*$pwidth
|
||||||
|
# where 0.5*$pwidth < thickness < $pwidth, infill with width = 0.5*$pwidth
|
||||||
|
$fill_gaps->($pwidth, 2*$pspacing, unscale 1.5*$pwidth);
|
||||||
|
$fill_gaps->(0.5*$pwidth, $pwidth, unscale 0.5*$pwidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user