mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Use a more robust parallelism detection
This commit is contained in:
parent
fce669dea0
commit
0a88492fdc
5 changed files with 45 additions and 2 deletions
|
@ -111,6 +111,17 @@ Line::direction() const
|
|||
: atan2;
|
||||
}
|
||||
|
||||
bool
|
||||
Line::parallel_to(double angle) const {
|
||||
double diff = abs(this->direction() - angle);
|
||||
return (diff < EPSILON) || (abs(diff - PI) < EPSILON);
|
||||
}
|
||||
|
||||
bool
|
||||
Line::parallel_to(const Line &line) const {
|
||||
return this->parallel_to(line.direction());
|
||||
}
|
||||
|
||||
Vector
|
||||
Line::vector() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue