Bugfix: some holes were skipped

This commit is contained in:
Alessandro Ranellucci 2011-12-19 12:09:14 +01:00
parent 4af295bce3
commit e2a5c2119f

View File

@ -105,14 +105,7 @@ sub make_surfaces {
my ($loops) = @_; my ($loops) = @_;
{ {
# merge contours my $expolygons = union_ex($loops);
my $expolygons = union_ex([ grep is_counter_clockwise($_), @$loops ]);
# subtract holes
$expolygons = union_ex([
(map @$_, @$expolygons),
(grep !is_counter_clockwise($_), @$loops)
]);
Slic3r::debugf " %d surface(s) having %d holes detected from %d polylines\n", Slic3r::debugf " %d surface(s) having %d holes detected from %d polylines\n",
scalar(@$expolygons), scalar(map $_->holes, @$expolygons), scalar(@$loops); scalar(@$expolygons), scalar(map $_->holes, @$expolygons), scalar(@$loops);
@ -134,11 +127,13 @@ sub make_surfaces {
} }
} }
#use Slic3r::SVG; if (0) {
#Slic3r::SVG::output(undef, "surfaces.svg", require "Slic3r/SVG.pm";
# polygons => [ map $_->contour->p, @{$self->surfaces} ], Slic3r::SVG::output(undef, "surfaces.svg",
# red_polygons => [ map $_->p, map @{$_->holes}, @{$self->surfaces} ], polygons => [ map $_->contour->p, @{$self->slices} ],
#); red_polygons => [ map $_->p, map @{$_->holes}, @{$self->slices} ],
);
}
} }
sub prepare_fill_surfaces { sub prepare_fill_surfaces {