Example #1
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
    bga = 'cols' in conf

    if rows == 2 and not bga:
        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 or bga:
        if bga:
            dx = x // 2
            dy = y // 2
        else:
            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
        if bga:
            dp1 = 1.0
            out.append(fp_line((-x, -y + dy), (-x, -y + dp1), l, w))
            out.append(fp_line((-x, -y + dp1), (-x + dp1, -y), l, w))
            out.append(fp_line((-x + dx, -y), (-x + dp1, -y), l, w))
        else:
            dp1 = min(dx, dy)
            out.append(fp_line((-x, -y + dp1), (-x + dp1, -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
Example #2
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
Example #3
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
Example #4
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