From c2deb497e8c3c550fe59f6b7a4578ef07b2b2f1e Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Thu, 11 Jan 2024 12:50:39 +0100 Subject: [PATCH] Fix Polygon unit test CURA-11395 --- src/utils/polygon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/polygon.cpp b/src/utils/polygon.cpp index 57d2db1810..7784e6555c 100644 --- a/src/utils/polygon.cpp +++ b/src/utils/polygon.cpp @@ -127,7 +127,7 @@ void Polygons::makeConvex() if (LinearAlg2D::pointIsLeftOfLine(current, convexified.path->back(), after) < 0) { // Track backwards to make sure we haven't been in a concave pocket for multiple vertices already. - while (convexified.size() >= 2 && LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], current) > 0) + while (convexified.size() >= 2 && (LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], current) >= 0 || LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], convexified.path->front()) > 0)) { convexified.path->pop_back(); }