mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-19 16:19:07 -07:00
Promising approach to medial axis pruning
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user