New seal_position option that replaces randomize_start, start_perimeters_at_concave_points and start_perimeters_at_non_overhang. The two latter options are now always on by default. A new "Aligned" seal position value has been added, that forces starting points to be aligned when not randomized. #1741 #925

This commit is contained in:
Alessandro Ranellucci 2014-05-22 19:34:49 +02:00
parent c63bd8165d
commit a3bd1b5302
17 changed files with 153 additions and 112 deletions

View file

@ -40,15 +40,34 @@ sub subdivide {
return Slic3r::Polygon->new(@new_points);
}
# for cw polygons this will return convex points!
# angle is checked on the internal side of the polygon
sub concave_points {
my $self = shift;
my ($self, $angle) = @_;
$angle //= PI;
my @points = @$self;
my @points_pp = @{$self->pp};
return map $points[$_],
grep Slic3r::Geometry::angle3points(@points_pp[$_, $_-1, $_+1]) < PI - epsilon,
-1 .. ($#points-1);
return [
map $points[$_],
grep Slic3r::Geometry::angle3points(@points_pp[$_, $_-1, $_+1]) < $angle,
-1 .. ($#points-1)
];
}
# angle is checked on the internal side of the polygon
sub convex_points {
my ($self, $angle) = @_;
$angle //= PI;
my @points = @$self;
my @points_pp = @{$self->pp};
return [
map $points[$_],
grep Slic3r::Geometry::angle3points(@points_pp[$_, $_-1, $_+1]) > $angle,
-1 .. ($#points-1)
];
}
1;