From fad4c135fac661d534f2e79dfe02c7fbe8813b24 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 20 Feb 2022 20:44:32 +0000 Subject: [PATCH] Use only a physical connection to determine flashing of pads. Checking for proper nets just confuses things when the nets are set wrongly for some reason. This way we generate clearer DRC errors. Fixes https://gitlab.com/kicad/code/kicad/issues/10645 --- pcbnew/connectivity/connectivity_data.cpp | 4 ++-- pcbnew/connectivity/connectivity_data.h | 3 ++- pcbnew/pad.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index 6eb1aa7f35..9883df2fb5 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -388,7 +388,7 @@ void CONNECTIVITY_DATA::PropagateNets( BOARD_COMMIT* aCommit, PROPAGATE_MODE aMo bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, int aLayer, - std::vector aTypes ) const + std::vector aTypes, bool aIgnoreNets ) const { CN_CONNECTIVITY_ALGO::ITEM_MAP_ENTRY &entry = m_connAlgo->ItemEntry( aItem ); @@ -407,7 +407,7 @@ bool CONNECTIVITY_DATA::IsConnectedOnLayer( const BOARD_CONNECTED_ITEM *aItem, i { if( connected->Valid() && connected->Layers().Overlaps( aLayer ) - && connected->Net() == aItem->GetNetCode() + && ( connected->Net() == aItem->GetNetCode() || aIgnoreNets ) && matchType( connected->Parent()->Type() ) ) { return true; diff --git a/pcbnew/connectivity/connectivity_data.h b/pcbnew/connectivity/connectivity_data.h index 85f8629e87..ace8ea6baf 100644 --- a/pcbnew/connectivity/connectivity_data.h +++ b/pcbnew/connectivity/connectivity_data.h @@ -201,7 +201,8 @@ public: unsigned int GetUnconnectedCount() const; bool IsConnectedOnLayer( const BOARD_CONNECTED_ITEM* aItem, - int aLayer, std::vector aTypes = {} ) const; + int aLayer, std::vector aTypes = {}, + bool aIgnoreNets = false ) const; unsigned int GetNodeCount( int aNet = -1 ) const; diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index c7075a5edf..030a7b2586 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -257,7 +257,7 @@ bool PAD::FlashLayer( int aLayer ) const return board && board->GetConnectivity()->IsConnectedOnLayer( this, static_cast( aLayer ), - types ); + types, true ); case PAD_ATTRIB::NPTH: if( GetShape() == PAD_SHAPE::CIRCLE && GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )