mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Implement split_at_index() and split_at_first_point() in ExtrusionLoop too
This commit is contained in:
parent
0d07a2e4e6
commit
339ba9e5c3
4 changed files with 38 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue