From 92405661677c996a246e129c7012194a7f8efc4f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 6 Jun 2023 13:39:53 +0100 Subject: [PATCH] Support shape collisions between SHAPE_POLY_SET and other shapes. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14890 (cherry picked from commit 0f8c5a96b25ad4b73aaa855a15c80ecc644d2fa2) --- libs/kimath/src/geometry/shape_collisions.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libs/kimath/src/geometry/shape_collisions.cpp b/libs/kimath/src/geometry/shape_collisions.cpp index 033d6a380d..7cdeca32fb 100644 --- a/libs/kimath/src/geometry/shape_collisions.cpp +++ b/libs/kimath/src/geometry/shape_collisions.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include typedef VECTOR2I::extended_type ecoord; @@ -1085,6 +1086,20 @@ static bool collideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, int } } } + else if( aA->Type() == SH_POLY_SET ) + { + const SHAPE_POLY_SET* polySetA = static_cast( aA ); + + wxASSERT( !aMTV ); + return polySetA->Collide( aB, aClearance, aActual, aLocation ); + } + else if( aB->Type() == SH_POLY_SET ) + { + const SHAPE_POLY_SET* polySetB = static_cast( aB ); + + wxASSERT( !aMTV ); + return polySetB->Collide( aA, aClearance, aActual, aLocation ); + } else { return collideSingleShapes( aA, aB, aClearance, aActual, aLocation, aMTV );