mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Ported encloses_point() to XS and renamed to contains_point()
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user