mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Some more work on wireframe
This commit is contained in:
parent
c21a254480
commit
7253dc699a
7 changed files with 107 additions and 37 deletions
|
@ -161,10 +161,15 @@ Point::ccw(const Line &line) const
|
|||
}
|
||||
|
||||
// returns the CCW angle between this-p1 and this-p2
|
||||
// i.e. this assumes a CCW rotation from p1 to p2 around this
|
||||
double
|
||||
Point::ccw_angle(const Point &p1, const Point &p2) const
|
||||
{
|
||||
return Line(*this, p1).orientation() - Line(*this, p2).orientation();
|
||||
double angle = atan2(p1.x - this->x, p1.y - this->y)
|
||||
- atan2(p2.x - this->x, p2.y - this->y);
|
||||
|
||||
// we only want to return only positive angles
|
||||
return angle <= 0 ? angle + 2*PI : angle;
|
||||
}
|
||||
|
||||
Point
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue