mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-24 03:10:59 -07:00
The inwards move after an external loop was still randomly generated outwards in some cases. Perimeters are now generated with a distinct iterator for each slice. Nested islands are also correctly supported too. Various regression tests included. #2253
This commit is contained in:
parent
af92e3d49e
commit
406d045ced
7 changed files with 183 additions and 70 deletions
|
|
@ -424,17 +424,17 @@ sub process_layer {
|
|||
# process perimeters
|
||||
{
|
||||
my $extruder_id = $region->config->perimeter_extruder-1;
|
||||
foreach my $perimeter (@{$layerm->perimeters}) {
|
||||
foreach my $perimeter_coll (@{$layerm->perimeters}) {
|
||||
# init by_extruder item only if we actually use the extruder
|
||||
$by_extruder{$extruder_id} //= [];
|
||||
|
||||
# $perimeter is an ExtrusionLoop or ExtrusionPath object
|
||||
# $perimeter_coll is an ExtrusionPath::Collection object representing a single slice
|
||||
for my $i (0 .. $#{$layer->slices}) {
|
||||
if ($i == $#{$layer->slices}
|
||||
|| $layer->slices->[$i]->contour->contains_point($perimeter->first_point)) {
|
||||
|| $layer->slices->[$i]->contour->contains_point($perimeter_coll->first_point)) {
|
||||
$by_extruder{$extruder_id}[$i] //= { perimeters => {} };
|
||||
$by_extruder{$extruder_id}[$i]{perimeters}{$region_id} //= [];
|
||||
push @{ $by_extruder{$extruder_id}[$i]{perimeters}{$region_id} }, $perimeter;
|
||||
push @{ $by_extruder{$extruder_id}[$i]{perimeters}{$region_id} }, @$perimeter_coll;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ sub contact_area {
|
|||
# TODO: split_at_first_point() could split a bridge mid-way
|
||||
my @overhang_perimeters =
|
||||
map { $_->isa('Slic3r::ExtrusionLoop') ? $_->polygon->split_at_first_point : $_->polyline->clone }
|
||||
@{$layerm->perimeters};
|
||||
map @$_, @{$layerm->perimeters};
|
||||
|
||||
# workaround for Clipper bug, see Slic3r::Polygon::clip_as_polyline()
|
||||
$_->[0]->translate(1,0) for @overhang_perimeters;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue