Ported Polygon->split_at()

This commit is contained in:
Alessandro Ranellucci 2013-08-26 22:39:35 +02:00
parent f8ac3aa68f
commit 1f734807b9
7 changed files with 19 additions and 20 deletions

View file

@ -96,23 +96,6 @@ sub is_valid {
return @$self >= 3;
}
sub split_at {
my $self = shift;
my ($point) = @_;
# find index of point
my $i = -1;
for (my $n = 0; $n <= $#$self; $n++) {
if (Slic3r::Geometry::same_point($point, $self->[$n])) {
$i = $n;
last;
}
}
die "Point not found" if $i == -1;
return $self->split_at_index($i);
}
# for cw polygons this will return convex points!
sub concave_points {
my $self = shift;