From b14472e105234f020831af37b553120fa25e7aa7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 7 May 2025 13:28:10 +0100 Subject: [PATCH] Skip same-net-checking for hole-to-hole collisions. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20547 --- pcbnew/router/pns_item.cpp | 6 ++++-- pcbnew/router/pns_kicad_iface.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index 5cbaf70906..8e37c1cdc3 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -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 ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 5afbad257c..ecbf126279 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -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(); }