Use nearest-neighbor search for internal perimeters too. #1025
This commit is contained in:
parent
c3d90a1ff8
commit
919d1131f8
1 changed files with 7 additions and 1 deletions
|
@ -173,7 +173,7 @@ sub make_perimeters {
|
|||
# )
|
||||
my @perimeters = (); # one item per depth; each item
|
||||
|
||||
# organize islands using a shortest path search
|
||||
# organize islands using a nearest-neighbor search
|
||||
my @surfaces = @{chained_path_items([
|
||||
map [ $_->contour->[0], $_ ], @{$self->slices},
|
||||
])};
|
||||
|
@ -245,6 +245,12 @@ sub make_perimeters {
|
|||
|
||||
last if !@new_offsets || $loop == $loop_number;
|
||||
@last_offsets = @new_offsets;
|
||||
|
||||
# sort loops before storing them
|
||||
@last_offsets = @{chained_path_items([
|
||||
map [ $_->contour->[0], $_ ], @last_offsets,
|
||||
])};
|
||||
|
||||
push @{ $perimeters[-1] }, [@last_offsets];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue