mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-19 10:09:07 -07:00
Incomplete work for porting simplify() to XS
This commit is contained in:
@@ -76,12 +76,18 @@ Point::distance_to(const Point* point) const
|
||||
double
|
||||
Point::distance_to(const Line* line) const
|
||||
{
|
||||
if (line->a.coincides_with(&line->b)) return this->distance_to(&line->a);
|
||||
return this->distance_to(*line);
|
||||
}
|
||||
|
||||
double
|
||||
Point::distance_to(const Line &line) const
|
||||
{
|
||||
if (line.a.coincides_with(&line.b)) return this->distance_to(&line.a);
|
||||
|
||||
double n = (line->b.x - line->a.x) * (line->a.y - this->y)
|
||||
- (line->a.x - this->x) * (line->b.y - line->a.y);
|
||||
double n = (line.b.x - line.a.x) * (line.a.y - this->y)
|
||||
- (line.a.x - this->x) * (line.b.y - line.a.y);
|
||||
|
||||
return abs(n) / line->length();
|
||||
return abs(n) / line.length();
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
|
||||
Reference in New Issue
Block a user