mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Ported some minor methods to XS
This commit is contained in:
@@ -209,6 +209,19 @@ Polygon::centroid() const
|
||||
return Point(x_temp/(6*area_temp), y_temp/(6*area_temp));
|
||||
}
|
||||
|
||||
std::string
|
||||
Polygon::wkt() const
|
||||
{
|
||||
std::ostringstream wkt;
|
||||
wkt << "POLYGON((";
|
||||
for (Points::const_iterator p = this->points.begin(); p != this->points.end(); ++p) {
|
||||
wkt << p->x << " " << p->y;
|
||||
if (p != this->points.end()-1) wkt << ",";
|
||||
}
|
||||
wkt << "))";
|
||||
return wkt.str();
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
REGISTER_CLASS(Polygon, "Polygon");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user