diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index be105ed10..2cbe4437c 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -57,7 +57,8 @@ use Slic3r::TriangleMesh; eval "use Slic3r::Build"; use constant SCALING_FACTOR => 0.000001; -use constant RESOLUTION => 0.01; +use constant RESOLUTION => 0.0125; +use constant SCALED_RESOLUTION => RESOLUTION / SCALING_FACTOR; use constant OVERLAP_FACTOR => 1; use constant SMALL_PERIMETER_LENGTH => (6.5 / SCALING_FACTOR) * 2 * PI; use constant LOOP_CLIPPING_LENGTH_OVER_SPACING => 0.15; diff --git a/lib/Slic3r/ExtrusionPath.pm b/lib/Slic3r/ExtrusionPath.pm index bae6e61cd..d392b5c40 100644 --- a/lib/Slic3r/ExtrusionPath.pm +++ b/lib/Slic3r/ExtrusionPath.pm @@ -15,7 +15,7 @@ use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points); has 'polyline' => ( is => 'rw', required => 1, - handles => [qw(merge_continuous_lines lines length reverse clip_end)], + handles => [qw(merge_continuous_lines lines length reverse clip_end simplify)], ); # height is the vertical thickness of the extrusion expressed in mm diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index f725ee79d..2b3f384a2 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -119,6 +119,7 @@ sub extrude_path { my ($path, $description, $recursive) = @_; $path = $path->unpack if $path->isa('Slic3r::ExtrusionPath::Packed'); + $path->simplify(&Slic3r::SCALED_RESOLUTION); # detect arcs if ($Slic3r::Config->gcode_arcs && !$recursive) { diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index e940d9ec8..3e4854ea1 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -228,7 +228,7 @@ sub make_perimeters { # create one more offset to be used as boundary for fill { my @fill_boundaries = map $_->offset_ex(-$distance), @last_offsets; - $_->simplify(scale &Slic3r::RESOLUTION) for @fill_boundaries; + $_->simplify(&Slic3r::SCALED_RESOLUTION) for @fill_boundaries; push @{ $self->surfaces }, @fill_boundaries; } diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 84140e9ee..1b41ccdbf 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -341,7 +341,7 @@ sub export_gcode { # simplify slices (both layer and region slices), # we only need the max resolution for perimeters foreach my $layer (map @{$_->layers}, @{$self->objects}) { - $_->simplify(scale &Slic3r::RESOLUTION) + $_->simplify(&Slic3r::SCALED_RESOLUTION) for @{$layer->slices}, (map $_->expolygon, map @{$_->slices}, @{$layer->regions}); }