Use Douglas-Peucker simplification always and remove the inefficient parallel lines merging algorithm. #277

This commit is contained in:
Alessandro Ranellucci 2012-05-01 11:41:08 +02:00
parent 08efb15f4d
commit ee33d570d7
3 changed files with 3 additions and 2 deletions

View File

@ -81,6 +81,7 @@ our $infill_acceleration = 50; # mm/s^2
# accuracy options
our $scaling_factor = 0.00000001;
our $resolution = 0.01;
our $small_perimeter_area = ((6.5 / $scaling_factor)**2)*PI;
our $layer_height = 0.4;
our $first_layer_height_ratio = 1;

View File

@ -112,6 +112,7 @@ sub make_surfaces {
{
# merge everything
my $expolygons = union_ex($loops);
$_->simplify(scale $Slic3r::resolution) for @$expolygons;
Slic3r::debugf " %d surface(s) having %d holes detected from %d polylines\n",
scalar(@$expolygons), scalar(map $_->holes, @$expolygons), scalar(@$loops);

View File

@ -267,7 +267,6 @@ sub make_loops {
Slic3r::debugf " Discovered %s polygon of %d points\n",
($polygons[-1]->is_counter_clockwise ? 'ccw' : 'cw'), scalar(@points)
if $Slic3r::debug;
pop @polygons if !$polygons[-1]->cleanup;
}
return [@polygons];