mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Ported ExPolygon->area()
This commit is contained in:
parent
792fcba7be
commit
706851f836
7 changed files with 19 additions and 12 deletions
|
@ -30,6 +30,16 @@ ExPolygon::rotate(double angle, Point* center)
|
|||
}
|
||||
}
|
||||
|
||||
double
|
||||
ExPolygon::area() const
|
||||
{
|
||||
double a = this->contour.area();
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
a -= -(*it).area(); // holes have negative area
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
SV*
|
||||
ExPolygon::to_SV() {
|
||||
const unsigned int num_holes = this->holes.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue