mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
Bugfix: seam_position = aligned failed in certaim circumstances because of faulty concave points detection. Includes regression test
This commit is contained in:
parent
1674108bac
commit
5dcc1eab79
6 changed files with 54 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue