mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-31 00:52:51 +00:00
Implement split_at_index() and split_at_first_point() in ExtrusionLoop too
This commit is contained in:
@@ -47,6 +47,8 @@ class ExtrusionLoop : public ExtrusionEntity
|
||||
{
|
||||
public:
|
||||
Polygon polygon;
|
||||
ExtrusionPath* split_at_index(int index);
|
||||
ExtrusionPath* split_at_first_point();
|
||||
};
|
||||
|
||||
void
|
||||
@@ -55,6 +57,27 @@ ExtrusionPath::reverse()
|
||||
this->polyline.reverse();
|
||||
}
|
||||
|
||||
ExtrusionPath*
|
||||
ExtrusionLoop::split_at_index(int index)
|
||||
{
|
||||
Polyline* poly = this->polygon.split_at_index(index);
|
||||
|
||||
ExtrusionPath* path = new ExtrusionPath();
|
||||
path->polyline = *poly;
|
||||
path->role = this->role;
|
||||
path->height = this->height;
|
||||
path->flow_spacing = this->flow_spacing;
|
||||
|
||||
delete poly;
|
||||
return path;
|
||||
}
|
||||
|
||||
ExtrusionPath*
|
||||
ExtrusionLoop::split_at_first_point()
|
||||
{
|
||||
return this->split_at_index(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user