From 05912b0381b4c39e31d1bf2f20470943dd770dbb Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 22 Oct 2023 22:45:23 +0100 Subject: [PATCH] Check vias before holes as we assume any hole is non-pushable. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15840 (cherry picked from commit fb84f4592b8aae55466ede8151071bfbfe0a9439) --- pcbnew/router/pns_shove.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index f2a099239e..5a15fe1647 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -124,7 +124,15 @@ int SHOVE::getClearance( const ITEM* aA, const ITEM* aB ) const if( m_forceClearance >= 0 ) return m_forceClearance; - return m_currentNode->GetClearance( aA, aB, false ); + int clearance = m_currentNode->GetClearance( aA, aB, false ); + + if( aA->HasHole() ) + clearance = std::max( clearance, m_currentNode->GetClearance( aA->Hole(), aB, false ) ); + + if( aB->HasHole() ) + clearance = std::max( clearance, m_currentNode->GetClearance( aA, aB->Hole(), false ) ); + + return clearance; } @@ -1308,7 +1316,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter ) PNS_DBG( Dbg(), AddItem, ¤tLine, RED, currentLine.Width(), wxString::Format( wxT( "current-coll-chk rank %d" ), currentLine.Rank() ) ); - for( ITEM::PnsKind search_order : { ITEM::HOLE_T, ITEM::SOLID_T, ITEM::VIA_T, ITEM::SEGMENT_T } ) + for( ITEM::PnsKind search_order : { ITEM::SOLID_T, ITEM::VIA_T, ITEM::SEGMENT_T, ITEM::HOLE_T } ) { COLLISION_SEARCH_OPTIONS opts; opts.m_kindMask = search_order;