Only apply perimeter/infill overlap to the endpoints of rectilinear infill (and do that in a more proper way)
This commit is contained in:
parent
3ee0fc5b1c
commit
04aa240265
@ -142,7 +142,7 @@ sub make_fill {
|
|||||||
# we are going to grow such regions by overlapping them with the void (if any)
|
# we are going to grow such regions by overlapping them with the void (if any)
|
||||||
# TODO: detect and investigate whether there could be narrow regions without
|
# TODO: detect and investigate whether there could be narrow regions without
|
||||||
# any void neighbors
|
# any void neighbors
|
||||||
my $distance_between_surfaces = $infill_flow->scaled_spacing * &Slic3r::INFILL_OVERLAP_OVER_SPACING;
|
my $distance_between_surfaces = $infill_flow->scaled_spacing;
|
||||||
{
|
{
|
||||||
my $collapsed = diff(
|
my $collapsed = diff(
|
||||||
[ map @{$_->expolygon}, @surfaces ],
|
[ map @{$_->expolygon}, @surfaces ],
|
||||||
|
@ -26,9 +26,7 @@ sub fill_surface {
|
|||||||
$self->spacing(unscale $distance);
|
$self->spacing(unscale $distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
# compensate the overlap which is good for rectilinear but harmful for concentric
|
my @loops = my @last = map $_->clone, @$expolygon;
|
||||||
# where the perimeter/infill spacing should be equal to any other loop spacing
|
|
||||||
my @loops = my @last = @{offset(\@$expolygon, -&Slic3r::INFILL_OVERLAP_OVER_SPACING * $min_spacing / 2)};
|
|
||||||
while (@last) {
|
while (@last) {
|
||||||
push @loops, @last = @{offset2(\@last, -($distance + 0.5*$min_spacing), +0.5*$min_spacing)};
|
push @loops, @last = @{offset2(\@last, -($distance + 0.5*$min_spacing), +0.5*$min_spacing)};
|
||||||
}
|
}
|
||||||
|
@ -54,10 +54,21 @@ sub fill_surface {
|
|||||||
# the minimum offset for preventing edge lines from being clipped is scaled_epsilon;
|
# the minimum offset for preventing edge lines from being clipped is scaled_epsilon;
|
||||||
# however we use a larger offset to support expolygons with slightly skewed sides and
|
# however we use a larger offset to support expolygons with slightly skewed sides and
|
||||||
# not perfectly straight
|
# not perfectly straight
|
||||||
my @polylines = @{intersection_pl(\@vertical_lines, $expolygon->offset(scale 0.02))};
|
my @polylines = @{intersection_pl(\@vertical_lines, $expolygon->offset(+scale 0.02))};
|
||||||
|
|
||||||
|
my $extra = $self->_min_spacing * &Slic3r::INFILL_OVERLAP_OVER_SPACING;
|
||||||
|
foreach my $polyline (@polylines) {
|
||||||
|
my ($first_point, $last_point) = @$polyline[0,-1];
|
||||||
|
if ($first_point->y > $last_point->y) { #>
|
||||||
|
($first_point, $last_point) = ($last_point, $first_point);
|
||||||
|
}
|
||||||
|
$first_point->set_y($first_point->y - $extra); #--
|
||||||
|
$last_point->set_y($last_point->y + $extra); #++
|
||||||
|
}
|
||||||
|
|
||||||
# connect lines
|
# connect lines
|
||||||
unless ($params{dont_connect} || !@polylines) { # prevent calling leftmost_point() on empty collections
|
unless ($params{dont_connect} || !@polylines) { # prevent calling leftmost_point() on empty collections
|
||||||
|
# offset the expolygon by max(min_spacing/2, extra)
|
||||||
my ($expolygon_off) = @{$expolygon->offset_ex($self->_min_spacing/2)};
|
my ($expolygon_off) = @{$expolygon->offset_ex($self->_min_spacing/2)};
|
||||||
my $collection = Slic3r::Polyline::Collection->new(@polylines);
|
my $collection = Slic3r::Polyline::Collection->new(@polylines);
|
||||||
@polylines = ();
|
@polylines = ();
|
||||||
|
@ -1009,7 +1009,7 @@ sub combine_infill {
|
|||||||
# Because fill areas for rectilinear and honeycomb are grown
|
# Because fill areas for rectilinear and honeycomb are grown
|
||||||
# later to overlap perimeters, we need to counteract that too.
|
# later to overlap perimeters, we need to counteract that too.
|
||||||
+ (($type == S_TYPE_INTERNALSOLID || $region->config->fill_pattern =~ /(rectilinear|honeycomb)/)
|
+ (($type == S_TYPE_INTERNALSOLID || $region->config->fill_pattern =~ /(rectilinear|honeycomb)/)
|
||||||
? $layerms[-1]->flow(FLOW_ROLE_SOLID_INFILL)->scaled_width * &Slic3r::INFILL_OVERLAP_OVER_SPACING
|
? $layerms[-1]->flow(FLOW_ROLE_SOLID_INFILL)->scaled_width
|
||||||
: 0)
|
: 0)
|
||||||
)}, @$intersection;
|
)}, @$intersection;
|
||||||
|
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
%code{% RETVAL = THIS->x; %};
|
%code{% RETVAL = THIS->x; %};
|
||||||
long y()
|
long y()
|
||||||
%code{% RETVAL = THIS->y; %};
|
%code{% RETVAL = THIS->y; %};
|
||||||
|
void set_x(long val)
|
||||||
|
%code{% THIS->x = val; %};
|
||||||
|
void set_y(long val)
|
||||||
|
%code{% THIS->y = val; %};
|
||||||
int nearest_point_index(Points points);
|
int nearest_point_index(Points points);
|
||||||
Point* nearest_point(Points points)
|
Point* nearest_point(Points points)
|
||||||
%code{% RETVAL = new Point(); THIS->nearest_point(points, RETVAL); %};
|
%code{% RETVAL = new Point(); THIS->nearest_point(points, RETVAL); %};
|
||||||
|
Loading…
Reference in New Issue
Block a user