mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -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
|
@ -1,3 +1,4 @@
|
|||
#include "Geometry.hpp"
|
||||
#include "Line.hpp"
|
||||
#include "Polyline.hpp"
|
||||
#include <algorithm>
|
||||
|
@ -113,8 +114,7 @@ Line::direction() const
|
|||
|
||||
bool
|
||||
Line::parallel_to(double angle) const {
|
||||
double diff = abs(this->direction() - angle);
|
||||
return (diff < EPSILON) || (abs(diff - PI) < EPSILON);
|
||||
return Slic3r::Geometry::directions_parallel(this->direction(), angle);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue