Pad with hole same size or larger than pad isn't flashed.

... even if it's marked as being on copper layers.

Also changes the default hole clearance to 0.25mm.

Fixes https://gitlab.com/kicad/code/kicad/issues/9901
This commit is contained in:
Jeff Young 2021-12-08 23:12:33 +00:00
parent df1e74d418
commit 1f9e75f676
2 changed files with 59 additions and 23 deletions

View File

@ -85,7 +85,7 @@
#define DEFAULT_MICROVIASMINSIZE 0.2 // micro vias (not vias) min diameter
#define DEFAULT_MICROVIASMINDRILL 0.1 // micro vias (not vias) min drill diameter
#define DEFAULT_HOLETOHOLEMIN 0.25 // minimum web thickness between two drilled holes
#define DEFAULT_HOLECLEARANCE 0.0 // copper-to-hole clearance
#define DEFAULT_HOLECLEARANCE 0.25 // copper-to-hole clearance (from IPC level A)
#define DEFAULT_COPPEREDGECLEARANCE 0.01 // clearance between copper items and edge cuts
#define LEGACY_COPPEREDGECLEARANCE -0.01 // A flag to indicate the legacy method (based

View File

@ -50,6 +50,7 @@
#include <wx/log.h>
#include <memory>
#include <macros.h>
using KIGFX::PCB_PAINTER;
using KIGFX::PCB_RENDER_SETTINGS;
@ -214,32 +215,55 @@ bool PAD::FlashLayer( int aLayer ) const
std::vector<KICAD_T> types
{ PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, PCB_ZONE_T, PCB_FP_ZONE_T };
// Return the "normal" shape if the caller doesn't specify a particular layer
if( aLayer == UNDEFINED_LAYER )
return true;
const BOARD* board = GetBoard();
if( !board )
return false;
switch( GetAttribute() )
{
case PAD_ATTRIB::PTH:
if( aLayer == UNDEFINED_LAYER )
return true;
/// Heat sink pads always get copper
if( GetProperty() == PAD_PROP::HEATSINK )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
if( !m_removeUnconnectedLayer )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
// Plated through hole pads need copper on the top/bottom layers for proper soldering
// Unless the user has removed them in the pad dialog
if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
return board && board->GetConnectivity()->IsConnectedOnLayer( this,
static_cast<int>( aLayer ),
types );
case PAD_ATTRIB::NPTH:
if( GetShape() == PAD_SHAPE::CIRCLE && GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE )
{
if( GetOffset() == wxPoint( 0, 0 ) && GetDrillSize().x >= GetSize().x )
return false;
}
else if( GetShape() == PAD_SHAPE::OVAL && GetDrillShape() == PAD_DRILL_SHAPE_OBLONG )
{
if( GetOffset() == wxPoint( 0, 0 )
&& GetDrillSize().x >= GetSize().x && GetDrillSize().y >= GetSize().y )
{
return false;
}
}
KI_FALLTHROUGH;
case PAD_ATTRIB::SMD:
case PAD_ATTRIB::CONN:
default:
if( aLayer == UNDEFINED_LAYER )
return true;
/// We don't remove the copper from non-PTH pads
if( GetAttribute() != PAD_ATTRIB::PTH )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
/// Heat sink pads always get copper
if( GetProperty() == PAD_PROP::HEATSINK )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
if( !m_removeUnconnectedLayer )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
// Plated through hole pads need copper on the top/bottom layers for proper soldering
// Unless the user has removed them in the pad dialog
if( m_keepTopBottomLayer && ( aLayer == F_Cu || aLayer == B_Cu ) )
return IsOnLayer( static_cast<PCB_LAYER_ID>( aLayer ) );
return board->GetConnectivity()->IsConnectedOnLayer( this, static_cast<int>( aLayer ), types );
}
}
@ -1150,6 +1174,12 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
GetParent()->GetReference(),
layerMaskDescribe() );
}
else if( GetAttribute() == PAD_ATTRIB::NPTH && !FlashLayer( UNDEFINED_LAYER ) )
{
return wxString::Format( _( "Through hole pad %s of %s" ),
wxT( "(" ) + _( "NPTH, Mechanical" ) + wxT( ")" ),
GetParent()->GetReference() );
}
else
{
return wxString::Format( _( "Through hole pad %s of %s" ),
@ -1167,6 +1197,12 @@ wxString PAD::GetSelectMenuText( EDA_UNITS aUnits ) const
GetParent()->GetReference(),
layerMaskDescribe() );
}
else if( GetAttribute() == PAD_ATTRIB::NPTH && !FlashLayer( UNDEFINED_LAYER ) )
{
return wxString::Format( _( "Through hole pad %s of %s" ),
wxT( "(" ) + _( "NPTH, Mechanical" ) + wxT( ")" ),
GetParent()->GetReference() );
}
else
{
return wxString::Format( _( "Through hole pad %s %s of %s" ),