mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
Ported Polygon->split_at()
This commit is contained in:
@@ -23,6 +23,18 @@ Polygon::lines()
|
||||
return lines;
|
||||
}
|
||||
|
||||
Polyline*
|
||||
Polygon::split_at(const Point* point)
|
||||
{
|
||||
// find index of point
|
||||
for (Points::const_iterator it = this->points.begin(); it != this->points.end(); ++it) {
|
||||
if ((*it).coincides_with(point)) {
|
||||
return this->split_at_index(it - this->points.begin());
|
||||
}
|
||||
}
|
||||
throw "Point not found";
|
||||
}
|
||||
|
||||
Polyline*
|
||||
Polygon::split_at_index(int index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user