Support shape collisions between SHAPE_POLY_SET and other shapes.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14890
This commit is contained in:
Jeff Young 2023-06-06 13:39:53 +01:00
parent 9fe00bb808
commit 0f8c5a96b2
1 changed files with 15 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include <geometry/shape_rect.h> #include <geometry/shape_rect.h>
#include <geometry/shape_segment.h> #include <geometry/shape_segment.h>
#include <geometry/shape_compound.h> #include <geometry/shape_compound.h>
#include <geometry/shape_poly_set.h>
#include <math/vector2d.h> #include <math/vector2d.h>
typedef VECTOR2I::extended_type ecoord; 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<const SHAPE_POLY_SET*>( aA );
wxASSERT( !aMTV );
return polySetA->Collide( aB, aClearance, aActual, aLocation );
}
else if( aB->Type() == SH_POLY_SET )
{
const SHAPE_POLY_SET* polySetB = static_cast<const SHAPE_POLY_SET*>( aB );
wxASSERT( !aMTV );
return polySetB->Collide( aA, aClearance, aActual, aLocation );
}
else else
{ {
return collideSingleShapes( aA, aB, aClearance, aActual, aLocation, aMTV ); return collideSingleShapes( aA, aB, aClearance, aActual, aLocation, aMTV );