Collect undetected lines (caused by dirty or non-manifold models), warn the user, post debug info. Includes some further ExPolygon refactoring.

This commit is contained in:
Alessandro Ranellucci 2011-11-11 10:21:48 +01:00
parent 91e250a2fd
commit fec816b065
9 changed files with 92 additions and 34 deletions

View file

@ -36,16 +36,13 @@ sub cast_from_expolygon {
my $class = shift;
my ($expolygon, %args) = @_;
if (ref $expolygon ne 'HASH') {
use XXX; ZZZ $expolygon if ref $expolygon eq 'ARRAY';
$expolygon = $expolygon->clipper_expolygon;
if (ref $expolygon eq 'HASH') {
$expolygon = Slic3r::ExPolygon->new($expolygon);
}
return $class->new(
contour => Slic3r::Polyline::Closed->cast($expolygon->{outer}),
holes => [
map Slic3r::Polyline::Closed->cast($_), @{$expolygon->{holes}}
],
contour => $expolygon->contour->closed_polyline,
holes => [ map $_->closed_polyline, $expolygon->holes ],
%args,
);
}