mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Ported intersect_expolygons() and subtract_expolygons() to XS
This commit is contained in:
parent
5f81292f3f
commit
761f261a68
11 changed files with 95 additions and 29 deletions
|
@ -2,6 +2,18 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
ExPolygonCollection::operator Polygons() const
|
||||
{
|
||||
Polygons polygons;
|
||||
for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
|
||||
polygons.push_back(it->contour);
|
||||
for (Polygons::const_iterator ith = it->holes.begin(); ith != it->holes.end(); ++ith) {
|
||||
polygons.push_back(*ith);
|
||||
}
|
||||
}
|
||||
return polygons;
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygonCollection::scale(double factor)
|
||||
{
|
||||
|
@ -26,4 +38,13 @@ ExPolygonCollection::rotate(double angle, Point* center)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygonCollection::contains_point(const Point* point) const
|
||||
{
|
||||
for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
|
||||
if (it->contains_point(point)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue