From 19fef1e9bae7673a4d6bb913c98e0c9b1ce272ff Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 14 Feb 2017 14:40:34 +0100 Subject: [PATCH] Fixes: lp:1664349 (DRC complaining about not connected pads even if they are not on a copper layer) (happens when creating pads with complex shapes) https://bugs.launchpad.net/kicad/+bug/1664349 --- pcbnew/class_netinfolist.cpp | 4 ++++ pcbnew/connect.cpp | 2 ++ pcbnew/ratsnest.cpp | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pcbnew/class_netinfolist.cpp b/pcbnew/class_netinfolist.cpp index dbfe2d82c4..51ae6735e8 100644 --- a/pcbnew/class_netinfolist.cpp +++ b/pcbnew/class_netinfolist.cpp @@ -214,6 +214,10 @@ void NETINFO_LIST::buildListOfNets() if( pad->GetNetCode() == NETINFO_LIST::UNCONNECTED ) // pad not connected continue; + if( !( pad->GetLayerSet() & LSET::AllCuMask() ).any() ) + // pad not a copper layer (happens when building complex shapes) + continue; + // Add pad to the appropriate list of pads NETINFO_ITEM* net = pad->GetNet(); diff --git a/pcbnew/connect.cpp b/pcbnew/connect.cpp index 99e6eb953f..1b42fbd73b 100644 --- a/pcbnew/connect.cpp +++ b/pcbnew/connect.cpp @@ -96,6 +96,7 @@ void CONNECTIONS::SearchConnectionsPadsToIntersectingPads() if( !( pad->GetLayerSet() & candidate_pad->GetLayerSet() ).any() ) continue; + if( pad->HitTest( item->GetPoint() ) ) { pad->m_PadsConnected.push_back( candidate_pad ); @@ -227,6 +228,7 @@ void CONNECTIONS::BuildPadsCandidatesList() { m_candidates.clear(); m_candidates.reserve( m_sortedPads.size() ); + for( unsigned ii = 0; ii < m_sortedPads.size(); ii++ ) { D_PAD * pad = m_sortedPads[ii]; diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index fcd3be2236..f36a88524f 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -567,11 +567,15 @@ void PCB_BASE_FRAME::build_ratsnest_module( MODULE* aModule ) m_Pcb->m_LocalRatsnest.clear(); // collect active pads of the module: - for( pad_ref = aModule->Pads(); pad_ref; pad_ref = pad_ref->Next() ) + for( pad_ref = aModule->Pads(); pad_ref; pad_ref = pad_ref->Next() ) { if( pad_ref->GetNetCode() == NETINFO_LIST::UNCONNECTED ) continue; + if( !( pad_ref->GetLayerSet() & LSET::AllCuMask() ).any() ) + // pad not a copper layer (happens when building complex shapes) + continue; + localPadList.push_back( pad_ref ); pad_ref->SetSubRatsnest( 0 ); pad_ref->SetSubNet( 0 );