diff --git a/pcbnew/drc/drc_test_provider_solder_mask.cpp b/pcbnew/drc/drc_test_provider_solder_mask.cpp index 5024317921..619d464cd0 100644 --- a/pcbnew/drc/drc_test_provider_solder_mask.cpp +++ b/pcbnew/drc/drc_test_provider_solder_mask.cpp @@ -441,7 +441,8 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems( BOARD_ITEM* aItem, con return false; } - if( pad && otherPad && pad->SameLogicalPadAs( otherPad ) ) + if( pad && otherPad && ( pad->SameLogicalPadAs( otherPad ) + || pad->SharesNetTieGroup( otherPad ) ) ) { return false; } diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index abd9ffcb35..885c207c7f 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -162,6 +162,23 @@ bool PAD::IsLocked() const }; +bool PAD::SharesNetTieGroup( const PAD* aOther ) const +{ + FOOTPRINT* parentFp = static_cast( GetParentFootprint() ); + + if( parentFp && parentFp->IsNetTie() && aOther->GetParentFootprint() == parentFp ) + { + std::map padToNetTieGroupMap = parentFp->MapPadNumbersToNetTieGroups(); + int thisNetTieGroup = padToNetTieGroupMap[ GetNumber() ]; + int otherNetTieGroup = padToNetTieGroupMap[ aOther->GetNumber() ]; + + return thisNetTieGroup >= 0 && thisNetTieGroup == otherNetTieGroup; + } + + return false; +} + + bool PAD::IsNoConnectPad() const { return GetShortNetname().StartsWith( wxT( "unconnected-(" ) ) diff --git a/pcbnew/pad.h b/pcbnew/pad.h index 838d568070..af6ada1b6a 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -155,13 +155,18 @@ public: * Before we had custom pad shapes it was common to have multiple overlapping pads to * represent a more complex shape. */ - bool SameLogicalPadAs( const PAD* other ) const + bool SameLogicalPadAs( const PAD* aOther ) const { // hide tricks behind sensible API - return GetParentFootprint() == other->GetParentFootprint() - && !m_number.IsEmpty() && m_number == other->m_number; + return GetParentFootprint() == aOther->GetParentFootprint() + && !m_number.IsEmpty() && m_number == aOther->m_number; } + /** + * @return true if this and \aOther represent a net-tie. + */ + bool SharesNetTieGroup( const PAD* aOther ) const; + /** * @return true if the pad is associated with an "unconnected" pin (or a no-connect symbol) * and has no net.