Exemple #1
0
def triangle_silk(conf):
    """Draw a triangle silkscreen pointing to pin 1."""
    out = []
    w = conf['pitch'] - conf['pad_shape'][0] - 2*silk_pad_igap
    h = conf['chip_shape'][1] - silk_width
    out.append(fp_line((-w/2, 0), (w/2, -h/2), "F.SilkS", silk_width))
    out.append(fp_line((-w/2, 0), (w/2, +h/2), "F.SilkS", silk_width))
    out.append(fp_line((w/2, -h/2), (w/2, +h/2), "F.SilkS", silk_width))
    return out
def triangle_silk(conf):
    """Draw a triangle silkscreen pointing to pin 1."""
    out = []
    w = conf['pitch'] - conf['pad_shape'][0] - 2*silk_pad_igap
    h = conf['chip_shape'][1] - silk_width
    out.append(fp_line((-w/2, 0), (w/2, -h/2), "F.SilkS", silk_width))
    out.append(fp_line((-w/2, 0), (w/2, +h/2), "F.SilkS", silk_width))
    out.append(fp_line((w/2, -h/2), (w/2, +h/2), "F.SilkS", silk_width))
    return out
def side_pth_fab(pins):
    out = []
    w = fab_width
    centre = (0, -2.6)

    # Draw outline
    nw, ne, se, sw, _ = draw_square(2.5 * (pins - 1) + 5, 8.2, centre, "F.Fab",
                                    w)
    out.append(fp_line(nw, ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, (se[0] - 1, se[1]), "F.Fab", w))
    out.append(
        fp_line((se[0] - 1, se[1]), (se[0] - 1, se[1] - 2.2), "F.Fab", w))
    out.append(
        fp_line((se[0] - 1, se[1] - 2.2), (sw[0] + 1, sw[1] - 2.2), "F.Fab",
                w))
    out.append(fp_line(nw, sw, "F.Fab", w))
    out.append(fp_line(sw, (sw[0] + 1, sw[1]), "F.Fab", w))
    out.append(
        fp_line((sw[0] + 1, sw[1]), (sw[0] + 1, sw[1] - 2.2), "F.Fab", w))

    # Draw the pins
    x = 1.25 * (pins - 1)
    for pin in range(pins):
        sq = draw_square(0.5, 0.75, (x, -0.125), "F.Fab", fab_width)
        out += sq[4]
        out.append(
            fp_line((x - .25, -.25), (x + .25, -.25), "F.Fab", fab_width))
        x -= 2.5
    return out
Exemple #4
0
def side_pth_fab(pins):
    out = []
    w = fab_width
    centre = (0, -2.35)

    # Draw outline
    nw, ne, se, sw, _ = draw_square(2 * (pins - 1) + 4, 11.7, centre, "F.Fab",
                                    w)
    out.append(fp_line(nw, ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, (se[0] - 1, se[1]), "F.Fab", w))
    out.append(fp_line((se[0] - 1, se[1]), (se[0] - 1, se[1] - 4), "F.Fab", w))
    out.append(
        fp_line((se[0] - 1, se[1] - 4), (sw[0] + 1, sw[1] - 4), "F.Fab", w))
    out.append(fp_line(nw, sw, "F.Fab", w))
    out.append(fp_line(sw, (sw[0] + 1, sw[1]), "F.Fab", w))
    out.append(fp_line((sw[0] + 1, sw[1]), (sw[0] + 1, sw[1] - 4), "F.Fab", w))

    # Draw side legs
    x = (2 * (pins - 1) + 4) // 2 - 0.3
    _, _, _, _, sq = draw_square(0.6, 0.8, (x, -2.1), "F.Fab", w)
    out += sq
    _, _, _, _, sq = draw_square(0.6, 0.8, (-x, -2.1), "F.Fab", w)
    out += sq

    # Draw the pins
    x = pins - 1
    for pin in range(pins):
        sq = draw_square(0.5, 0.75, (x, -0.125), "F.Fab", fab_width)
        out += sq[4]
        out.append(
            fp_line((x - .25, -.25), (x + .25, -.25), "F.Fab", fab_width))
        x -= 2
    return out
def side_pth_fab(pins):
    out = []
    w = fab_width
    centre = (0, -2.35)

    # Draw outline
    nw, ne, se, sw, _ = draw_square(2*(pins-1)+4, 11.7, centre, "F.Fab", w)
    out.append(fp_line(nw, ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, (se[0]-1, se[1]), "F.Fab", w))
    out.append(fp_line((se[0]-1, se[1]), (se[0]-1, se[1]-4), "F.Fab", w))
    out.append(fp_line((se[0]-1, se[1]-4), (sw[0]+1, sw[1]-4), "F.Fab", w))
    out.append(fp_line(nw, sw, "F.Fab", w))
    out.append(fp_line(sw, (sw[0]+1, sw[1]), "F.Fab", w))
    out.append(fp_line((sw[0]+1, sw[1]), (sw[0]+1, sw[1]-4), "F.Fab", w))

    # Draw side legs
    x = (2*(pins-1)+4)//2 - 0.3
    _, _, _, _, sq = draw_square(0.6, 0.8, (x, -2.1), "F.Fab", w)
    out += sq
    _, _, _, _, sq = draw_square(0.6, 0.8, (-x, -2.1), "F.Fab", w)
    out += sq

    # Draw the pins
    x = pins - 1
    for pin in range(pins):
        sq = draw_square(0.5, 0.75, (x, -0.125), "F.Fab", fab_width)
        out += sq[4]
        out.append(fp_line((x-.25, -.25), (x+.25, -.25), "F.Fab", fab_width))
        x -= 2
    return out
def dil_silk(pins):
    nw, ne, se, sw, _ = draw_square(
        pins * 2.54, 2*2.54, (0, 0), "F.SilkS", silk_width)
    l = "F.SilkS"
    w = silk_width
    out = []
    out.append(fp_line(nw, ne, l, w))
    out.append(fp_line(ne, se, l, w))
    out.append(fp_line(se, (1.27, se[1]), l, w))
    out.append(fp_line((-1.27, sw[1]), sw, l, w))
    out.append(fp_line(sw, nw, l, w))
    return out
def dil_silk(pins):
    nw, ne, se, sw, _ = draw_square(pins * 2.54, 2 * 2.54, (0, 0), "F.SilkS",
                                    silk_width)
    layer = "F.SilkS"
    w = silk_width
    out = []
    out.append(fp_line(nw, ne, layer, w))
    out.append(fp_line(ne, se, layer, w))
    out.append(fp_line(se, (1.27, se[1]), layer, w))
    out.append(fp_line((-1.27, sw[1]), sw, layer, w))
    out.append(fp_line(sw, nw, layer, w))
    return out
def top_smd_silk(pins):
    out = []
    w = silk_width
    lyr = "F.SilkS"
    box_w = (pins-1)*1.25 + 2*3.6 - 2*2.1 - silk_width
    box_h = 3.5  # XXX
    box_y = box_h/2 + 0.2
    nw, ne, se, sw, _ = draw_square(box_w, box_h, (0, box_y), lyr, w)
    out.append(fp_line((nw[0]+0.8, nw[1]), nw, lyr, w))
    out.append(fp_line(nw, sw, lyr, w))
    out.append(fp_line(sw, se, lyr, w))
    out.append(fp_line(se, ne, lyr, w))
    out.append(fp_line((ne[0]-0.8, ne[1]), ne, lyr, w))
    return out
def top_smd_silk(pins):
    out = []
    w = silk_width
    l = "F.SilkS"
    nw, ne, se, sw, _ = draw_square(2*pins+4, 5.7, (0, 3.35), l, w)
    # Top left corner
    out.append(fp_line((nw[0], nw[1]+2.4), (nw[0], nw[1]), l, w))
    out.append(fp_line((nw[0], nw[1]), (nw[0]+2.3, nw[1]), l, w))
    # Top right corner
    out.append(fp_line((ne[0], ne[1]+2.4), (ne[0], ne[1]), l, w))
    out.append(fp_line((ne[0], ne[1]), (ne[0]-2.3, ne[1]), l, w))
    # Bottom
    out.append(fp_line((sw[0]+1.8, sw[1]), (se[0]-1.8, se[1]), l, w))
    return out
Exemple #10
0
def side_smd_fab(pins):
    out = []
    w = fab_width

    # Draw outline
    nw, ne, se, sw, sq = draw_square(2 * pins + 4, 8.9, (0, -3.5), "F.Fab", w)
    out.append(fp_line(nw, (nw[0] + 3, nw[1]), "F.Fab", w))
    out.append(
        fp_line((nw[0] + 3, nw[1]), (nw[0] + 3, nw[1] + 1.4), "F.Fab", w))
    out.append(
        fp_line((nw[0] + 3, nw[1] + 1.4), (ne[0] - 3, ne[1] + 1.4), "F.Fab",
                w))
    out.append(
        fp_line((ne[0] - 3, ne[1] + 1.4), (ne[0] - 3, ne[1]), "F.Fab", w))
    out.append(fp_line((ne[0] - 3, ne[1]), ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, sw, "F.Fab", w))
    out.append(fp_line(sw, nw, "F.Fab", w))

    # Draw pins
    x = pins - 1
    for pin in range(pins):
        _, _, _, _, sq = draw_square(0.5, 2.5, (x, 2.5 / 2), "F.Fab", w)
        out += sq
        x -= 2
    return out
Exemple #11
0
def top_smd_silk(pins):
    out = []
    w = silk_width
    l = "F.SilkS"
    nw, ne, se, sw, _ = draw_square(2 * pins + 4, 5.7, (0, 3.35), l, w)
    # Top left corner
    out.append(fp_line((nw[0], nw[1] + 2.4), (nw[0], nw[1]), l, w))
    out.append(fp_line((nw[0], nw[1]), (nw[0] + 2.3, nw[1]), l, w))
    # Top right corner
    out.append(fp_line((ne[0], ne[1] + 2.4), (ne[0], ne[1]), l, w))
    out.append(fp_line((ne[0], ne[1]), (ne[0] - 2.3, ne[1]), l, w))
    # Bottom
    out.append(fp_line((sw[0] + 1.8, sw[1]), (se[0] - 1.8, se[1]), l, w))
    return out
Exemple #12
0
def fab(conf):
    """Generate a drawing of the chip on the Fab layer."""
    out = []
    cw, ch = conf['chip_shape']
    pw, ph = conf['pin_shape']
    w = fab_width

    # Chip body
    _, _, _, _, sq = draw_square(cw, ch, (0, 0), "F.Fab", w)
    out += sq

    # Pin 1 indicator
    if conf.get('silk') in ("triangle", "internal_pin1", "external_pin1"):
        out.append(fp_line(
            (-cw/4, -ch/2), (-cw/4, ch/2), "F.Fab", w))

    # Left pin
    out.append(fp_line((-cw/2 - pw, -ph/2), (-cw/2 - pw, ph/2), "F.Fab", w))
    if ph != ch:
        out.append(fp_line((-cw/2 - pw, -ph/2), (-cw/2, -ph/2), "F.Fab", w))
        out.append(fp_line((-cw/2 - pw, ph/2), (-cw/2, ph/2), "F.Fab", w))

    # Right pin
    out.append(fp_line((cw/2 + pw, -ph/2), (cw/2 + pw, ph/2), "F.Fab", w))
    if ph != ch:
        out.append(fp_line((cw/2 + pw, -ph/2), (cw/2, -ph/2), "F.Fab", w))
        out.append(fp_line((cw/2 + pw, ph/2), (cw/2, ph/2), "F.Fab", w))

    return out
Exemple #13
0
def fab(conf):
    """Generate a drawing of the chip on the Fab layer."""
    out = []
    cw, ch = conf['chip_shape']
    pw, ph = conf['pin_shape']
    w = fab_width

    # Chip body
    _, _, _, _, sq = draw_square(cw, ch, (0, 0), "F.Fab", w)
    out += sq

    # Pin 1 indicator
    if conf.get('silk') in ("triangle", "internal_pin1", "external_pin1"):
        out.append(fp_line(
            (-cw/4, -ch/2), (-cw/4, ch/2), "F.Fab", w))

    # Left pin
    out.append(fp_line((-cw/2 - pw, -ph/2), (-cw/2 - pw, ph/2), "F.Fab", w))
    if ph != ch:
        out.append(fp_line((-cw/2 - pw, -ph/2), (-cw/2, -ph/2), "F.Fab", w))
        out.append(fp_line((-cw/2 - pw, ph/2), (-cw/2, ph/2), "F.Fab", w))

    # Right pin
    out.append(fp_line((cw/2 + pw, -ph/2), (cw/2 + pw, ph/2), "F.Fab", w))
    if ph != ch:
        out.append(fp_line((cw/2 + pw, -ph/2), (cw/2, -ph/2), "F.Fab", w))
        out.append(fp_line((cw/2 + pw, ph/2), (cw/2, ph/2), "F.Fab", w))

    return out
def external_silk(conf):
    """
    Generate an external silkscreen.
    For two row devices: Horizontal lines top and bottom, semicircle pin 1
    For four row devices: Three sharp corners and a cut corner for pin 1
    """
    out = []

    rows = conf['rows']
    chip_shape = conf['chip_shape']
    w = silk_width
    l = "F.SilkS"
    x = chip_shape[0] / 2.0
    y = chip_shape[1] / 2.0

    if rows == 2:
        r = silk_pin1_er
        out.append(fp_line((-x + 2 * r, -y), (x, -y), l, w))
        out.append(fp_line((-x, y), (x, y), l, w))
        out.append(fp_arc((-x + r, -y), (-x, -y), 180, l, w))
    elif rows == 4:
        if 'pins_first_row' in conf:
            v_pins_per_row = conf['pins_first_row']
            h_pins_per_row = (conf['pins'] - 2 * v_pins_per_row) // 2
            pin_x = ((h_pins_per_row - 1) * conf['pin_pitch']) / 2.0
            pin_y = ((v_pins_per_row - 1) * conf['pin_pitch']) / 2.0
        else:
            pins_per_row = conf['pins'] / rows
            pin_x = pin_y = ((pins_per_row - 1) * conf['pin_pitch']) / 2.0
        dx = x - pin_x - silk_pad_egap
        dy = y - pin_y - silk_pad_egap

        # NW
        d_pin1 = min(dx, dy)
        out.append(fp_line((-x, -y + d_pin1), (-x + d_pin1, -y), l, w))
        # NE
        out.append(fp_line((x - dx, -y), (x, -y), l, w))
        out.append(fp_line((x, -y), (x, -y + dy), l, w))
        # SE
        out.append(fp_line((x - dx, y), (x, y), l, w))
        out.append(fp_line((x, y), (x, y - dy), l, w))
        # SW
        out.append(fp_line((-x + dx, y), (-x, y), l, w))
        out.append(fp_line((-x, y), (-x, y - dy), l, w))

    return out
Exemple #15
0
def external_silk(conf):
    """
    Generate an external silkscreen.
    For two row devices: Horizontal lines top and bottom, semicircle pin 1
    For four row devices: Three sharp corners and a cut corner for pin 1
    """
    out = []

    rows = conf['rows']
    chip_shape = conf['chip_shape']
    w = silk_width
    l = "F.SilkS"
    x = chip_shape[0]/2.0
    y = chip_shape[1]/2.0

    if rows == 2:
        r = silk_pin1_er
        out.append(fp_line((-x+2*r, -y), (x, -y), l, w))
        out.append(fp_line((-x, y), (x, y), l, w))
        out.append(fp_arc((-x+r, -y), (-x, -y), 180, l, w))
    elif rows == 4:
        if 'pins_first_row' in conf:
            v_pins_per_row = conf['pins_first_row']
            h_pins_per_row = (conf['pins'] - 2*v_pins_per_row) // 2
            pin_x = ((h_pins_per_row - 1) * conf['pin_pitch']) / 2.0
            pin_y = ((v_pins_per_row - 1) * conf['pin_pitch']) / 2.0
        else:
            pins_per_row = conf['pins'] / rows
            pin_x = pin_y = ((pins_per_row - 1) * conf['pin_pitch']) / 2.0
        dx = x - pin_x - silk_pad_egap
        dy = y - pin_y - silk_pad_egap

        # NW
        d_pin1 = min(dx, dy)
        out.append(fp_line((-x, -y+d_pin1), (-x+d_pin1, -y), l, w))
        # NE
        out.append(fp_line((x-dx, -y), (x, -y), l, w))
        out.append(fp_line((x, -y), (x, -y+dy), l, w))
        # SE
        out.append(fp_line((x-dx, y), (x, y), l, w))
        out.append(fp_line((x, y), (x, y-dy), l, w))
        # SW
        out.append(fp_line((-x+dx, y), (-x, y), l, w))
        out.append(fp_line((-x, y), (-x, y-dy), l, w))

    return out
Exemple #16
0
def internal_silk(conf):
    """
    Generate an internal silkscreen, with an outline of the part and a pin1
    indicator.
    """
    out = []

    pins = conf['pins']
    rows = conf['rows']
    pin_pitch = conf['pin_pitch']
    row_pitch = conf['row_pitch']
    pad_shape = conf['pad_shape']

    width = row_pitch - pad_shape[0] - 2 * silk_pad_igap
    if rows == 2:
        height = (((pins / rows) - 1) * pin_pitch)
    elif rows == 4:
        height = width

    ir = silk_pin1_ir
    if ir > width:
        ir = width

    c = (0, 0)
    layer = "F.SilkS"
    nw, ne, se, sw, sq = draw_square(width, height, c, layer, silk_width)
    out.append(fp_line((nw[0] + ir, nw[1]), ne, layer, silk_width))
    out.append(fp_line(ne, se, layer, silk_width))
    out.append(fp_line(se, sw, layer, silk_width))
    out.append(fp_line(sw, (nw[0], nw[1] + ir), layer, silk_width))
    start = (nw[0], nw[1] + ir)
    end = (nw[0] + ir, nw[1])
    out.append(fp_line(start, end, "F.SilkS", silk_width))

    # Old circular pin1 indicator:
    # out += sq
    # start = nw
    # end = (start[0] + silk_pin1_ir, start[1])
    # out.append(fp_arc(start, end, 90, "F.SilkS", silk_width))

    return out
Exemple #17
0
def internal_silk(conf):
    """
    Generate an internal silkscreen, with an outline of the part and a pin1
    indicator.
    """
    out = []

    pins = conf['pins']
    rows = conf['rows']
    pin_pitch = conf['pin_pitch']
    row_pitch = conf['row_pitch']
    pad_shape = conf['pad_shape']

    width = row_pitch - pad_shape[0] - 2 * silk_pad_igap
    if rows == 2:
        height = (((pins / rows) - 1) * pin_pitch)
    elif rows == 4:
        height = width

    ir = silk_pin1_ir
    if ir > width:
        ir = width

    c = (0, 0)
    layer = "F.SilkS"
    nw, ne, se, sw, sq = draw_square(width, height, c, layer, silk_width)
    out.append(fp_line((nw[0] + ir, nw[1]), ne, layer, silk_width))
    out.append(fp_line(ne, se, layer, silk_width))
    out.append(fp_line(se, sw, layer, silk_width))
    out.append(fp_line(sw, (nw[0], nw[1] + ir), layer, silk_width))
    start = (nw[0], nw[1] + ir)
    end = (nw[0] + ir, nw[1])
    out.append(fp_line(start, end, "F.SilkS", silk_width))

    # Old circular pin1 indicator:
    # out += sq
    # start = nw
    # end = (start[0] + silk_pin1_ir, start[1])
    # out.append(fp_arc(start, end, 90, "F.SilkS", silk_width))

    return out
def side_pth_silk(pins):
    out = []
    w = silk_width
    centre = (0, -2.35)
    nw, ne, se, sw, _ = draw_square(2*(pins-1)+4, 11.7, centre, "F.SilkS", w)
    out.append(fp_line(nw, ne, "F.SilkS", w))
    out.append(fp_line(ne, se, "F.SilkS", w))
    out.append(fp_line(se, (se[0]-1, se[1]), "F.SilkS", w))
    out.append(fp_line((se[0]-1, se[1]), (se[0]-1, se[1]-4), "F.SilkS", w))
    out.append(fp_line(nw, sw, "F.SilkS", w))
    out.append(fp_line(sw, (sw[0]+1, sw[1]), "F.SilkS", w))
    out.append(fp_line((sw[0]+1, sw[1]), (sw[0]+1, sw[1]-4), "F.SilkS", w))
    return out
Exemple #19
0
def side_pth_silk(pins):
    out = []
    w = silk_width
    centre = (0, -2.6)
    nw, ne, se, sw, _ = draw_square(2.5*(pins-1)+5, 8.2, centre, "F.SilkS", w)
    out.append(fp_line(nw, ne, "F.SilkS", w))
    out.append(fp_line(ne, se, "F.SilkS", w))
    out.append(fp_line(se, (se[0]-1, se[1]), "F.SilkS", w))
    out.append(fp_line((se[0]-1, se[1]), (se[0]-1, se[1]-2.2), "F.SilkS", w))
    out.append(fp_line(nw, sw, "F.SilkS", w))
    out.append(fp_line(sw, (sw[0]+1, sw[1]), "F.SilkS", w))
    out.append(fp_line((sw[0]+1, sw[1]), (sw[0]+1, sw[1]-2.2), "F.SilkS", w))
    return out
Exemple #20
0
def external_silk(conf):
    """
    Generate an external silkscreen.
    For two row devices: Horizontal lines top and bottom, semicircle pin 1
    For four row devices: Three sharp corners and a cut corner for pin 1
    """
    out = []

    rows = conf['rows']
    chip_shape = conf['chip_shape']
    w = silk_width
    l = "F.SilkS"
    x = chip_shape[0] / 2.0
    y = chip_shape[1] / 2.0

    if rows == 2:
        r = silk_pin1_er
        out.append(fp_line((-x + 2 * r, -y), (x, -y), l, w))
        out.append(fp_line((-x, y), (x, y), l, w))
        out.append(fp_arc((-x + r, -y), (-x, -y), 180, l, w))
    elif rows == 4:
        pins = conf['pins'] / rows
        pin_y = ((pins - 1) * conf['pin_pitch']) / 2.0
        chip_y = chip_shape[1] / 2.0
        delta_y = chip_y - pin_y
        r = delta_y - silk_pad_egap

        # NW
        out.append(fp_line((-x, -y + r), (-x + r, -y), l, w))
        # NE
        out.append(fp_line((x - r, -y), (x, -y), l, w))
        out.append(fp_line((x, -y), (x, -y + r), l, w))
        # SE
        out.append(fp_line((x - r, y), (x, y), l, w))
        out.append(fp_line((x, y), (x, y - r), l, w))
        # SW
        out.append(fp_line((-x + r, y), (-x, y), l, w))
        out.append(fp_line((-x, y), (-x, y - r), l, w))

    return out
Exemple #21
0
def external_silk(conf):
    """
    Generate an external silkscreen.
    For two row devices: Horizontal lines top and bottom, semicircle pin 1
    For four row devices: Three sharp corners and a cut corner for pin 1
    """
    out = []

    rows = conf['rows']
    chip_shape = conf['chip_shape']
    w = silk_width
    l = "F.SilkS"
    x = chip_shape[0]/2.0
    y = chip_shape[1]/2.0

    if rows == 2:
        r = silk_pin1_er
        out.append(fp_line((-x+2*r, -y), (x, -y), l, w))
        out.append(fp_line((-x, y), (x, y), l, w))
        out.append(fp_arc((-x+r, -y), (-x, -y), 180, l, w))
    elif rows == 4:
        pins = conf['pins'] / rows
        pin_y = ((pins - 1) * conf['pin_pitch']) / 2.0
        chip_y = chip_shape[1] / 2.0
        delta_y = chip_y - pin_y
        r = delta_y - silk_pad_egap

        # NW
        out.append(fp_line((-x, -y+r), (-x+r, -y), l, w))
        # NE
        out.append(fp_line((x-r, -y), (x, -y), l, w))
        out.append(fp_line((x, -y), (x, -y+r), l, w))
        # SE
        out.append(fp_line((x-r, y), (x, y), l, w))
        out.append(fp_line((x, y), (x, y-r), l, w))
        # SW
        out.append(fp_line((-x+r, y), (-x, y), l, w))
        out.append(fp_line((-x, y), (-x, y-r), l, w))

    return out
def tfml_silk(pins):
    out = []
    l = "F.SilkS"
    w = silk_width
    nw, ne, se, sw, _ = draw_square(pins * 1.27 + 3.18 - w, 5.72 - w, (0, 0),
                                    l, w)
    out.append(fp_line((nw[0] + 1.5, nw[1]), nw, l, w))
    out.append(fp_line(nw, sw, l, w))
    out.append(fp_line(sw, (sw[0] + 1.5, sw[1]), l, w))
    out.append(fp_line((se[0] - 1.5, se[1]), (se[0], se[1] - 1.5), l, w))
    out.append(fp_line((se[0], se[1] - 1.5), (ne[0], ne[1] + 1.5), l, w))
    out.append(fp_line((ne[0], ne[1] + 1.5), (ne[0] - 1.5, ne[1]), l, w))
    return out
def tfml_silk(pins):
    out = []
    l = "F.SilkS"
    w = silk_width
    nw, ne, se, sw, _ = draw_square(
        pins * 1.27 + 3.18 - w, 5.72 - w, (0, 0), l, w)
    out.append(fp_line((nw[0]+1.5, nw[1]), nw, l, w))
    out.append(fp_line(nw, sw, l, w))
    out.append(fp_line(sw, (sw[0]+1.5, sw[1]), l, w))
    out.append(fp_line((se[0]-1.5, se[1]), (se[0], se[1]-1.5), l, w))
    out.append(fp_line((se[0], se[1]-1.5), (ne[0], ne[1]+1.5), l, w))
    out.append(fp_line((ne[0], ne[1]+1.5), (ne[0]-1.5, ne[1]), l, w))
    return out
def side_pth_fab(pins):
    out = []
    w = fab_width
    centre = (0, -2.6)

    # Draw outline
    nw, ne, se, sw, _ = draw_square(2.5*(pins-1)+5, 8.2, centre, "F.Fab", w)
    out.append(fp_line(nw, ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, (se[0]-1, se[1]), "F.Fab", w))
    out.append(fp_line((se[0]-1, se[1]), (se[0]-1, se[1]-2.2), "F.Fab", w))
    out.append(fp_line((se[0]-1, se[1]-2.2), (sw[0]+1, sw[1]-2.2), "F.Fab", w))
    out.append(fp_line(nw, sw, "F.Fab", w))
    out.append(fp_line(sw, (sw[0]+1, sw[1]), "F.Fab", w))
    out.append(fp_line((sw[0]+1, sw[1]), (sw[0]+1, sw[1]-2.2), "F.Fab", w))

    # Draw the pins
    x = 1.25*(pins - 1)
    for pin in range(pins):
        sq = draw_square(0.5, 0.75, (x, -0.125), "F.Fab", fab_width)
        out += sq[4]
        out.append(fp_line((x-.25, -.25), (x+.25, -.25), "F.Fab", fab_width))
        x -= 2.5
    return out
def side_smd_fab(pins):
    out = []
    w = fab_width

    # Draw outline
    nw, ne, se, sw, sq = draw_square(2*pins+4, 8.9, (0, -3.5), "F.Fab", w)
    out.append(fp_line(nw, (nw[0]+3, nw[1]), "F.Fab", w))
    out.append(fp_line((nw[0]+3, nw[1]), (nw[0]+3, nw[1]+1.4), "F.Fab", w))
    out.append(fp_line((nw[0]+3, nw[1]+1.4), (ne[0]-3, ne[1]+1.4), "F.Fab", w))
    out.append(fp_line((ne[0]-3, ne[1]+1.4), (ne[0]-3, ne[1]), "F.Fab", w))
    out.append(fp_line((ne[0]-3, ne[1]), ne, "F.Fab", w))
    out.append(fp_line(ne, se, "F.Fab", w))
    out.append(fp_line(se, sw, "F.Fab", w))
    out.append(fp_line(sw, nw, "F.Fab", w))

    # Draw pins
    x = pins - 1
    for pin in range(pins):
        _, _, _, _, sq = draw_square(0.5, 2.5, (x, 2.5/2), "F.Fab", w)
        out += sq
        x -= 2
    return out
Exemple #26
0
def pin1_silk(conf):
    """Draw a small pin1 indicator on the silkscreen."""
    w = conf['pitch'] - conf['pad_shape'][0] - 2*silk_pad_igap
    h = conf['chip_shape'][1] - silk_width
    return [fp_line((-w/4, -h/2), (-w/4, h/2), "F.SilkS", silk_width)]
def sfml_silk(pins):
    out = []
    l = "F.SilkS"
    w = silk_width
    a_x = (3.94 - 0.38) / 2.0
    a_y = (3.05 - 1.52) / 2.0
    nw, ne, se, sw, _ = draw_square(pins * 1.27 + 0.38 - w, 3.05 - w, (0, 0),
                                    l, w)

    out.append(fp_line(ne, (ne[0], ne[1] + a_y), l, w))
    out.append(fp_line((ne[0], ne[1] + a_y), (ne[0] + a_x, ne[1] + a_y), l, w))
    out.append(
        fp_line((ne[0] + a_x, ne[1] + a_y), (se[0] + a_x, se[1] - a_y), l, w))
    out.append(fp_line((se[0] + a_x, se[1] - a_y), (se[0], se[1] - a_y), l, w))
    out.append(fp_line((se[0], se[1] - a_y), se, l, w))
    out.append(fp_line(se, (se[0] - 0.3, se[1]), l, w))

    out.append(fp_line((sw[0] + 0.3, sw[1]), sw, l, w))
    out.append(fp_line(sw, (sw[0], sw[1] - a_y), l, w))
    out.append(fp_line((sw[0], sw[1] - a_y), (sw[0] - a_x, sw[1] - a_y), l, w))
    out.append(
        fp_line((sw[0] - a_x, sw[1] - a_y), (nw[0] - a_x, nw[1] + a_y), l, w))
    out.append(fp_line((nw[0] - a_x, nw[1] + a_y), (nw[0], nw[1] + a_y), l, w))
    out.append(fp_line((nw[0], nw[1] + a_y), nw, l, w))
    return out
def sfml_fab(pins):
    out = []
    l = "F.Fab"
    w = fab_width
    a_x = (3.94 - 0.38) / 2.0
    a_y = (3.05 - 1.52) / 2.0
    nw, ne, se, sw, _ = draw_square(pins * 1.27 + 0.38, 3.05, (0, 0), l, w)
    out.append(fp_line(nw, ne, l, w))
    out.append(fp_line(ne, (ne[0], ne[1] + a_y), l, w))
    out.append(fp_line((ne[0], ne[1] + a_y), (ne[0] + a_x, ne[1] + a_y), l, w))
    out.append(
        fp_line((ne[0] + a_x, ne[1] + a_y), (se[0] + a_x, se[1] - a_y), l, w))
    out.append(fp_line((se[0] + a_x, se[1] - a_y), (se[0], se[1] - a_y), l, w))
    out.append(fp_line((se[0], se[1] - a_y), se, l, w))
    out.append(fp_line(se, sw, l, w))
    out.append(fp_line(sw, (sw[0], sw[1] - a_y), l, w))
    out.append(fp_line((sw[0], sw[1] - a_y), (sw[0] - a_x, sw[1] - a_y), l, w))
    out.append(
        fp_line((sw[0] - a_x, sw[1] - a_y), (nw[0] - a_x, nw[1] + a_y), l, w))
    out.append(fp_line((nw[0] - a_x, nw[1] + a_y), (nw[0], nw[1] + a_y), l, w))
    out.append(fp_line((nw[0], nw[1] + a_y), nw, l, w))
    return out
def kk_fab(pins):
    w = fab_width
    nw, ne, se, sw, sq = draw_square(pins * 2.54, 6.35, (0, 0), "F.Fab", w)
    sq.append(fp_line((nw[0], nw[1] + 2.0), (ne[0], ne[1] + 2.0), "F.Fab", w))
    return sq
def kk_silk(pins):
    w = silk_width
    nw, ne, se, sw, sq = draw_square(pins * 2.54, 6.35, (0, 0), "F.SilkS", w)
    sq.append(fp_line((nw[0], nw[1] + 2.0), (ne[0], ne[1] + 2.0), "F.SilkS",
                      w))
    return sq
Exemple #31
0
def side_smd_silk(pins):
    out = []
    w = silk_width
    l = "F.SilkS"
    nw, ne, se, sw, _ = draw_square(2 * pins + 4, 8.9, (0, -3.5), l, w)
    out.append(fp_line(nw, (nw[0] + 3, nw[1]), l, w))
    out.append(fp_line((nw[0] + 3, nw[1]), (nw[0] + 3, nw[1] + 1.4), l, w))
    out.append(
        fp_line((nw[0] + 3, nw[1] + 1.4), (ne[0] - 3, ne[1] + 1.4), l, w))
    out.append(fp_line((ne[0] - 3, ne[1] + 1.4), (ne[0] - 3, ne[1]), l, w))
    out.append(fp_line((ne[0] - 3, ne[1]), ne, l, w))
    out.append(fp_line(ne, (ne[0], ne[1] + 2.8 - w), l, w))
    out.append(fp_line(nw, (nw[0], nw[1] + 2.8 - w), l, w))
    out.append(fp_line(se, (se[0], se[1] - 2.3 + w), l, w))
    out.append(fp_line(se, (se[0] - 1.8, se[1]), l, w))
    out.append(fp_line(sw, (sw[0], sw[1] - 2.3 + w), l, w))
    out.append(fp_line(sw, (sw[0] + 1.8, sw[1]), l, w))
    return out
Exemple #32
0
def pin1_silk(conf):
    """Draw a small pin1 indicator on the silkscreen."""
    w = conf['pitch'] - conf['pad_shape'][0] - 2*silk_pad_igap
    h = conf['chip_shape'][1] - silk_width
    return [fp_line((-w/4, -h/2), (-w/4, h/2), "F.SilkS", silk_width)]
def sfml_silk(pins):
    out = []
    l = "F.SilkS"
    w = silk_width
    a_x = (3.94 - 0.38) / 2.0
    a_y = (3.05 - 1.52) / 2.0
    nw, ne, se, sw, _ = draw_square(
        pins * 1.27 + 0.38 - w, 3.05 - w, (0, 0), l, w)

    out.append(fp_line(ne, (ne[0], ne[1]+a_y), l, w))
    out.append(fp_line((ne[0], ne[1]+a_y), (ne[0]+a_x, ne[1]+a_y), l, w))
    out.append(fp_line((ne[0]+a_x, ne[1]+a_y), (se[0]+a_x, se[1]-a_y), l, w))
    out.append(fp_line((se[0]+a_x, se[1]-a_y), (se[0], se[1]-a_y), l, w))
    out.append(fp_line((se[0], se[1]-a_y), se, l, w))
    out.append(fp_line(se, (se[0]-0.3, se[1]), l, w))

    out.append(fp_line((sw[0]+0.3, sw[1]), sw, l, w))
    out.append(fp_line(sw, (sw[0], sw[1]-a_y), l, w))
    out.append(fp_line((sw[0], sw[1]-a_y), (sw[0]-a_x, sw[1]-a_y), l, w))
    out.append(fp_line((sw[0]-a_x, sw[1]-a_y), (nw[0]-a_x, nw[1]+a_y), l, w))
    out.append(fp_line((nw[0]-a_x, nw[1]+a_y), (nw[0], nw[1]+a_y), l, w))
    out.append(fp_line((nw[0], nw[1]+a_y), nw, l, w))
    return out
def sfml_fab(pins):
    out = []
    l = "F.Fab"
    w = fab_width
    a_x = (3.94 - 0.38) / 2.0
    a_y = (3.05 - 1.52) / 2.0
    nw, ne, se, sw, _ = draw_square(
        pins * 1.27 + 0.38, 3.05, (0, 0), l, w)
    out.append(fp_line(nw, ne, l, w))
    out.append(fp_line(ne, (ne[0], ne[1]+a_y), l, w))
    out.append(fp_line((ne[0], ne[1]+a_y), (ne[0]+a_x, ne[1]+a_y), l, w))
    out.append(fp_line((ne[0]+a_x, ne[1]+a_y), (se[0]+a_x, se[1]-a_y), l, w))
    out.append(fp_line((se[0]+a_x, se[1]-a_y), (se[0], se[1]-a_y), l, w))
    out.append(fp_line((se[0], se[1]-a_y), se, l, w))
    out.append(fp_line(se, sw, l, w))
    out.append(fp_line(sw, (sw[0], sw[1]-a_y), l, w))
    out.append(fp_line((sw[0], sw[1]-a_y), (sw[0]-a_x, sw[1]-a_y), l, w))
    out.append(fp_line((sw[0]-a_x, sw[1]-a_y), (nw[0]-a_x, nw[1]+a_y), l, w))
    out.append(fp_line((nw[0]-a_x, nw[1]+a_y), (nw[0], nw[1]+a_y), l, w))
    out.append(fp_line((nw[0], nw[1]+a_y), nw, l, w))
    return out
def side_smd_silk(pins):
    out = []
    w = silk_width
    l = "F.SilkS"
    nw, ne, se, sw, _ = draw_square(2*pins+4, 8.9, (0, -3.5), l, w)
    out.append(fp_line(nw, (nw[0]+3, nw[1]), l, w))
    out.append(fp_line((nw[0]+3, nw[1]), (nw[0]+3, nw[1]+1.4), l, w))
    out.append(fp_line((nw[0]+3, nw[1]+1.4), (ne[0]-3, ne[1]+1.4), l, w))
    out.append(fp_line((ne[0]-3, ne[1]+1.4), (ne[0]-3, ne[1]), l, w))
    out.append(fp_line((ne[0]-3, ne[1]), ne, l, w))
    out.append(fp_line(ne, (ne[0], ne[1]+2.8-w), l, w))
    out.append(fp_line(nw, (nw[0], nw[1]+2.8-w), l, w))
    out.append(fp_line(se, (se[0], se[1]-2.3+w), l, w))
    out.append(fp_line(se, (se[0]-1.8, se[1]), l, w))
    out.append(fp_line(sw, (sw[0], sw[1]-2.3+w), l, w))
    out.append(fp_line(sw, (sw[0]+1.8, sw[1]), l, w))
    return out