From f8d15a641ad04df48a67d032c7917f5ee22a31e4 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 7f54e79dca..9d195ea9b3 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -378,7 +378,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 ); @@ -397,7 +397,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 b2eb377a11..4095027667 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 66fe9ff2c7..d977fa5125 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -237,7 +237,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 )