Use perimeter length, not area, to detect small perimeters. #355
This commit is contained in:
parent
f1905256f8
commit
4bffa9cb6b
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user