Add ability to allow thermal vias to be implemented as pads.

This is mostly just for CADSTAR.  Since we don't (yet) have general
purpose footprint attributes, this reuses the "net tie" hack.

Fixes https://gitlab.com/kicad/code/kicad/issues/8141
This commit is contained in:
Jeff Young 2021-04-09 13:48:59 +01:00
parent e04c820442
commit 3450610977
3 changed files with 22 additions and 9 deletions

View File

@ -500,15 +500,18 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
bool testShorting = !m_drcEngine->IsErrorLimitExceeded( DRCE_SHORTING_ITEMS );
bool testHoles = !m_drcEngine->IsErrorLimitExceeded( DRCE_HOLE_CLEARANCE );
FOOTPRINT* padParent = static_cast<FOOTPRINT*>( pad->GetParent() );
bool isNetTie = padParent->IsNetTie();
// Disable some tests *within* a single footprint
if( other->GetParent() == pad->GetParent() )
{
FOOTPRINT* fp = static_cast<FOOTPRINT*>( pad->GetParent() );
// Graphic items are allowed to act as net-ties within their own footprint
if( isNetTie
&& ( other->Type() == PCB_FP_SHAPE_T || other->Type() == PCB_PAD_T )
&& other->GetParent() == padParent )
{
if( fp->IsNetTie() && ( other->Type() == PCB_FP_SHAPE_T || other->Type() == PCB_PAD_T ) )
testClearance = false;
// CADSTAR implements thermal vias using pads insteads of vias
if( fp->AllowThermalPads() && other->Type() == PCB_PAD_T )
testHoles = false;
}
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) )

View File

@ -236,7 +236,16 @@ public:
int GetFlag() const { return m_arflag; }
// A bit of a hack until net ties are supported as first class citizens
bool IsNetTie() const { return GetKeywords().StartsWith( wxT( "net tie" ) ); }
bool IsNetTie() const
{
return GetKeywords().StartsWith( wxT( "net tie" ) );
}
// Might as well keep all the hacks in the same place....
bool AllowThermalPads() const
{
return GetKeywords().StartsWith( wxT( "allow thermal pads" ) );
}
void Move( const wxPoint& aMoveVector ) override;

View File

@ -655,6 +655,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary()
wxT( "" ) );
FOOTPRINT* footprint = new FOOTPRINT( m_board );
footprint->SetPosition( getKiCadPoint( component.Origin ) );
footprint->SetKeywords( wxT( "allow thermal pads" ) );
LIB_ID libID;
libID.Parse( fpName, true );