Exemple #1
0
                 text='KEEPOUT',
                 at=[round(0, 2), round(KeepOutAreaHeight / 4, 2)],
                 layer='Cmts.User'))

        #
        # Generate the pads
        #
        tpc = int(pins / 2)
        footprint.append(
            PadArray(start=[
                round(0 - HalfAllPadsWidth, 2),
                round(0 - HalfAllPadsHeight, 2)
            ],
                     pincount=tpc,
                     initial=1,
                     increment=2,
                     x_spacing=0,
                     y_spacing=2 * pitch,
                     size=[PadWidth, PadHeight],
                     type=Pad.TYPE_SMT,
                     shape=Pad.SHAPE_RECT,
                     layers=Pad.LAYERS_SMT))
        footprint.append(
            PadArray(start=[
                round(HalfAllPadsWidth, 2),
                round(pitch - HalfAllPadsHeight, 2)
            ],
                     pincount=tpc,
                     initial=2,
                     increment=2,
                     x_spacing=0,
        Text(type='value', text=footprint_name, at=[1.5, 3], layer='F.Fab'))

    # add model
    kicad_mod.append(
        Model(filename="example.3dshapes/example_footprint.wrl",
              at=[0, 0, 0],
              scale=[1, 1, 1],
              rotate=[0, 0, 0]))

    #create a pad array with a large horizontal spacing, and a smaller vertical spacing
    #centered at the origin
    pa = PadArray(pincount=10,
                  spacing=[2.54, -0.2],
                  center=[0, 0],
                  initial=5,
                  increment=2,
                  type=Pad.TYPE_SMT,
                  shape=Pad.SHAPE_RECT,
                  size=[1, 2],
                  layers=["*.Cu"])

    kicad_mod.append(pa)

    #calculate the border of the pad array
    border = pa.calculateOutline()

    #create a courtyard around the pad array
    kicad_mod.append(
        RectLine(start=border['min'],
                 end=border['max'],
                 layer='F.Fab',
Exemple #3
0
            
            #corner positions for plastic housing outline
            x1 = -(A-B)/2
            x2 = x1 + A
            
            y2 = (W - (rows-1) * pitch) / 2
            y1 = y2 - W

            # set general values
            footprint.append(Text(type='reference', text='REF**', at=[B/2,-3-(rows-1)*pitch], layer='F.SilkS'))
            footprint.append(Text(type='user', text='%R', at=[B/2,-3-(rows-1)*pitch], layer='F.Fab'))
            footprint.append(Text(type='value', text=fp_name, at=[B/2,-4.5-(rows-1)*pitch], layer='F.Fab'))
                
            #generate the pads
            for r in range(rows):
                footprint.append(PadArray(pincount=pins, initial=r*pins+1, start=[0,-r*row], x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, size=size, drill=drill, layers=Pad.LAYERS_THT))
            
            #add the locating pin
            footprint.append(Pad(at=[C,1.34],size=1.3,drill=1.3,type=Pad.TYPE_NPTH,shape=Pad.SHAPE_CIRCLE, layers=Pad.LAYERS_NPTH))
            
            #add outline to F.Fab
            #footprint.append(RectLine(start=[x1,y1],end=[x2,y2],layer='F.Fab'))
            
            off = 0.15
            #and to the silkscreen
            #and draw the tab
            TL = 5.2
            TW = 2.86
            
            def outline(off=0):
                out = [
Exemple #4
0
        # add ref-des
        footprint.append(
            Text(type='user',
                 text='%R',
                 at=[FabRef_X, FabRef_Y],
                 layer='F.Fab'))

        # generate the pads
        tpc = int(pins / 2)
        footprint.append(
            PadArray(start=[0, 0],
                     pincount=tpc,
                     initial=1,
                     increment=2,
                     x_spacing=0,
                     y_spacing=2 * pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     size=size,
                     drill=drill,
                     layers=Pad.LAYERS_THT))
        footprint.append(
            PadArray(start=[2 * pitch, pitch],
                     pincount=tpc,
                     initial=2,
                     increment=2,
                     x_spacing=0,
                     y_spacing=2 * pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     size=size,
        # set general values
        footprint.append(
            Text(type='reference',
                 text='REF**',
                 at=[P / 2, 12],
                 layer='F.SilkS'))
        footprint.append(
            Text(type='value', text=fp_name, at=[P / 2, -4.7], layer='F.Fab'))

        #generate the pads
        footprint.append(
            PadArray(pincount=pins,
                     x_spacing=pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     size=size,
                     drill=drill,
                     layers=['*.Cu', '*.Mask']))
        footprint.append(
            PadArray(pincount=pins,
                     initial=pins + 1,
                     start=[0, row],
                     x_spacing=pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     size=size,
                     drill=drill,
                     layers=['*.Cu', '*.Mask']))

        #add PCB locators
        footprint.setTags(tags)
        
        #draw simple outline on F.Fab layer
        footprint.append(RectLine(start=[x1,y1],end=[x2,y2],layer='F.Fab'))

        # set general values
        footprint.append(Text(type='reference', text='REF**', at=[x_mid,-3.5], layer='F.SilkS'))
        footprint.append(Text(type='value', text=fp_name, at=[x_mid,4.5], layer='F.Fab'))

        if pins == 2:
            drill = 1.0
        else:
            drill = 0.9
            
        #generate the pads
        pa = PadArray(pincount=pins, x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, size=1.75, drill=drill, layers=['*.Cu','*.Mask'])
        
        footprint.append(pa)
        
        #draw the courtyard
        cy = RectLine(start=[x1,y1],end=[x2,y2],layer='F.CrtYd',width=0.05,offset = 0.5,grid=0.05)
        footprint.append(cy)
        
        #draw the connector outline
        out = RectLine(start=[x1,y1],end=[x2,y2],offset=0.1)
        footprint.append(out)
        
        #wall thickness w 
        w = 0.75
        
        #gap size g
Exemple #7
0
            off = 0.12
            x1 -= off
            y1 -= off
            x2 += off
            y2 += off
            x3 -= off
            y3 -= off
            x4 += off
            
            footprint.append(PolygoneLine(polygone=[{'x':x1,'y':y2},{'x':x1,'y':y1},{'x':x3,'y':y1},{'x':x3,'y':y3},{'x':x4,'y':y3},{'x':x4,'y':y1},{'x':x2,'y':y1},{'x':x2,'y':y2},{'x':x1,'y':y2}],layer='F.SilkS'))
            
            #add pin1 mark on silk
            px = x1 - 0.2
            m = 0.3
            
            marker = [{'x': px,'y': 0},{'x': px-2*m,'y': m},{'x': px-2*m,'y': -m},{'x': px,'y': 0}]
            footprint.append(PolygoneLine(polygone=marker,width=0.12))
            
            #generate tht pads (1.65mm drill with 2.35x3mm oval pads)
            pa = PadArray(pincount=pins, x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_OVAL, size=[2.35,3], drill=1.65, layers=['*.Cu','*.Mask'])
            footprint.append(pa)
            
            #add 3D model
            footprint.append(Model(filename="${KISYS3DMOD}/Connectors_JST.3dshapes/" + fp_name + ".wrl"))
            
            #filename
            filename = output_dir + fp_name + ".kicad_mod"
            
            file_handler = KicadFileHandler(footprint)
            file_handler.writeFile(filename)
Exemple #8
0
                 end=[numpos / 2, 1.27],
                 layer='F.SilkS'))

    # create courtyard
    kicad_mod.append(
        RectLine(start=[-numpos / 2, -2.286],
                 end=[numpos / 2, 2.286],
                 layer='F.CrtYd'))

    # create pad
    kicad_mod.append(
        PadArray(pincount=numpos,
                 spacing=[1, 0],
                 center=[0, -1.6],
                 initial=1,
                 increment=2,
                 type=Pad.TYPE_SMT,
                 shape=Pad.SHAPE_RECT,
                 size=[0.61, 1.37],
                 layers=Pad.LAYERS_SMT))
    kicad_mod.append(
        PadArray(pincount=numpos,
                 spacing=[1, 0],
                 center=[0, 1.6],
                 initial=2,
                 increment=2,
                 type=Pad.TYPE_SMT,
                 shape=Pad.SHAPE_RECT,
                 size=[0.61, 1.37],
                 layers=Pad.LAYERS_SMT))
Exemple #9
0
    fp.append(
        Text(type='reference', text='REF**', at=[0, -2.75], layer='F.SilkS'))
    fp.append(Text(type='value', text=fp_name, at=[0, 3], layer='F.Fab'))

    #create outline
    # create Courtyard
    # output kicad model

    layers = ["F.Cu", "F.Mask", "F.Paste"]

    #add the pads!
    fp.append(
        PadArray(pincount=pincount,
                 x_spacing=pitch,
                 type=Pad.TYPE_SMT,
                 shape=Pad.SHAPE_RECT,
                 size=[pad_w, pad_h],
                 center=[0, -YP],
                 layers=layers))

    #add mechanical pad
    MX = A / 2 + 0.7 + 1.2 / 2
    mw = 1.2
    mh = 1.7

    fp.append(
        Pad(at=[MX, YP],
            type=Pad.TYPE_SMT,
            shape=Pad.SHAPE_RECT,
            size=[mw, mh],
            layers=layers))
    kicad_mod.append(Text(type="reference", text="REF**", at=[0, -3], layer="F.SilkS"))
    kicad_mod.append(Text(type="value", text=footprint_name, at=[1.5, 3], layer="F.Fab"))

    # add model
    kicad_mod.append(
        Model(filename="example.3dshapes/example_footprint.wrl", at=[0, 0, 0], scale=[1, 1, 1], rotate=[0, 0, 0])
    )

    # create a pad array with a large horizontal spacing, and a smaller vertical spacing
    # centered at the origin
    pa = PadArray(
        pincount=10,
        spacing=[2.54, -0.2],
        center=[0, 0],
        initial=5,
        increment=2,
        type=Pad.TYPE_SMT,
        shape=Pad.SHAPE_RECT,
        size=[1, 2],
        layers=["*.Cu"],
    )

    kicad_mod.append(pa)

    # calculate the border of the pad array
    border = pa.calculateOutline()

    # create a courtyard around the pad array
    kicad_mod.append(RectLine(start=border["min"], end=border["max"], layer="F.Fab", width=0.05, offset=0.5))

    # output kicad model
Exemple #11
0
 footprint.append(RectLine(start=[x1,y1],end=[x2,y2],layer='F.Fab'))
 
 #wall-thickness W
 w = 0.45
 
 #offset 
 o = 0.15
 x1 -= o
 y1 -= o
 x2 += o
 y2 += o
 
 
     
 #generate the pads
 footprint.append(PadArray(pincount=pins, x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, size=size, drill=drill, layers=['*.Cu','*.Mask']))
 
 
 #draw the courtyard
 cy = RectLine(start=[x1,y1],end=[x2,y2],layer='F.CrtYd',width=0.05,offset = 0.5,grid=0.05)
 footprint.append(cy)
 
 #draw the connector outline
 out = [
 {'x': -0.3,'y': 1},
 {'x': -0.5,'y': y2},
 {'x': x1+0.6,'y': y2},
 {'x': x1+0.1,'y': 0.5},
 {'x': x1+0.1,'y': 0},
 {'x': x1,'y': 0},
 {'x': x1,'y': y1},
Exemple #12
0
        #add the courtyard
        footprint.append(
            RectLine(start=[x1, y1],
                     end=[x2, y2],
                     offset=0.5,
                     grid=0.05,
                     width=0.05,
                     layer="F.CrtYd"))

        #add pins
        footprint.append(
            PadArray(pincount=pincount,
                     x_spacing=pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     increment=2,
                     size=size,
                     drill=drill,
                     layers=['*.Cu', '*.Mask']))
        footprint.append(
            PadArray(pincount=pincount,
                     x_spacing=pitch,
                     start=[0, -pitch],
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     increment=2,
                     initial=2,
                     size=size,
                     drill=drill,
                     layers=['*.Cu', '*.Mask']))
Exemple #13
0
        },
        {
            'x': -part.D1 / 2 + b,
            'y': -part.E1 / 2
        },
    ]

    fp.append(PolygoneLine(polygone=outline, layer='F.Fab'))
    #fp.append(RectLine(start=[-part.D1/2,-part.E1/2],end=[part.D1/2,part.E1/2],layer='F.Fab'))

    #draw the left-hand-pads
    fp.append(
        PadArray(pincount=part.ny,
                 y_spacing=part.N1,
                 center=[-x, 0],
                 size=[pl, part.T2],
                 layers=layers,
                 type=Pad.TYPE_SMT,
                 shape=Pad.SHAPE_RECT))

    #draw the right-hand size
    fp.append(
        PadArray(pincount=part.ny,
                 initial=1 + part.nx + part.ny,
                 y_spacing=-part.N1,
                 center=[x, 0],
                 size=[pl, part.T2],
                 layers=layers,
                 type=Pad.TYPE_SMT,
                 shape=Pad.SHAPE_RECT))
        description = "JST J2100 series connector, dual row, center locking, " + part.format(n=2*pins) + ", top entry type, through hole"
        
        #set the FP description
        footprint.setDescription(description)
        
        tags = "connector jst j2100 vertical"
        
        #set the FP tags
        footprint.setTags(tags)

        # set general values
        footprint.append(Text(type='reference', text='REF**', at=[A/2,-9.7], layer='F.SilkS'))
        footprint.append(Text(type='value', text=fp_name, at=[A/2,7.2], layer='F.Fab'))
            
        #generate the pads (row 1)
        pa1 = PadArray(pincount=pins, x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, increment=2, size=1.6, drill=0.9, layers=['*.Cu','*.Mask'])
        pa2 = PadArray(pincount=pins, x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, start=[0,-row_pitch], initial=2, increment=2, size=1.6, drill=0.9, layers=['*.Cu','*.Mask'])
        
        footprint.append(pa1)
        footprint.append(pa2)
        
        #draw the component outline
        x1 = A/2 - B/2
        x2 = x1 + B
        y1 = -4-4.48
        y2 = y1 + 14.4
        
        #draw the main outline around the footprint
        footprint.append(RectLine(start=[x1,y1],end=[x2,y2],layer='F.Fab'))
        
        #offset off
Exemple #15
0
     
     # set general values
     kicad_mod.append(Text(type='reference', text='REF**', at=[0, -3], layer='F.SilkS'))
     kicad_mod.append(Text(type='value', text=footprint_name, at=[1.5, 3], layer='F.Fab'))
     
     # create silkscreen
     kicad_mod.append(RectLine(start=[-numpos*padspacing/2 - 2.375, -2], end=[numpos*padspacing/2 + 2.375, 2], layer='F.SilkS'))
     
     # create courtyard
     kicad_mod.append(RectLine(start=[-numpos*padspacing/2 - 2.375, -5.2/2], end=[numpos*padspacing/2 + 2.375, 5.2/2], layer='F.CrtYd'))
     
     padsize = [0.4, 1.6]
     padcenter = 1.8
     
     # create pad    
     kicad_mod.append(PadArray(pincount=numpos,spacing=[padspacing, 0],center=[0,-padcenter], initial=1, increment=2, type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, size=padsize, layers=Pad.LAYERS_SMT))
     kicad_mod.append(PadArray(pincount=numpos,spacing=[padspacing, 0],center=[0,padcenter], initial=2, increment=2, type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, size=padsize, layers=Pad.LAYERS_SMT))
     
     kicad_mod.append(Pad(number ='""', type=Pad.TYPE_NPTH, shape=Pad.SHAPE_CIRCLE,
                          at=[-numpos*padspacing/2-1.5/2, -1.1],
                          size=0.89, drill=0.89,
                      layers=Pad.LAYERS_NPTH))
     kicad_mod.append(Pad(number ='""', type=Pad.TYPE_NPTH, shape=Pad.SHAPE_CIRCLE,
                          at=[numpos*padspacing/2+1.5/2, -1.1],
                          size=0.89, drill=0.89,
                      layers=Pad.LAYERS_NPTH))
 
     # add model
     kicad_mod.append(Model(filename="${KISYS3DMOD}/Connector_Samtec_LSS.3dshapes/" + footprint_name.upper() + "-TR.stp",
                            at=[0, 0, 0], scale=[1, 1, 1], rotate=[-90, 0, 0]))
     
        # set general values
        footprint.append(
            Text(type='reference',
                 text='REF**',
                 at=[B / 2, 4],
                 layer='F.SilkS'))
        footprint.append(
            Text(type='value', text=fp_name, at=[B / 2, -20.5], layer='F.Fab'))

        #generate the pads
        #top row(s)
        footprint.append(
            PadArray(pincount=pins,
                     x_spacing=pitch,
                     start=[0, 0],
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_RECT,
                     size=[x_size, y_size],
                     drill=drill,
                     layers=['*.Cu', 'B.Mask']))
        footprint.append(
            PadArray(pincount=pins,
                     x_spacing=pitch,
                     start=[0, -4.4],
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_RECT,
                     size=[x_size, y_size],
                     drill=drill,
                     layers=['*.Cu', 'B.Mask']))

        #bottom row(s)
        footprint.append(
Exemple #17
0
                    size=[3.43, 1.65],
                    drill=[0, 0],
                    layers=Pad.LAYERS_SMT))

            #
            # Add pads
            #
            pinsi = int(pins / 2)
            footprint.append(
                PadArray(start=[
                    round((0 - (B / 2)), 2),
                    round(0 - (PadDist / 2), 2)
                ],
                         pincount=pinsi,
                         initial=1,
                         increment=1,
                         x_spacing=pitch,
                         y_spacing=0,
                         type=Pad.TYPE_SMT,
                         shape=Pad.SHAPE_RECT,
                         size=[PadSiseX, PadSiseY],
                         drill=[0, 0],
                         layers=Pad.LAYERS_SMT))
            footprint.append(
                PadArray(
                    start=[round((0 - (B / 2)), 2),
                           round((PadDist / 2), 2)],
                    pincount=pinsi,
                    initial=pins,
                    increment=-1,
                    x_spacing=pitch,
                    y_spacing=0,
Exemple #18
0
        
        #corner positions
        x1 = -(E-B)/2
        x2 = x1 + E
        
        y2 = 1.15
        y1 = y2 - W

        # set general values
        footprint.append(Text(type='reference', text='REF**', at=[B/2,4], layer='F.SilkS'))
        footprint.append(Text(type='user', text='%R', at=[B/2,4], layer='F.Fab'))
        footprint.append(Text(type='value', text=fp_name, at=[B/2,-20.5], layer='F.Fab'))
            
        #generate the pads
        #top row(s)
        footprint.append(PadArray(pincount=pins, x_spacing=pitch, start=[0,0], type=Pad.TYPE_THT, shape=Pad.SHAPE_RECT, size=[x_size,y_size], drill=drill, layers=Pad.LAYERS_THT))
        footprint.append(PadArray(pincount=pins, x_spacing=pitch, start=[0,-4.4], type=Pad.TYPE_THT, shape=Pad.SHAPE_RECT, size=[x_size,y_size], drill=drill, layers=Pad.LAYERS_THT))
                
        #bottom row(s)
        footprint.append(PadArray(pincount=pins, initial=pins+1, start=[0, -12.46], x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_RECT, size=[x_size,y_size], drill=drill, layers=Pad.LAYERS_THT))
        footprint.append(PadArray(pincount=pins, initial=pins+1, start=[0, -16.86], x_spacing=pitch, type=Pad.TYPE_THT, shape=Pad.SHAPE_RECT, size=[x_size,y_size], drill=drill, layers=Pad.LAYERS_THT))

        #thermal vias
        d = 2.2
        d_small = 0.3
        s_small = 0.5
        
        dy1 = -2.2
        dy2 = -14.66
        
        
Exemple #19
0
    m_y = ymid - ym
    pad_y = ymid - yp

    # housing positions
    y2 = m_y + 3.8/2 + 1.45
    y1 = y2 - W
    
    # pad size
    pad_w = 0.8
    pad_h = 3.0
    
    # Create the pads
    footprint.append(PadArray(pincount=pincount,
                  x_spacing=pitch,
                  type=Pad.TYPE_SMT,
                  shape=Pad.SHAPE_RECT,
                  layers=Pad.LAYERS_SMT,
                  size=[pad_w, pad_h],
                  center=[0,pad_y]
                  ))
            
    # mechanical pad size
    m_w = 1.8
    m_h = 3.8
    m_x = A/2 + 1.7 + m_w/2
    
    footprint.append(Pad(at=[m_x, m_y], type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, layers=Pad.LAYERS_SMT, size=[m_w, m_h]))
    
    footprint.append(Pad(at=[-m_x, m_y], type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, layers=Pad.LAYERS_SMT, size=[m_w, m_h]))
    
    # position of housing
    
        # set general values
        footprint.append(
            Text(type='reference', text='REF**', at=[0, -3.5],
                 layer='F.SilkS'))
        footprint.append(
            Text(type='value', text=fp_name, at=[0, 5], layer='F.Fab'))

        #add ref-des to F.Fab
        #footprint.append(Text(type='user', text='%R', at=[0,2.5], layer='F.Fab'))

        #draw the pins
        footprint.append(
            PadArray(center=[0, py],
                     size=[pw, ph],
                     pincount=pins,
                     x_spacing=pitch,
                     type=Pad.TYPE_SMT,
                     shape=Pad.SHAPE_RECT,
                     layers=Pad.LAYERS_SMT))

        #mechanical pins
        mx = A / 2 + 3.6 - mw / 2
        footprint.append(
            Pad(at=[-mx, my],
                size=[mw, mh],
                type=Pad.TYPE_SMT,
                shape=Pad.SHAPE_RECT,
                layers=Pad.LAYERS_SMT))
        footprint.append(
            Pad(at=[mx, my],
                size=[mw, mh],
            Text(type='reference',
                 text='REF**',
                 at=[A / 2, 2.5],
                 layer='F.SilkS'))
        footprint.append(
            Text(type='value', text=fp_name, at=[A / 2, -3.25], layer='F.Fab'))

        # add ref-des
        #footprint.append(Text(type='user',text='%R', at=[A/2,-1.25],layer='F.Fab'))

        # generate the pads
        footprint.append(
            PadArray(start=[0, 0],
                     pincount=pins,
                     x_spacing=pitch,
                     type=Pad.TYPE_THT,
                     shape=Pad.SHAPE_CIRCLE,
                     size=size,
                     drill=drill,
                     layers=Pad.LAYERS_THT))

        # courtyard
        footprint.append(
            RectLine(start=[x1, y1],
                     end=[x2, y2],
                     layer='F.CrtYd',
                     width=0.05,
                     grid=0.05,
                     offset=0.5))

        # outline on Fab
        footprint.append(RectLine(start=[x1, y1], end=[x2, y2], layer='F.Fab'))
Exemple #22
0
        Text(type='reference', text='REF**', at=[0, -5.2], layer='F.SilkS'))
    fp.append(
        Text(type='value', text=footprint_name, at=[0, 5.4], layer='F.Fab'))

    #Major dimensions
    B = (pincount - 1) * pitch
    A = B + 4.7

    #pins
    fp.append(
        PadArray(
            pincount=pincount,
            initial=1,
            start=[0, 0],
            x_spacing=pitch,
            type=Pad.TYPE_THT,
            layers=Pad.LAYERS_THT,
            shape=Pad.SHAPE_CIRCLE,
            size=pad_size,
            drill=drill,
        ))

    #calculate major dimensions
    x1 = (B - A) / 2
    x2 = x1 + A

    #courtyard
    fp.append(
        RectLine(start=[x1, yt],
                 end=[x2, y2],
                 layer='F.CrtYd',
Exemple #23
0
        Text(type='reference', text='REF**', at=[0, -2.5], layer='F.SilkS'))
    #fp.append(Text(type='user', text='%R', at=[0, -2.5], layer='F.Fab'))
    fp.append(Text(type='value', text=footprint_name, at=[0, 3],
                   layer='F.Fab'))

    #Major dimensions
    B = (pincount - 1) * pitch
    A = B + 3
    C = A - 0.6

    #pins
    fp.append(
        PadArray(pincount=pincount,
                 initial=1,
                 center=[0, yp],
                 x_spacing=pitch,
                 type=Pad.TYPE_SMT,
                 layers=Pad.LAYERS_SMT,
                 shape=Pad.SHAPE_RECT,
                 size=pad_size))

    #mechanical pads
    xm = B / 2 + 0.8 + mw / 2
    fp.append(
        Pad(at=[xm, ym],
            shape=Pad.SHAPE_RECT,
            type=Pad.TYPE_SMT,
            layers=Pad.LAYERS_SMT,
            size=[mw, mh]))
    fp.append(
        Pad(at=[-xm, ym],
            shape=Pad.SHAPE_RECT,
Exemple #24
0
        footprint.append(
            Text(type='reference',
                 text='REF**',
                 at=[A / 2, 4.3],
                 layer='F.SilkS'))
        footprint.append(
            Text(type='value', text=fp_name, at=[A / 2, -3.5], layer='F.Fab'))

        #generate the pads (row 1)
        for i in range(rows):
            footprint.append(
                PadArray(pincount=pins,
                         start=[0, i * pitch],
                         initial=(i + 1),
                         increment=rows,
                         x_spacing=pitch,
                         type=Pad.TYPE_THT,
                         shape=Pad.SHAPE_CIRCLE,
                         size=pad_dia,
                         drill=drill,
                         layers=['*.Cu', '*.Mask']))

        #rough outline
        #corner radius
        r = 0.75
        footprint.append(
            Arc(center=[x1 + r, y1 + r], start=[x1, y1 + r], angle=90))
        footprint.append(
            Arc(center=[x2 - r, y1 + r], start=[x2 - r, y1], angle=90))
        footprint.append(
            Arc(center=[x2 - r, y2 - r], start=[x2, y2 - r], angle=90))
        footprint.append(
Exemple #25
0
    # create courtyard
    kicad_mod.append(RectLine(start=[-2.25,-2.25], end=[5.25,2.25], layer='F.CrtYd', width=0.05, offset=2))

    # create pads
    kicad_mod.append(Pad(number=7, type=Pad.TYPE_THT, shape=Pad.SHAPE_RECT, at=[0,0], size=[2,2], drill=1.2, layers=['*.Cu', '*.Mask', 'F.SilkS']))
    kicad_mod.append(Pad(number=22, type=Pad.TYPE_THT, shape=Pad.SHAPE_CIRCLE, at=[3,0], size=[2,2], drill=1.2, layers=['*.Cu', '*.Mask', 'F.SilkS']))
    
    kicad_mod.append(Pad(number=12, type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, at=[3,0], size=[2,2], drill=1.2, layers=['*.Cu', '*.Mask', 'F.SilkS']))

    # add model
    kicad_mod.append(Model(filename="example.3dshapes/example_footprint.wrl"
                          ,at=[0,0,0]
                          ,scale=[1,1,1]
                          ,rotate=[0,0,0]))
    
    kicad_mod.append(PadArray(pincount=10,spacing=[1,-1],center=[0,0], initial=5, increment=2, type=Pad.TYPE_SMT, shape=Pad.SHAPE_RECT, size=[1,2], layers=["*.Cu"]))
                          
    # output kicad model
    #print(kicad_mod)

    # print render tree
    #print(kicad_mod.getRenderTree())
    #print(kicad_mod.getCompleteRenderTree())

    # write file
    file_handler = KicadFileHandler(kicad_mod)
    file_handler.writeFile('example_footprint.kicad_mod')