mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Ported some minor methods to XS
This commit is contained in:
parent
379cde30e2
commit
28466750e6
9 changed files with 58 additions and 42 deletions
|
@ -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");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue