Special-case net-ties for solder mask bridging.

Fixes https://gitlab.com/kicad/code/kicad/issues/13646
This commit is contained in:
Jeff Young 2023-01-24 11:32:32 +00:00
parent b0ec006b81
commit 00e2bbac5a
3 changed files with 27 additions and 4 deletions

View File

@ -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;
}

View File

@ -162,6 +162,23 @@ bool PAD::IsLocked() const
};
bool PAD::SharesNetTieGroup( const PAD* aOther ) const
{
FOOTPRINT* parentFp = static_cast<FOOTPRINT*>( GetParentFootprint() );
if( parentFp && parentFp->IsNetTie() && aOther->GetParentFootprint() == parentFp )
{
std::map<wxString, int> 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-(" ) )

View File

@ -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.