mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 23:23:59 -06:00
Ported Polygon->split_at()
This commit is contained in:
parent
f8ac3aa68f
commit
1f734807b9
7 changed files with 19 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue