From c25211d29e6721df435c84bb17f630d93f4868ce Mon Sep 17 00:00:00 2001 From: tykkiman Date: Fri, 2 Dec 2022 23:40:36 +0200 Subject: [PATCH] Fix point list vs plane relative position check Situation where all points were on the plane wasn't handled. --- visilib/math_predicates.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/visilib/math_predicates.h b/visilib/math_predicates.h index 29b3909..b7e8578 100644 --- a/visilib/math_predicates.h +++ b/visilib/math_predicates.h @@ -222,7 +222,12 @@ namespace visilib } } - if (myRight == 0) + if (myRight == 0 && myLeft == 0 && points.size() > 0) + { + // Relative position is on the boundary if all points were on the plane. + return ON_BOUNDARY; + } + else if (myRight == 0) { V_ASSERT(myLeft > 0); return ON_NEGATIVE_SIDE;