From fc1f71310611ed2f940ca40277d2ba75dc21f6a6 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 24 Jan 2020 17:28:09 +0000 Subject: [PATCH] Fix issue with DRC for through hole being applied to SMD pads Commit d7272b7f5e4d41d9c9cfb57b7aa27608352d20a5 fixed the use of the eagle DRC to change the library pad shapes. This was also applied incorrectly to SMD stacks. Remove the references to m_rules in packageSMD() and the code that deals with them. eagle 7.7 does not have any SMD pad options other than rectangle with rounding. (cherry picked from commit 070c6b8ce0fb52fe4d7a19603341c984eddaad71) --- pcbnew/eagle_plugin.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index d368b93028..de2c52a90f 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -1909,36 +1909,11 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const if( !IsCopperLayer( layer ) ) return; - bool shape_set = false; - int shape = EPAD::UNDEF; D_PAD* pad = new D_PAD( aModule ); aModule->PadsList().PushBack( pad ); transferPad( e, pad ); - if( pad->GetName() == wxT( "1" ) && m_rules->psFirst != EPAD::UNDEF ) - shape = m_rules->psFirst; - else if( layer == F_Cu && m_rules->psTop != EPAD::UNDEF ) - shape = m_rules->psTop; - else if( layer == B_Cu && m_rules->psBottom != EPAD::UNDEF ) - shape = m_rules->psBottom; - - switch( shape ) - { - case EPAD::ROUND: - case EPAD::OCTAGON: - shape_set = true; - pad->SetShape( PAD_SHAPE_CIRCLE ); - break; - - case EPAD::SQUARE: - shape_set = true; - pad->SetShape( PAD_SHAPE_RECT ); - break; - - default: - pad->SetShape( PAD_SHAPE_RECT ); - } - + pad->SetShape( PAD_SHAPE_RECT ); pad->SetAttribute( PAD_ATTRIB_SMD ); wxSize padSize( e.dx.ToPcbUnits(), e.dy.ToPcbUnits() ); @@ -1959,7 +1934,7 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const int roundRadius = eagleClamp( m_rules->srMinRoundness * 2, (int)( minPadSize * m_rules->srRoundness ), m_rules->srMaxRoundness * 2 ); - if( !shape_set && ( e.roundness || roundRadius > 0 ) ) + if( e.roundness || roundRadius > 0 ) { double roundRatio = (double) roundRadius / minPadSize / 2.0;