mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Refactoring: move direction math into a single function. Includes some fixes and adjustments
This commit is contained in:
parent
8240f71d07
commit
cb1527f7ef
9 changed files with 59 additions and 13 deletions
|
@ -34,7 +34,7 @@ sub is_straight {
|
|||
# first point and last point. (Checking each line against the previous
|
||||
# one would have caused the error to accumulate.)
|
||||
my $dir = Slic3r::Line->new($self->first_point, $self->last_point)->direction;
|
||||
return !defined first { abs($_->direction - $dir) > epsilon } @{$self->lines};
|
||||
return !defined first { !$_->parallel_to($dir) } @{$self->lines};
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue