mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 17:58:03 -06:00
Ported Polygon->split_at()
This commit is contained in:
parent
f8ac3aa68f
commit
1f734807b9
7 changed files with 19 additions and 20 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue