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:44:14 +01:00
parent 280a1a369e
commit 96ad37f6e0

View file

@ -261,6 +261,12 @@ sub make_perimeters {
$i--;
}
}
# order holes efficiently
@holes = @{Slic3r::Geometry::chained_path_items(
[ map [ ($_->{outer} // $_->{hole})->first_point, $_ ], @holes ],
)};
push @loops, reverse map $traverse->([$_], 0), @holes;
}
push @loops, $traverse->($polynode->{children}, $depth+1, $is_contour);