mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Polygon->lines
This commit is contained in:
parent
77c479c127
commit
62e5bd0ee7
3 changed files with 25 additions and 2 deletions
|
@ -13,10 +13,24 @@ extern "C" {
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
class Polygon : public MultiPoint {};
|
||||
class Polygon : public MultiPoint {
|
||||
public:
|
||||
Lines lines();
|
||||
};
|
||||
|
||||
typedef std::vector<Polygon> Polygons;
|
||||
|
||||
Lines
|
||||
Polygon::lines()
|
||||
{
|
||||
Lines lines;
|
||||
for (int i = 0; i < this->points.size()-1; i++) {
|
||||
lines.push_back(Line(this->points[i], this->points[i+1]));
|
||||
}
|
||||
lines.push_back(Line(this->points.back(), this->points.front()));
|
||||
return lines;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue