footprint wiz: Update default values

This updates some of the footprint wizard values to use the default KLC
values for silkscreen, fab, courtyard and text.

Also updates the default QFN settings to create a valid footprint
This commit is contained in:
Seth Hillbrand 2018-12-10 04:13:12 -07:00
parent 9490fd9d30
commit 4b3bfb0115
9 changed files with 42 additions and 30 deletions

View File

@ -101,6 +101,7 @@ class FPC_FootprintWizard(FootprintWizardBase.FootprintWizard):
self.module.Add(pad_s1)
# add footprint outline
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
linewidth = self.draw.GetLineThickness()
margin = linewidth

View File

@ -99,11 +99,13 @@ class BGAWizard(FootprintWizardBase.FootprintWizard):
bevel = pcbnew.FromMM(1)
# Box with 1mm bevel as per IPC7351C
self.draw.SetLineThickness( pcbnew.FromMM( 0.1 ) ) #Default per KLC F5.2 as of 12/2018
self.draw.BoxWithDiagonalAtCorner(0, 0, ssx*2, ssy*2, bevel)
# Add IPC markings to F_Silk layer
self.draw.SetLayer(pcbnew.F_SilkS)
offset = pcbnew.FromMM(0.15)
self.draw.SetLayer( pcbnew.F_SilkS )
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
offset = self.draw.GetLineThickness()
len_x = 0.5 * ssx
len_y = 0.5 * ssy

View File

@ -101,11 +101,12 @@ class circular_pad_array_wizard(FootprintWizardBase.FootprintWizard):
# Draw the outline
body_radius = outline['diameter'] / 2
self.draw.SetLayer(pcbnew.F_Fab)
self.draw.GetLineThickness()
self.draw.SetLineThickness( pcbnew.FromMM( 0.1 ) ) #Default per KLC F5.2 as of 12/2018
self.draw.Circle(0, 0, body_radius)
#silkscreen
body_radius += pcbnew.FromMM(0.15)
body_radius += pcbnew.FromMM(0.12)
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
self.draw.SetLayer(pcbnew.F_SilkS)
self.draw.Circle(0, 0, body_radius)

View File

@ -148,6 +148,8 @@ class MicroMaTchWizard(FPWbase.FootprintWizard):
width = pcbnew.FromMM(1.92) + (numPads * padPitch) / 2
height = pcbnew.FromMM(5)
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
# Left part
# --
# |

View File

@ -34,9 +34,9 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
#TODO - Allow different number of pads in x and y directions
self.AddParam("Pads", "n", self.uInteger, 100, multiple=4, min_value=4)
self.AddParam("Pads", "pitch", self.uMM, 0.5, designator='e')
self.AddParam("Pads", "width", self.uMM, 0.25, designator='X1')
self.AddParam("Pads", "length", self.uMM, 1.5, designator='Y1')
self.AddParam("Pads", "pitch", self.uMM, 0.4, designator='e')
self.AddParam("Pads", "width", self.uMM, 0.2, designator='X1')
self.AddParam("Pads", "length", self.uMM, 0.75, designator='Y1')
self.AddParam("Pads", "fillet", self.uMM, 0.3)
self.AddParam("Pads", "oval", self.uBool, True)
@ -45,9 +45,9 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
self.AddParam("EPad", "length", self.uMM, 10, designator="D2")
self.AddParam("EPad", "thermal vias", self.uBool, False)
self.AddParam("EPad", "thermal vias drill", self.uMM, 1, min_value=0.1)
self.AddParam("EPad", "x divisions", self.uInteger, 2, min_value=1)
self.AddParam("EPad", "y divisions", self.uInteger, 2, min_value=1)
self.AddParam("EPad", "paste margin", self.uMM, 0.1)
self.AddParam("EPad", "x divisions", self.uInteger, 4, min_value=1)
self.AddParam("EPad", "y divisions", self.uInteger, 4, min_value=1)
self.AddParam("EPad", "paste margin", self.uMM, 0.75)
self.AddParam("Package", "width", self.uMM, 14, designator='E')
self.AddParam("Package", "height", self.uMM, 14, designator='D')
@ -188,17 +188,19 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
self.draw.BoxWithDiagonalAtCorner(0, 0, w, h, bevel)
# Silkscreen
self.draw.SetLayer(pcbnew.F_SilkS)
self.draw.SetLayer( pcbnew.F_SilkS )
offset = self.draw.GetLineThickness()
clip = row_len / 2 + self.pads['pitch']
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
self.draw.Polyline( [ [ clip, -h/2-offset], [ w/2+offset,-h/2-offset], [ w/2+offset, -clip] ] ) # top right
self.draw.Polyline( [ [ clip, h/2+offset], [ w/2+offset, h/2+offset], [ w/2+offset, clip] ] ) # bottom right
self.draw.Polyline( [ [-clip, h/2+offset], [-w/2-offset, h/2+offset], [-w/2-offset, clip] ] ) # bottom left
# Add pin-1 indication as per IPC-7351C
self.draw.Line(-clip, -h/2-offset, -w/2-pad_length/2, -h/2-offset)
self.draw.Line( -clip, -h/2-offset, -w/2-pad_length/2, -h/2-offset )
self.draw.SetLineThickness( offset ) #Restore default
# Courtyard
cmargin = self.package["margin"]
@ -219,7 +221,7 @@ class QFNWizard(FootprintWizardBase.FootprintWizard):
#reference and value
text_size = self.GetTextSize() # IPC nominal
text_offset = v_pitch / 2 + text_size + pad_length / 2
text_offset = sizey / 2 + text_size
self.draw.Value(0, text_offset, text_size)
self.draw.Reference(0, -text_offset, text_size)

View File

@ -114,6 +114,7 @@ class QFPWizard(FootprintWizardBase.FootprintWizard):
# Add outline to F_Fab layer
self.draw.SetLayer(pcbnew.F_Fab)
thick = self.draw.GetLineThickness()
bevel = min( pcbnew.FromMM(1.0), self.package['width']/2, self.package['height']/2 )
@ -127,10 +128,12 @@ class QFPWizard(FootprintWizardBase.FootprintWizard):
bottom_edge = (v_pitch + pad_length) / 2
top_edge = -bottom_edge
self.draw.SetLineThickness( pcbnew.FromMM( 0.1 ) ) #Default per KLC F5.2 as of 12/2018
self.draw.BoxWithDiagonalAtCorner(0, 0, w, h, bevel)
# Draw silkscreen
self.draw.SetLayer(pcbnew.F_SilkS)
self.draw.SetLayer( pcbnew.F_SilkS )
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
#top left - as per IPC-7351C
self.draw.Polyline([(-inner, -y), (-x, -y), (-x, -inner), (left_edge, -inner)])
@ -143,16 +146,15 @@ class QFPWizard(FootprintWizardBase.FootprintWizard):
# Courtyard
cmargin = self.parameters["Package"]["courtyard margin"]
self.draw.SetLayer(pcbnew.F_CrtYd)
sizex = (right_edge + cmargin) * 2
sizey = (bottom_edge + cmargin) * 2
self.draw.SetLayer( pcbnew.F_CrtYd )
sizex = ( right_edge + cmargin ) * 2
sizey = ( bottom_edge + cmargin ) * 2
# round size to nearest 0.1mm, rectangle will thus land on a 0.05mm grid
sizex = pcbnew.PutOnGridMM(sizex, 0.1)
sizey = pcbnew.PutOnGridMM(sizey, 0.1)
# set courtyard line thickness to the one defined in KLC
thick = self.draw.GetLineThickness()
self.draw.SetLineThickness(pcbnew.FromMM(0.05))
self.draw.Box(0, 0, sizex, sizey)
sizex = pcbnew.PutOnGridMM( sizex, 0.1 )
sizey = pcbnew.PutOnGridMM( sizey, 0.1 )
self.draw.SetLineThickness( pcbnew.FromMM( 0.05 ) ) #Default per KLC F5.3 as of 12/2018
self.draw.Box( 0, 0, sizex, sizey )
# restore line thickness to previous value
self.draw.SetLineThickness(pcbnew.FromMM(thick))

View File

@ -36,9 +36,9 @@ class QRCodeWizard(FootprintWizardBase.FootprintWizard):
self.AddParam("Barcode", "Use SilkS layer", self.uBool, False)
self.AddParam("Barcode", "Use Cu layer", self.uBool, True)
self.AddParam("Caption", "Enabled", self.uBool, True)
self.AddParam("Caption", "Height", self.uMM, 1.2)
self.AddParam("Caption", "Width", self.uMM, 1.2)
self.AddParam("Caption", "Thickness", self.uMM, 0.12)
self.AddParam("Caption", "Height", self.uMM, 1.0)
self.AddParam("Caption", "Width", self.uMM, 1.0)
self.AddParam("Caption", "Thickness", self.uMM, 0.15)
def CheckParameters(self):

View File

@ -99,13 +99,14 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard):
ssx = -pin1_posX - ssx_offset
ssy = -pin1_posY - ssy_offset
cmargin = self.draw.GetLineThickness()
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
self.DrawBox(ssx, ssy)
# Courtyard
cmargin = self.draw.GetLineThickness()
self.draw.SetLayer(pcbnew.F_CrtYd)
sizex = (ssx + cmargin) * 2
sizey = (ssy + cmargin) * 2
sizex = (pin1posX + cmargin) * 2 + pad_Hsize + thick
sizey = (pin1posY + cmargin) * 2 + pad_Vsize + thick
# round size to nearest 0.1mm, rectangle will thus land on a 0.05mm grid
sizex = pcbnew.PutOnGridMM(sizex, 0.1)
sizey = pcbnew.PutOnGridMM(sizey, 0.1)

View File

@ -85,13 +85,14 @@ class RowedFootprint(FootprintWizardBase.FootprintWizard):
if cornery < linew:
cornery = linew
thick = self.draw.GetLineThickness()
self.draw.SetLineThickness( pcbnew.FromMM( 0.12 ) ) #Default per KLC F5.1 as of 12/2018
self.DrawBox(leftx*2, cornery*2)
# Courtyard
cmarginx = self.body['courtyard margin']
cmarginy = cmarginx
self.draw.SetLayer(pcbnew.F_CrtYd)
thick = self.draw.GetLineThickness()
sizex = (pin1posX + cmarginx) * 2 + pad_Hsize + thick
sizey = (pin1posY + cmarginy) * 2 + pad_Vsize + thick
# round size to nearest 0.1mm, rectangle will thus land on a 0.05mm grid