From c24832f72b2b636dd7cfb9dce29ef9133b5d3908 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 6 Mar 2025 12:44:13 -0800 Subject: [PATCH] Fix IsEffectiveLine calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We sometimes represent circles as 360° arcs. These are approximately colinear but are definitely not a line --- libs/kimath/src/geometry/shape_arc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/kimath/src/geometry/shape_arc.cpp b/libs/kimath/src/geometry/shape_arc.cpp index 8c5cadb161..ae3962b125 100644 --- a/libs/kimath/src/geometry/shape_arc.cpp +++ b/libs/kimath/src/geometry/shape_arc.cpp @@ -247,7 +247,7 @@ bool SHAPE_ARC::IsEffectiveLine() const SEG v1 = SEG( m_start, m_mid ); SEG v2 = SEG( m_mid, m_end ); - return v1.ApproxCollinear( v2 ); + return v1.ApproxCollinear( v2 ) && (v1.B - v1.A).Dot(v2.B - v2.A) > 0; }