From ca8a91b2b07d8ac2b197a7be05e3c88df3175122 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 14 Jun 2012 15:06:22 +0200 Subject: [PATCH] Only apply arc compensation to circular holes. #418 --- lib/Slic3r/Layer.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index c4df761f..c242e8dd 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -225,6 +225,11 @@ sub make_perimeters { foreach my $hole ($last_offsets[0]->holes) { my $circumference = abs($hole->length); next unless $circumference <= $Slic3r::small_perimeter_length; + # this compensation only works for circular holes, while it would + # overcompensate for hexagons and other shapes having straight edges. + # so we require a minimum number of vertices. + next unless $circumference / @$hole >= scale 3 * $Slic3r::flow->width; + # revert the compensation done in make_surfaces() and get the actual radius # of the hole my $radius = ($circumference / PI / 2) - scale $self->perimeters_flow->spacing/2;