mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-31 00:52:51 +00:00
Polygon->lines
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user