mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Promising approach to medial axis pruning
This commit is contained in:
parent
8644440070
commit
3c77b301a7
13 changed files with 126 additions and 326 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "Line.hpp"
|
||||
#include "Polyline.hpp"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -85,6 +86,21 @@ Line::distance_to(const Point* point) const
|
|||
return point->distance_to(this);
|
||||
}
|
||||
|
||||
double
|
||||
Line::atan2_() const
|
||||
{
|
||||
return atan2(this->b.y - this->a.y, this->b.x - this->a.x);
|
||||
}
|
||||
|
||||
double
|
||||
Line::direction() const
|
||||
{
|
||||
double atan2 = this->atan2_();
|
||||
return (atan2 == PI) ? 0
|
||||
: (atan2 < 0) ? (atan2 + PI)
|
||||
: atan2;
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
void
|
||||
Line::from_SV(SV* line_sv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue