From 78fa9ab2dd8ab117a512e0ae3ce9d8cb93dc89d4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 16 Dec 2019 15:27:13 +0100 Subject: [PATCH] Also check validity of polygon before using it Apparently this was going wrong with the libGeos version they are using with Python 3.8 (perhaps a newer version of Geos?) Fixes Ultimaker/Cura#6771. --- UM/Math/Polygon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UM/Math/Polygon.py b/UM/Math/Polygon.py index c7f3aef3dd..6ac599f9cd 100644 --- a/UM/Math/Polygon.py +++ b/UM/Math/Polygon.py @@ -183,7 +183,7 @@ def intersectsPolygon(self, other: "Polygon") -> Optional[Tuple[float, float]]: polygon_intersection = polygon_me.intersection(polygon_other) ret_size = None - if polygon_intersection: + if polygon_intersection and polygon_intersection.area > 0: ret_size = (polygon_intersection.bounds[2] - polygon_intersection.bounds[0], polygon_intersection.bounds[3] - polygon_intersection.bounds[1], )