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:
parent
e04c820442
commit
3450610977
|
@ -500,15 +500,18 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
||||||
bool testShorting = !m_drcEngine->IsErrorLimitExceeded( DRCE_SHORTING_ITEMS );
|
bool testShorting = !m_drcEngine->IsErrorLimitExceeded( DRCE_SHORTING_ITEMS );
|
||||||
bool testHoles = !m_drcEngine->IsErrorLimitExceeded( DRCE_HOLE_CLEARANCE );
|
bool testHoles = !m_drcEngine->IsErrorLimitExceeded( DRCE_HOLE_CLEARANCE );
|
||||||
|
|
||||||
FOOTPRINT* padParent = static_cast<FOOTPRINT*>( pad->GetParent() );
|
// Disable some tests *within* a single footprint
|
||||||
bool isNetTie = padParent->IsNetTie();
|
if( other->GetParent() == 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 )
|
|
||||||
{
|
{
|
||||||
testClearance = false;
|
FOOTPRINT* fp = static_cast<FOOTPRINT*>( pad->GetParent() );
|
||||||
|
|
||||||
|
// Graphic items are allowed to act as net-ties within their own footprint
|
||||||
|
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 ) )
|
if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) )
|
||||||
|
|
|
@ -236,7 +236,16 @@ public:
|
||||||
int GetFlag() const { return m_arflag; }
|
int GetFlag() const { return m_arflag; }
|
||||||
|
|
||||||
// A bit of a hack until net ties are supported as first class citizens
|
// 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;
|
void Move( const wxPoint& aMoveVector ) override;
|
||||||
|
|
||||||
|
|
|
@ -655,6 +655,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadComponentLibrary()
|
||||||
wxT( "" ) );
|
wxT( "" ) );
|
||||||
FOOTPRINT* footprint = new FOOTPRINT( m_board );
|
FOOTPRINT* footprint = new FOOTPRINT( m_board );
|
||||||
footprint->SetPosition( getKiCadPoint( component.Origin ) );
|
footprint->SetPosition( getKiCadPoint( component.Origin ) );
|
||||||
|
footprint->SetKeywords( wxT( "allow thermal pads" ) );
|
||||||
|
|
||||||
LIB_ID libID;
|
LIB_ID libID;
|
||||||
libID.Parse( fpName, true );
|
libID.Parse( fpName, true );
|
||||||
|
|
Loading…
Reference in New Issue