diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 7ab466f27..554028496 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -82,7 +82,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 $small_perimeter_length = (6.5 / $scaling_factor)*2*PI; our $layer_height = 0.4; our $first_layer_height_ratio = 1; our $infill_every_layers = 1; diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index a35d99184..6002b5e73 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -194,9 +194,9 @@ sub make_perimeters { # experimental hole compensation (see ArcCompensation in the RepRap wiki) foreach my $hole ($last_offsets[0]->holes) { - my $area = abs($hole->area); - next unless $area <= $Slic3r::small_perimeter_area; - my $radius = sqrt($area / PI); + my $circumference = abs($hole->length); + next unless $circumference <= $Slic3r::small_perimeter_length; + my $radius = ($circumference / PI / 2); my $new_radius = (scale($Slic3r::flow_width) + sqrt((scale($Slic3r::flow_width)**2) + (4*($radius**2)))) / 2; # holes are always turned to contours, so reverse point order before and after $hole->reverse; @@ -294,7 +294,7 @@ sub make_perimeters { # detect small perimeters by checking their area for (@{ $self->perimeters }) { - $_->role('small-perimeter') if abs($_->polygon->area) < $Slic3r::small_perimeter_area; + $_->role('small-perimeter') if abs($_->polygon->length) <= $Slic3r::small_perimeter_length; } # add thin walls as perimeters