Use Douglas-Peucker simplification always and remove the inefficient parallel lines merging algorithm. #277
This commit is contained in:
parent
08efb15f4d
commit
ee33d570d7
3 changed files with 3 additions and 2 deletions
|
@ -81,6 +81,7 @@ our $infill_acceleration = 50; # mm/s^2
|
||||||
|
|
||||||
# accuracy options
|
# accuracy options
|
||||||
our $scaling_factor = 0.00000001;
|
our $scaling_factor = 0.00000001;
|
||||||
|
our $resolution = 0.01;
|
||||||
our $small_perimeter_area = ((6.5 / $scaling_factor)**2)*PI;
|
our $small_perimeter_area = ((6.5 / $scaling_factor)**2)*PI;
|
||||||
our $layer_height = 0.4;
|
our $layer_height = 0.4;
|
||||||
our $first_layer_height_ratio = 1;
|
our $first_layer_height_ratio = 1;
|
||||||
|
|
|
@ -112,7 +112,8 @@ sub make_surfaces {
|
||||||
{
|
{
|
||||||
# merge everything
|
# merge everything
|
||||||
my $expolygons = union_ex($loops);
|
my $expolygons = union_ex($loops);
|
||||||
|
$_->simplify(scale $Slic3r::resolution) for @$expolygons;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,6 @@ sub make_loops {
|
||||||
Slic3r::debugf " Discovered %s polygon of %d points\n",
|
Slic3r::debugf " Discovered %s polygon of %d points\n",
|
||||||
($polygons[-1]->is_counter_clockwise ? 'ccw' : 'cw'), scalar(@points)
|
($polygons[-1]->is_counter_clockwise ? 'ccw' : 'cw'), scalar(@points)
|
||||||
if $Slic3r::debug;
|
if $Slic3r::debug;
|
||||||
pop @polygons if !$polygons[-1]->cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [@polygons];
|
return [@polygons];
|
||||||
|
|
Loading…
Reference in a new issue