mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 11:41:20 -06:00
Get rid of the ExtrusionLoop objects in concentric filler
This commit is contained in:
parent
20e73face2
commit
cec7bf815c
5 changed files with 60 additions and 53 deletions
|
|
@ -119,4 +119,31 @@ sub is_valid {
|
|||
return @$self >= 3;
|
||||
}
|
||||
|
||||
sub split_at_index {
|
||||
my $self = shift;
|
||||
my ($index) = @_;
|
||||
|
||||
return (ref $self)->new(
|
||||
@$self[$index .. $#$self],
|
||||
@$self[0 .. $index],
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue