diff --git a/pcbnew/router/pns_hole.h b/pcbnew/router/pns_hole.h index a72b7a52c6..91c8bf6582 100644 --- a/pcbnew/router/pns_hole.h +++ b/pcbnew/router/pns_hole.h @@ -63,7 +63,13 @@ public: BOARD_ITEM* Parent() const override { - return m_parentPadVia ? m_parentPadVia->Parent() : nullptr; + if( m_parent ) + return m_parent; + + if( m_parentPadVia ) + return m_parentPadVia->Parent(); + + return nullptr; } void SetCenter( const VECTOR2I& aCenter ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index ee9d50821b..cf3f5fac6e 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -129,8 +129,6 @@ public: void ClearCaches() override; private: - int holeRadius( const PNS::ITEM* aItem ) const; - /** * Checks for netnamed differential pairs. * This accepts nets named suffixed by 'P', 'N', '+', '-', as well as additional @@ -174,27 +172,6 @@ PNS_PCBNEW_RULE_RESOLVER::~PNS_PCBNEW_RULE_RESOLVER() } -int PNS_PCBNEW_RULE_RESOLVER::holeRadius( const PNS::ITEM* aItem ) const -{ - if( aItem->Kind() == PNS::ITEM::SOLID_T ) - { - const PAD* pad = dynamic_cast( aItem->Parent() ); - - if( pad && pad->GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE ) - return pad->GetDrillSize().x / 2; - } - else if( aItem->Kind() == PNS::ITEM::VIA_T ) - { - const PCB_VIA* via = dynamic_cast( aItem->Parent() ); - - if( via ) - return via->GetDrillValue() / 2; - } - - return 0; -} - - bool PNS_PCBNEW_RULE_RESOLVER::IsDiffPair( const PNS::ITEM* aA, const PNS::ITEM* aB ) { int net_p, net_n; diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index ce55398e5b..591ba3b826 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -1573,13 +1573,15 @@ ITEM *NODE::FindItemByParent( const BOARD_ITEM* aParent ) if( aParent->IsConnected() ) { const BOARD_CONNECTED_ITEM* cItem = static_cast( aParent ); - - INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( cItem->GetNetCode() ); + INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( cItem->GetNetCode() ); if( l_cur ) { for( ITEM* item : *l_cur ) { + if( item->OfKind( PNS::ITEM::HOLE_T ) && static_cast( item )->ParentPadVia() ) + continue; + if( item->Parent() == aParent ) return item; }