From 4e6cd0d293b4ad28a77f7ad831fb46ccc75fc445 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 18 Mar 2024 15:51:04 -0700 Subject: [PATCH] Forward and reverse test for point in poly collisions --- libs/kimath/src/geometry/shape_collisions.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/kimath/src/geometry/shape_collisions.cpp b/libs/kimath/src/geometry/shape_collisions.cpp index c1a0b6612f..17aa2c723d 100644 --- a/libs/kimath/src/geometry/shape_collisions.cpp +++ b/libs/kimath/src/geometry/shape_collisions.cpp @@ -302,6 +302,11 @@ static inline bool Collide( const SHAPE_LINE_CHAIN_BASE& aA, const SHAPE_LINE_CH closest_dist = 0; nearest = aA.GetPoint( 0 ); } + else if( aA.IsClosed() && aB.GetPointCount() > 0 && aA.PointInside( aB.GetPoint( 0 ) ) ) + { + closest_dist = 0; + nearest = aB.GetPoint( 0 ); + } else { std::vector a_segs;