← Back to team overview

kicad-developers team mailing list archive

Fwd: PATCH: fixed Courtyard thickness in the footprint wizards

 

Hey guys,
This is my first KiCAD patch so please let me know if anything is not
matching your workflow/conventions.

This patch set the courtyard width to 0.05mm to comply with KLC in the
following footprints wizards: bga, qfp, sdip and zip.

Regards,
Mikael Arguedas
=== modified file 'pcbnew/scripting/plugins/bga_wizard.py'
--- pcbnew/scripting/plugins/bga_wizard.py	2015-10-31 11:54:48 +0000
+++ pcbnew/scripting/plugins/bga_wizard.py	2016-02-08 17:51:52 +0000
@@ -86,7 +86,11 @@
         self.draw.SetLayer(pcbnew.F_CrtYd)
         sizex = (ssx + cmargin) * 2
         sizey = (ssy + cmargin) * 2
+        # set courtyard line thickness to the one defined in KLC
+        self.draw.SetLineTickness(pcbnew.FromMM(0.05))
         self.draw.Box(0, 0, sizex, sizey)
+        # restore line thickness to previous value
+        self.draw.SetLineTickness(pcbnew.FromMM(cmargin))
 
         #reference and value
         text_size = self.GetTextSize()  # IPC nominal

=== modified file 'pcbnew/scripting/plugins/qfp_wizard.py'
--- pcbnew/scripting/plugins/qfp_wizard.py	2015-10-31 11:54:48 +0000
+++ pcbnew/scripting/plugins/qfp_wizard.py	2016-02-08 17:51:56 +0000
@@ -113,7 +113,12 @@
         self.draw.SetLayer(pcbnew.F_CrtYd)
         sizex = (lim_x + cmargin) * 2 + pad_length
         sizey = (lim_y + cmargin) * 2 + pad_length
+        # set courtyard line thickness to the one defined in KLC
+        thick = self.draw.GetLineTickness()
+        self.draw.SetLineTickness(pcbnew.FromMM(0.05))
         self.draw.Box(0, 0, sizex, sizey)
+        # restore line thickness to previous value
+        self.draw.SetLineTickness(pcbnew.FromMM(thick))
 
         #reference and value
         text_size = self.GetTextSize()  # IPC nominal

=== modified file 'pcbnew/scripting/plugins/sdip_wizard.py'
--- pcbnew/scripting/plugins/sdip_wizard.py	2015-12-09 16:11:32 +0000
+++ pcbnew/scripting/plugins/sdip_wizard.py	2016-02-08 17:52:00 +0000
@@ -104,6 +104,17 @@
 
         self.DrawBox(ssx, ssy)
 
+        # Courtyard
+        cmargin = self.draw.GetLineTickness()
+        self.draw.SetLayer(pcbnew.F_CrtYd)
+        sizex = (ssx + cmargin) * 2
+        sizey = (ssy + cmargin) * 2
+        # set courtyard line thickness to the one defined in KLC
+        self.draw.SetLineTickness(pcbnew.FromMM(0.05))
+        self.draw.Box(0, 0, sizex, sizey)
+        # restore line thickness to previous value
+        self.draw.SetLineTickness(pcbnew.FromMM(cmargin))
+        
         #reference and value
         text_size = self.GetTextSize()  # IPC nominal
 

=== modified file 'pcbnew/scripting/plugins/zip_wizard.py'
--- pcbnew/scripting/plugins/zip_wizard.py	2015-10-31 11:54:48 +0000
+++ pcbnew/scripting/plugins/zip_wizard.py	2016-02-08 17:51:48 +0000
@@ -74,7 +74,7 @@
 
         array = PA.PadZGridArray(pad, pad_count, line_count, line_pitch, pad_pitch)
         array.AddPadsToModule(self.draw)
-
+         
         # draw the Silk Screen
         pads_per_line = pad_count // line_count
         row_length = pad_pitch * (pads_per_line - 1)  # fenceposts
@@ -102,9 +102,14 @@
         cmarginx = body[self.courtyard_x_margin_key]
         cmarginy = body[self.courtyard_y_margin_key]
         self.draw.SetLayer(pcbnew.F_CrtYd)
-        sizex = (pin1posX + cmarginx) * 2 + pad_Hsize
-        sizey = (pin1posY + cmarginy) * 2 + pad_Vsize
+        # set courtyard line thickness to the one defined in KLC
+        thick = self.draw.GetLineTickness()
+        sizex = (pin1posX + cmarginx) * 2 + pad_Hsize + thick
+        sizey = (pin1posY + cmarginy) * 2 + pad_Vsize + thick
+        self.draw.SetLineTickness(pcbnew.FromMM(0.05))
         self.draw.Box(0, 0, sizex, sizey)
+        # restore line thickness to previous value
+        self.draw.SetLineTickness(pcbnew.FromMM(thick))
 
         #reference and value
         text_size = self.GetTextSize()  # IPC nominal


References