mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Ported encloses_point() to XS and renamed to contains_point()
This commit is contained in:
parent
a225a8b2ef
commit
5f81292f3f
22 changed files with 81 additions and 76 deletions
|
@ -62,7 +62,7 @@ ExPolygon::is_valid() const
|
|||
}
|
||||
|
||||
bool
|
||||
ExPolygon::contains_line(Line* line) const
|
||||
ExPolygon::contains_line(const Line* line) const
|
||||
{
|
||||
Polylines pl(1);
|
||||
pl.push_back(*line);
|
||||
|
@ -72,6 +72,16 @@ ExPolygon::contains_line(Line* line) const
|
|||
return pl_out.empty();
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::contains_point(const Point* point) const
|
||||
{
|
||||
if (!this->contour.contains_point(point)) return false;
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
if (it->contains_point(point)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
ExPolygon::to_AV() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue