mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Ported Polygon->is_valid() and ExPolygon->is_valid()
This commit is contained in:
parent
da0b85c0d9
commit
fe42427a54
13 changed files with 37 additions and 54 deletions
|
@ -40,6 +40,16 @@ ExPolygon::area() const
|
|||
return a;
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::is_valid() const
|
||||
{
|
||||
if (!this->contour.is_valid() || !this->contour.is_counter_clockwise()) return false;
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
if (!(*it).is_valid() || (*it).is_counter_clockwise()) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
SV*
|
||||
ExPolygon::to_SV() {
|
||||
const unsigned int num_holes = this->holes.size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue