Don't run hole offset check for pad with no copper.

Fixes https://gitlab.com/kicad/code/kicad/issues/6255
This commit is contained in:
Jeff Young 2020-11-02 12:44:52 +00:00
parent 5cee808799
commit 3b10d15835
1 changed files with 28 additions and 21 deletions

View File

@ -1163,16 +1163,19 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
} }
// Test hole size against pad size // Test hole size against pad size
if( m_dummyPad->GetAttribute() != PAD_ATTRIB_NPTH )
{
LSET lset = m_dummyPad->GetLayerSet() & LSET::AllCuMask(); LSET lset = m_dummyPad->GetLayerSet() & LSET::AllCuMask();
PCB_LAYER_ID layer = lset.Seq().at( 0 ); PCB_LAYER_ID layer = lset.Seq().at( 0 );
int maxError = m_board->GetDesignSettings().m_MaxError; int maxError = m_board->GetDesignSettings().m_MaxError;
SHAPE_POLY_SET padOutline, drillOutline; SHAPE_POLY_SET padOutline;
m_dummyPad->TransformShapeWithClearanceToPolygon( padOutline, layer, 0, maxError, m_dummyPad->TransformShapeWithClearanceToPolygon( padOutline, layer, 0, maxError,
ERROR_LOC::ERROR_INSIDE ); ERROR_LOC::ERROR_INSIDE );
const SHAPE_SEGMENT* drillShape = m_dummyPad->GetEffectiveHoleShape(); const SHAPE_SEGMENT* drillShape = m_dummyPad->GetEffectiveHoleShape();
const SEG drillSeg = drillShape->GetSeg(); const SEG drillSeg = drillShape->GetSeg();
SHAPE_POLY_SET drillOutline;
TransformOvalToPolygon( drillOutline, (wxPoint) drillSeg.A, (wxPoint) drillSeg.B, TransformOvalToPolygon( drillOutline, (wxPoint) drillSeg.A, (wxPoint) drillSeg.B,
drillShape->GetWidth(), maxError, ERROR_LOC::ERROR_INSIDE ); drillShape->GetWidth(), maxError, ERROR_LOC::ERROR_INSIDE );
@ -1181,9 +1184,12 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( ( drillOutline.BBox().GetWidth() > 0 ) || ( drillOutline.BBox().GetHeight() > 0 ) ) if( ( drillOutline.BBox().GetWidth() > 0 ) || ( drillOutline.BBox().GetHeight() > 0 ) )
{ {
warning_msgs.Add( _( "Warning: Pad drill bigger than pad size or shapes do not overlap" ) ); warning_msgs.Add( _( "Warning: Pad drill bigger than pad size or drill shape and"
skip_tstoffset = true; // offset prm will be not tested because if the drill value "pad shape do not overlap" ) );
// is incorrect the offset prm is always seen as incorrect, even if it is 0 skip_tstoffset = true; // offset parameter will be not tested because if the drill
// value is incorrect the offset parameter is always seen as
// incorrect, even if it is 0
}
} }
if( m_dummyPad->GetLocalClearance() < 0 ) if( m_dummyPad->GetLocalClearance() < 0 )
@ -1199,7 +1205,9 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( m_dummyPad->GetLocalSolderMaskMargin() < 0 ) if( m_dummyPad->GetLocalSolderMaskMargin() < 0 )
{ {
if( m_dummyPad->GetShape() == PAD_SHAPE_CUSTOM ) if( m_dummyPad->GetShape() == PAD_SHAPE_CUSTOM )
{
error_msgs.Add( _( "Pad local solder mask clearance must be zero or greater than zero" ) ); error_msgs.Add( _( "Pad local solder mask clearance must be zero or greater than zero" ) );
}
else else
{ {
int min_smClearance = -std::min( m_dummyPad->GetSize().x, m_dummyPad->GetSize().y )/2; int min_smClearance = -std::min( m_dummyPad->GetSize().x, m_dummyPad->GetSize().y )/2;
@ -1229,7 +1237,6 @@ bool DIALOG_PAD_PROPERTIES::padValuesOK()
if( ( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y ) if( ( m_dummyPad->GetDrillSize().x || m_dummyPad->GetDrillSize().y )
&& m_dummyPad->GetAttribute() != PAD_ATTRIB_NPTH ) && m_dummyPad->GetAttribute() != PAD_ATTRIB_NPTH )
{ {
// Note: he message is shown in an HTML window
msg = _( "Warning: plated through holes should normally have a copper pad on at least one layer" ); msg = _( "Warning: plated through holes should normally have a copper pad on at least one layer" );
warning_msgs.Add( msg ); warning_msgs.Add( msg );
} }