mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 00:01:09 -06:00
Optimizations for better usage of XS code
This commit is contained in:
parent
9254ff9704
commit
5d6fd7f4d9
22 changed files with 68 additions and 42 deletions
|
@ -14,6 +14,12 @@ ExtrusionPath::first_point() const
|
|||
return &(this->polyline.points.front());
|
||||
}
|
||||
|
||||
const Point*
|
||||
ExtrusionPath::last_point() const
|
||||
{
|
||||
return &(this->polyline.points.back());
|
||||
}
|
||||
|
||||
ExtrusionPath*
|
||||
ExtrusionLoop::split_at_index(int index)
|
||||
{
|
||||
|
|
|
@ -39,6 +39,7 @@ class ExtrusionPath : public ExtrusionEntity
|
|||
Polyline polyline;
|
||||
void reverse();
|
||||
const Point* first_point() const;
|
||||
const Point* last_point() const;
|
||||
};
|
||||
|
||||
class ExtrusionLoop : public ExtrusionEntity
|
||||
|
|
|
@ -36,6 +36,12 @@ Line::length() const
|
|||
return this->a.distance_to(&(this->b));
|
||||
}
|
||||
|
||||
Point*
|
||||
Line::midpoint() const
|
||||
{
|
||||
return new Point ((this->a.x + this->b.x) / 2.0, (this->a.y + this->b.y) / 2.0);
|
||||
}
|
||||
|
||||
void
|
||||
Line::from_SV(SV* line_sv)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ class Line
|
|||
void rotate(double angle, Point* center);
|
||||
void reverse();
|
||||
double length() const;
|
||||
Point* midpoint() const;
|
||||
};
|
||||
|
||||
typedef std::vector<Line> Lines;
|
||||
|
|
|
@ -38,6 +38,12 @@ MultiPoint::first_point() const
|
|||
return &(this->points.front());
|
||||
}
|
||||
|
||||
const Point*
|
||||
MultiPoint::last_point() const
|
||||
{
|
||||
return &(this->points.back());
|
||||
}
|
||||
|
||||
void
|
||||
MultiPoint::from_SV(SV* poly_sv)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ class MultiPoint
|
|||
void rotate(double angle, Point* center);
|
||||
void reverse();
|
||||
const Point* first_point() const;
|
||||
const Point* last_point() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue