Revise restriction on No Copper setting

This allows the user to specify a NPTH with "No Copper", allowing a pad
to retain the mask layer without a copper landing.

Fixes https://gitlab.com/kicad/code/kicad/issues/3407

Fixes https://gitlab.com/kicad/code/kicad/issues/5237
This commit is contained in:
Seth Hillbrand 2020-06-27 14:44:56 -07:00
parent 1082402b33
commit f4e8c194be
2 changed files with 9 additions and 14 deletions

View File

@ -1197,18 +1197,11 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] ) if( !padlayers_mask[F_Cu] && !padlayers_mask[B_Cu] )
{ {
if( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y ) if( ( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y )
&& m_dummyPad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
{ {
// Note: he message is shown in an HTML window // Note: he message is shown in an HTML window
msg = _( "Error: the pad is not on a copper layer and has a hole" ); msg = _( "Error: plated through holes must have a copper pad on at least one layer" );
if( m_dummyPad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED )
{
msg += wxT( "<br><br><i>" );
msg += _( "For NPTH pad, set pad size value to pad drill value,"
" if you do not want this pad plotted in gerber files" );
}
error_msgs.Add( msg ); error_msgs.Add( msg );
} }
} }

View File

@ -581,8 +581,9 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( D_PAD* aPad )
{ {
LAYER_RANGE layers( 0, MAX_CU_LAYERS - 1 ); LAYER_RANGE layers( 0, MAX_CU_LAYERS - 1 );
// ignore non-copper pads // ignore non-copper pads except for those with holes
if( ( aPad->GetLayerSet() & LSET::AllCuMask()).none() ) if( ( aPad->GetLayerSet() & LSET::AllCuMask()).none() &&
aPad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
return NULL; return NULL;
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
@ -590,9 +591,9 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( D_PAD* aPad )
case PAD_ATTRIB_STANDARD: case PAD_ATTRIB_STANDARD:
break; break;
case PAD_ATTRIB_SMD:
case PAD_ATTRIB_HOLE_NOT_PLATED: case PAD_ATTRIB_HOLE_NOT_PLATED:
case PAD_ATTRIB_CONN: case PAD_ATTRIB_CONN:
case PAD_ATTRIB_SMD:
{ {
LSET lmsk = aPad->GetLayerSet(); LSET lmsk = aPad->GetLayerSet();
bool is_copper = false; bool is_copper = false;
@ -610,7 +611,8 @@ std::unique_ptr<PNS::SOLID> PNS_KICAD_IFACE_BASE::syncPad( D_PAD* aPad )
} }
} }
if( !is_copper ) /// Keep the NPTH pads because we will use the drill as alternate shape
if( !is_copper && aPad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
return NULL; return NULL;
} }
break; break;