mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 20:51:23 -07:00
Bugfix: seam_position = aligned/nearest didn't work correctly for hi-res models. #2156
Conflicts: lib/Slic3r/GCode.pm
This commit is contained in:
parent
06d700989f
commit
d68192749f
2 changed files with 33 additions and 18 deletions
|
|
@ -7,7 +7,7 @@ use parent 'Slic3r::Polyline';
|
|||
|
||||
use Slic3r::Geometry qw(
|
||||
polygon_segment_having_point
|
||||
PI X1 X2 Y1 Y2 epsilon);
|
||||
PI X1 X2 Y1 Y2 epsilon scaled_epsilon);
|
||||
use Slic3r::Geometry::Clipper qw(intersection_pl);
|
||||
|
||||
sub wkt {
|
||||
|
|
@ -54,18 +54,18 @@ sub concave_points {
|
|||
# but angle3points measures CCW angle, so we calculate the complementary angle
|
||||
my $ccw_angle = 2*PI-$angle;
|
||||
|
||||
my @concave = ();
|
||||
my @points = @$self;
|
||||
my @points_pp = @{$self->pp};
|
||||
|
||||
my @concave = ();
|
||||
|
||||
for my $i (-1 .. ($#points-1)) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
return [@concave];
|
||||
}
|
||||
|
||||
|
|
@ -78,12 +78,11 @@ sub convex_points {
|
|||
# but angle3points measures CCW angle, so we calculate the complementary angle
|
||||
my $ccw_angle = 2*PI-$angle;
|
||||
|
||||
my @convex = ();
|
||||
my @points = @$self;
|
||||
my @points_pp = @{$self->pp};
|
||||
|
||||
my @convex = ();
|
||||
for my $i (-1 .. ($#points-1)) {
|
||||
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