From eef800b5c4215abc9226cebae5733227190d9fd8 Mon Sep 17 00:00:00 2001
From: Vojtech Bubnik <bubnikv@gmail.com>
Date: Fri, 22 Jan 2021 15:32:36 +0100
Subject: [PATCH] FIXME on ExPolygon::overlaps(), which should be commutative.

---
 src/libslic3r/ExPolygon.cpp                 | 4 ++--
 src/libslic3r/SLA/SupportPointGenerator.hpp | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/libslic3r/ExPolygon.cpp b/src/libslic3r/ExPolygon.cpp
index 02cc126a3..f698a3558 100644
--- a/src/libslic3r/ExPolygon.cpp
+++ b/src/libslic3r/ExPolygon.cpp
@@ -132,8 +132,7 @@ ExPolygon::has_boundary_point(const Point &point) const
     return false;
 }
 
-bool
-ExPolygon::overlaps(const ExPolygon &other) const
+bool ExPolygon::overlaps(const ExPolygon &other) const
 {
     #if 0
     BoundingBox bbox = get_extents(other);
@@ -150,6 +149,7 @@ ExPolygon::overlaps(const ExPolygon &other) const
     #endif
     if (! pl_out.empty())
         return true; 
+    //FIXME ExPolygon::overlaps() shall be commutative, it is not!
     return ! other.contour.points.empty() && this->contains_b(other.contour.points.front());
 }
 
diff --git a/src/libslic3r/SLA/SupportPointGenerator.hpp b/src/libslic3r/SLA/SupportPointGenerator.hpp
index ebb8cc373..d7588e3ba 100644
--- a/src/libslic3r/SLA/SupportPointGenerator.hpp
+++ b/src/libslic3r/SLA/SupportPointGenerator.hpp
@@ -84,6 +84,7 @@ public:
         float                                   overhangs_area = 0.f;
         
         bool overlaps(const Structure &rhs) const { 
+            //FIXME ExPolygon::overlaps() shall be commutative, it is not!
             return this->bbox.overlap(rhs.bbox) && (this->polygon->overlaps(*rhs.polygon) || rhs.polygon->overlaps(*this->polygon)); 
         }
         float overlap_area(const Structure &rhs) const {