Fixed a missing include problem in SLASupportAuto.hpp

This commit is contained in:
Lukas Matena 2019-02-20 12:28:57 +01:00
parent 2759c87e5b
commit b7465e935e
2 changed files with 13 additions and 9 deletions

View File

@ -499,6 +499,18 @@ void SLAAutoSupports::uniformly_cover(const ExPolygons& islands, Structure& stru
}
}
float SLAAutoSupports::Structure::overlap_area(const Structure &rhs) const
{
double out = 0.;
if (this->bbox.overlap(rhs.bbox)) {
Polygons polys = intersection(to_polygons(*this->polygon), to_polygons(*rhs.polygon), false);
for (const Polygon &poly : polys)
out += poly.area();
}
return float(out);
}
#ifdef SLA_AUTOSUPPORTS_DEBUG
void SLAAutoSupports::output_structures(const std::vector<Structure>& structures)
{

View File

@ -71,15 +71,7 @@ public:
bool overlaps(const Structure &rhs) const {
return this->bbox.overlap(rhs.bbox) && (this->polygon->overlaps(*rhs.polygon) || rhs.polygon->overlaps(*this->polygon));
}
float overlap_area(const Structure &rhs) const {
double out = 0.;
if (this->bbox.overlap(rhs.bbox)) {
Polygons polys = intersection(to_polygons(*this->polygon), to_polygons(*rhs.polygon), false);
for (const Polygon &poly : polys)
out += poly.area();
}
return float(out);
}
float overlap_area(const Structure &rhs) const;
float area_below() const {
float area = 0.f;
for (const Link &below : this->islands_below)