mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 13:17:54 -06:00
Perimeters refactoring complete
This commit is contained in:
parent
67b24efd49
commit
ca549cd2fe
2 changed files with 54 additions and 35 deletions
|
@ -146,7 +146,7 @@ sub simplify_polygons {
|
|||
}
|
||||
|
||||
sub traverse_pt {
|
||||
my ($polynodes, $min_depth, $max_depth) = @_;
|
||||
my ($polynodes) = @_;
|
||||
|
||||
# use a nearest neighbor search to order these children
|
||||
# TODO: supply second argument to chained_path_items() too?
|
||||
|
@ -157,13 +157,8 @@ sub traverse_pt {
|
|||
my @polygons = ();
|
||||
foreach my $polynode (@$polynodes) {
|
||||
# traverse the next depth
|
||||
push @polygons, traverse_pt(
|
||||
$polynode->{children},
|
||||
(defined $min_depth ? $min_depth-1 : undef),
|
||||
(defined $max_depth ? $max_depth-1 : undef),
|
||||
) if !defined $max_depth || $max_depth >= 1;
|
||||
push @polygons, $polynode->{outer} // [ reverse @{$polynode->{hole}} ]
|
||||
if !defined $min_depth || $min_depth <= 0;
|
||||
push @polygons, traverse_pt($polynode->{children});
|
||||
push @polygons, $polynode->{outer} // [ reverse @{$polynode->{hole}} ];
|
||||
}
|
||||
return @polygons;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue