From 0595440d79d2acd5856a5f559cfb3ab185ca0193 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Mon, 9 Jan 2023 23:20:45 +0100 Subject: [PATCH] router: minor improvements in shove algorithm handling of vias --- pcbnew/router/pns_shove.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 03e7907c19..cad2e8f2ce 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -421,7 +421,11 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveObstacleLine( const LINE& aCurLine, const LINE& SHOVE_STATUS rv; bool viaOnEnd = aCurLine.EndsWithVia(); - if( viaOnEnd && ( !aCurLine.Via().LayersOverlap( &aObstacleLine ) || aCurLine.SegmentCount() == 0 ) ) + PNS_DBG( Dbg(), Message, wxString::Format( wxT( "shove process-single: voe1 %d voe2 %d" ), + aCurLine.EndsWithVia()?1:0, aObstacleLine.EndsWithVia()?1:0 ) ); + + + if( viaOnEnd && ( !aCurLine.LayersOverlap( &aObstacleLine ) || aCurLine.SegmentCount() == 0 ) ) { // Shove aObstacleLine to the hull of aCurLine's via. @@ -521,8 +525,8 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingSegment( LINE& aCurrent, SEGMENT* aObstacl if( Dbg() ) { PNS_DBG( Dbg(), AddItem, aObstacleSeg, BLUE, 0, wxT( "shove-changed-area" ) ); - PNS_DBG( Dbg(), AddItem, &aCurrent, RED, 10000, wxT( "current-line" ) ); - PNS_DBG( Dbg(), AddItem, &obstacleLine, GREEN, 10000, wxT( "obstacle-line" ) ); + PNS_DBG( Dbg(), AddItem, &aCurrent, RED, 10000, wxString::Format( "current-line [l %d v %d]", aCurrent.Layer(), aCurrent.EndsWithVia() ) ); + PNS_DBG( Dbg(), AddItem, &obstacleLine, GREEN, 10000, wxString::Format( "obstacle-line [l %d v %d]", obstacleLine.Layer(), obstacleLine.EndsWithVia() ) ); PNS_DBG( Dbg(), AddItem, &shovedLine, BLUE, 10000, wxT( "shoved-line" ) ); } @@ -1375,7 +1379,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter ) { PNS_DBG( Dbg(), BeginGroup, wxString::Format( "iter %d: reverse-collide-via", aIter ).ToStdString(), 0 ); - if( currentLine.EndsWithVia() ) + if( currentLine.EndsWithVia() && nearest->m_item->Collide( ¤tLine.Via(), m_currentNode ) ) { st = SH_INCOMPLETE; }