Bugfix: fatal error in arc detection code. #133

This commit is contained in:
Alessandro Ranellucci 2011-12-25 13:01:48 +01:00
parent a86bc260e7
commit 342823fdf3
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@ package Slic3r;
use strict;
use warnings;
our $VERSION = "0.5.7";
our $VERSION = "0.5.8-beta";
our $debug = 0;
sub debugf {

View file

@ -98,7 +98,7 @@ sub detect_arcs {
# we require at least 3 consecutive segments to form an arc
CYCLE: while (@points >= 4) {
for (my $i = 0; $i <= $#points - 3; $i++) {
POINT: for (my $i = 0; $i <= $#points - 3; $i++) {
my $s1 = Slic3r::Line->new($points[$i], $points[$i+1]);
my $s2 = Slic3r::Line->new($points[$i+1], $points[$i+2]);
my $s3 = Slic3r::Line->new($points[$i+2], $points[$i+3]);
@ -162,7 +162,7 @@ sub detect_arcs {
my $rotation_angle = PI/2 * ($orientation eq 'ccw' ? -1 : 1);
my $ray1 = Slic3r::Line->new($s1_mid, rotate_points($rotation_angle, $s1_mid, $points[$i+1]));
my $last_ray = Slic3r::Line->new($last_mid, rotate_points($rotation_angle, $last_mid, $points[$last_j]));
$arc_center = $ray1->intersection($last_ray, 0);
$arc_center = $ray1->intersection($last_ray, 0) or next POINT;
}
my $arc = Slic3r::ExtrusionPath::Arc->new(