From 8382eeef0a1a18ff728a49019ce24ab5e631dadc Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 12 Sep 2012 15:58:01 +0200 Subject: [PATCH] Revert "Patch for --gcode-arcs (kindly submitted by Paul Howes)" This reverts commit f4260ae93d25df113cbbb9c1995c508c44587d56. --- lib/Slic3r/ExtrusionPath.pm | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/Slic3r/ExtrusionPath.pm b/lib/Slic3r/ExtrusionPath.pm index 224cdf4be..a006d8712 100644 --- a/lib/Slic3r/ExtrusionPath.pm +++ b/lib/Slic3r/ExtrusionPath.pm @@ -187,14 +187,10 @@ sub detect_arcs { my $s2_angle = $s2->atan; my $s3_angle = $s3->atan; $s1_angle += 2*PI if $s1_angle < 0; + $s2_angle += 2*PI if $s2_angle < 0; + $s3_angle += 2*PI if $s3_angle < 0; my $s1s2_angle = $s2_angle - $s1_angle; my $s2s3_angle = $s3_angle - $s2_angle; - # allow -ve angles but constrain angles differences to 0 2*PI); - $s1s2_angle += 2*PI if ($s1s2_angle < -2*PI); - $s2s3_angle -= 2*PI if ($s2s3_angle > 2*PI); - $s2s3_angle += 2*PI if ($s2s3_angle < -2*PI); - next if abs($s1s2_angle - $s2s3_angle) > $Slic3r::Geometry::parallel_degrees_limit; next if abs($s1s2_angle) < $Slic3r::Geometry::parallel_degrees_limit; # ignore parallel lines next if $s1s2_angle > $max_angle; # ignore too sharp vertices @@ -207,15 +203,10 @@ sub detect_arcs { my $line = Slic3r::Line->new($points[$j], $points[$j+1]); last if abs($line->length - $s1_len) > $len_epsilon; my $line_angle = $line->atan; + $line_angle += 2*PI if $line_angle < 0; my $anglediff = $line_angle - $last_line_angle; - # allow -ve angles but constrain angle differences to 0 2*PI); - $anglediff += 2*PI if ($anglediff < -2*PI); - last if abs($s1s2_angle - $anglediff) > $Slic3r::Geometry::parallel_degrees_limit; - # Do not try to be too ambitious. Just detect arcs up to 60 degrees. - # The algorithm for finding the center is not accurate enough for more than this - last if abs($s1_angle - $line_angle) > PI/6; + # point $j+1 belongs to the arc $arc_points[-1] = $points[$j+1]; $last_j = $j+1;