Bugfix: seam_position = aligned failed in certaim circumstances because of faulty concave points detection. Includes regression test

This commit is contained in:
Alessandro Ranellucci 2014-06-11 21:57:32 +02:00
parent 1674108bac
commit 5dcc1eab79
6 changed files with 54 additions and 3 deletions

View file

@ -59,11 +59,12 @@ sub concave_points {
my @concave = ();
for my $i (-1 .. ($#points-1)) {
next if $points[$i-1]->coincides_with($points[$i]);
next if $points[$i-1]->coincides_with_epsilon($points[$i]) || $points[$i+1]->coincides_with_epsilon($points[$i]);
# angle is measured in ccw orientation
my $vertex_angle = Slic3r::Geometry::angle3points(@points_pp[$i, $i-1, $i+1]);
if ($vertex_angle <= $ccw_angle) {
push @concave, $points[$i];
use XXX; YYY ($points[$i]->pp);
}
}
return [@concave];
@ -83,7 +84,7 @@ sub convex_points {
my @convex = ();
for my $i (-1 .. ($#points-1)) {
next if $points[$i-1]->coincides_with($points[$i]);
next if $points[$i-1]->coincides_with_epsilon($points[$i]) || $points[$i+1]->coincides_with_epsilon($points[$i]);
# angle is measured in ccw orientation
my $vertex_angle = Slic3r::Geometry::angle3points(@points_pp[$i, $i-1, $i+1]);
if ($vertex_angle >= $ccw_angle) {