Fix brim and extra perimeters after recent changes to ->slices
This commit is contained in:
parent
de0c2febd9
commit
c3dde74776
2 changed files with 10 additions and 10 deletions
|
@ -635,7 +635,7 @@ sub make_brim {
|
||||||
polygon => Slic3r::Polygon->new($_),
|
polygon => Slic3r::Polygon->new($_),
|
||||||
role => EXTR_ROLE_SKIRT,
|
role => EXTR_ROLE_SKIRT,
|
||||||
flow_spacing => $flow->spacing,
|
flow_spacing => $flow->spacing,
|
||||||
) for Slic3r::Geometry::Clipper::offset(\@islands, $i * $flow->scaled_spacing, undef, JT_SQUARE);
|
) for Slic3r::Geometry::Clipper::offset(\@islands, ($i - 0.5) * $flow->scaled_spacing, undef, JT_SQUARE); # -0.5 because islands are not represented by their centerlines
|
||||||
# TODO: we need the offset inwards/offset outwards logic to avoid overlapping extrusions
|
# TODO: we need the offset inwards/offset outwards logic to avoid overlapping extrusions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,15 +208,15 @@ sub make_perimeters {
|
||||||
for my $layer_id (0 .. $self->layer_count-2) {
|
for my $layer_id (0 .. $self->layer_count-2) {
|
||||||
my $layerm = $self->layers->[$layer_id]->regions->[$region_id];
|
my $layerm = $self->layers->[$layer_id]->regions->[$region_id];
|
||||||
my $upper_layerm = $self->layers->[$layer_id+1]->regions->[$region_id];
|
my $upper_layerm = $self->layers->[$layer_id+1]->regions->[$region_id];
|
||||||
my $perimeter_flow = $layerm->perimeter_flow;
|
my $perimeter_spacing = $layerm->perimeter_flow->scaled_spacing;
|
||||||
|
|
||||||
my $overlap = $perimeter_flow->scaled_spacing; # one perimeter
|
my $overlap = $perimeter_spacing; # one perimeter
|
||||||
|
|
||||||
# compute polygons representing the thickness of the first external perimeter of
|
# compute polygons representing the thickness of the first external perimeter of
|
||||||
# the upper layer slices
|
# the upper layer slices
|
||||||
my $upper = diff_ex(
|
my $upper = diff_ex(
|
||||||
[ map @$_, map $_->expolygon->offset_ex(+ 0.5 * $perimeter_flow->scaled_spacing), @{$upper_layerm->slices} ],
|
[ map @{$_->expolygon}, @{$upper_layerm->slices} ],
|
||||||
[ map @$_, map $_->expolygon->offset_ex(- $overlap + (0.5 * $perimeter_flow->scaled_spacing)), @{$upper_layerm->slices} ],
|
[ map @$_, map $_->expolygon->offset_ex(-$overlap), @{$upper_layerm->slices} ],
|
||||||
);
|
);
|
||||||
next if !@$upper;
|
next if !@$upper;
|
||||||
|
|
||||||
|
@ -225,10 +225,10 @@ sub make_perimeters {
|
||||||
my $ignore = [];
|
my $ignore = [];
|
||||||
{
|
{
|
||||||
my $diff = diff_ex(
|
my $diff = diff_ex(
|
||||||
[ map @$_, map $_->expolygon->offset_ex(- ($Slic3r::Config->perimeters-0.5) * $perimeter_flow->scaled_spacing), @{$layerm->slices} ],
|
[ map @$_, map $_->expolygon->offset_ex(- $Slic3r::Config->perimeters * $perimeter_spacing), @{$layerm->slices} ],
|
||||||
[ map @{$_->expolygon}, @{$upper_layerm->slices} ],
|
[ map @$_, map $_->expolygon->offset_ex(- 0.5*$perimeter_spacing), @{$upper_layerm->slices} ],
|
||||||
);
|
);
|
||||||
$ignore = [ map @$_, map $_->offset_ex($perimeter_flow->scaled_spacing), @$diff ];
|
$ignore = [ map @$_, map $_->offset_ex($perimeter_spacing), @$diff ];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $slice (@{$layerm->slices}) {
|
foreach my $slice (@{$layerm->slices}) {
|
||||||
|
@ -238,9 +238,9 @@ sub make_perimeters {
|
||||||
# of our slice
|
# of our slice
|
||||||
my $hypothetical_perimeter;
|
my $hypothetical_perimeter;
|
||||||
{
|
{
|
||||||
my $outer = [ map @$_, $slice->expolygon->offset_ex(- ($hypothetical_perimeter_num-1.5) * $perimeter_flow->scaled_spacing - scaled_epsilon) ];
|
my $outer = [ map @$_, $slice->expolygon->offset_ex(- ($hypothetical_perimeter_num-1) * $perimeter_spacing - scaled_epsilon) ];
|
||||||
last CYCLE if !@$outer;
|
last CYCLE if !@$outer;
|
||||||
my $inner = [ map @$_, $slice->expolygon->offset_ex(- ($hypothetical_perimeter_num-0.5) * $perimeter_flow->scaled_spacing) ];
|
my $inner = [ map @$_, $slice->expolygon->offset_ex(- $hypothetical_perimeter_num * $perimeter_spacing) ];
|
||||||
last CYCLE if !@$inner;
|
last CYCLE if !@$inner;
|
||||||
$hypothetical_perimeter = diff_ex($outer, $inner);
|
$hypothetical_perimeter = diff_ex($outer, $inner);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue