Bugfix: holes were not sorted using the nearest-neighbor search, resulting in inefficient paths. #1785

This commit is contained in:
Alessandro Ranellucci 2014-03-23 19:55:31 +01:00
parent d02b64b31b
commit 5d3c8575c5

View File

@ -254,6 +254,10 @@ sub make_perimeters {
$i--;
}
}
# order holes efficiently
@holes = @holes[@{chained_path([ map {($_->{outer} // $_->{hole})->first_point} @holes ])}];
push @loops, reverse map $traverse->([$_], 0, 0), @holes;
}