From 9df4ae65eaaab6796359dabe6b036b281ed9b3bc Mon Sep 17 00:00:00 2001 From: Eldar Khayrullin Date: Sun, 5 Nov 2017 13:13:09 +0300 Subject: [PATCH] pcad2kicadpcb: import solder mask for Mounting Holes Fixes: lp:1730173 * https://bugs.launchpad.net/kicad/+bug/1730173 --- pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp index f42e2004fa..f8f44e65ee 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp @@ -205,6 +205,15 @@ void PCB_PAD::AddToModule( MODULE* aModule, int aRotation, bool aEncapsulatedPad pad->SetDrillSize( wxSize( m_hole, m_hole ) ); pad->SetSize( wxSize( m_hole, m_hole ) ); + // Mounting Hole: Solder Mask Margin from Top Layer Width size. + // Used the default zone clearance (simplify) + if( m_shapes.GetCount() && m_shapes[0]->m_shape == wxT( "MtHole" ) ) + { + int sm_margin = ( m_shapes[0]->m_width - m_hole ) / 2; + pad->SetLocalSolderMaskMargin( sm_margin ); + pad->SetLocalClearance( sm_margin + Millimeter2iu( 0.254 ) ); + } + pad->SetLayerSet( LSET::AllCuMask() | LSET( 2, B_Mask, F_Mask ) ); } else