From b7465e935eceace3130e6d806026d6e7e709f002 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 20 Feb 2019 12:28:57 +0100 Subject: [PATCH] Fixed a missing include problem in SLASupportAuto.hpp --- src/libslic3r/SLA/SLAAutoSupports.cpp | 12 ++++++++++++ src/libslic3r/SLA/SLAAutoSupports.hpp | 10 +--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/SLA/SLAAutoSupports.cpp b/src/libslic3r/SLA/SLAAutoSupports.cpp index 1f6dcc2b7..aca84dbd8 100644 --- a/src/libslic3r/SLA/SLAAutoSupports.cpp +++ b/src/libslic3r/SLA/SLAAutoSupports.cpp @@ -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& structures) { diff --git a/src/libslic3r/SLA/SLAAutoSupports.hpp b/src/libslic3r/SLA/SLAAutoSupports.hpp index b552d1c0b..27f595a74 100644 --- a/src/libslic3r/SLA/SLAAutoSupports.hpp +++ b/src/libslic3r/SLA/SLAAutoSupports.hpp @@ -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)