mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-31 09:02:53 +00:00
Optimizations for better usage of XS code
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user