Skip same-net-checking for hole-to-hole collisions.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20547
This commit is contained in:
Jeff Young 2025-05-07 13:28:10 +01:00
parent c519a6b827
commit b14472e105
2 changed files with 12 additions and 5 deletions

View File

@ -152,9 +152,11 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, int aLayer,
// And a special case for the "head" via's hole.
if( aHead->HasHole() && shouldWeConsiderHoleCollisions( this, holeH ) )
{
if( Net() != holeH->Net() && collideSimple( holeH, aNode, aLayer, aCtx ) )
collisionsFound = true;
// Skip net check when doing hole-to-hole collisions.
if( Kind() == HOLE_T || Net() != holeH->Net() )
collisionsFound |= collideSimple( holeH, aNode, aLayer, aCtx );
}
if( HasHole() && shouldWeConsiderHoleCollisions( holeI, aHead ) )
{
collisionsFound |= holeI->collideSimple( aHead, aNode, aLayer, aCtx );

View File

@ -306,10 +306,15 @@ static bool isEdge( const PNS::ITEM* aItem )
bool PNS_PCBNEW_RULE_RESOLVER::IsDrilledHole( const PNS::ITEM* aItem )
{
if( isHole( aItem ) && aItem->Parent() )
return aItem->Parent()->HasDrilledHole();
if( !isHole( aItem ) )
return false;
return false;
BOARD_ITEM* parent = aItem->Parent();
if( !parent && aItem->ParentPadVia() )
parent = aItem->ParentPadVia()->Parent();
return parent && parent->HasDrilledHole();
}