Exemplo n.º 1
0
Arquivo: mlp.py Projeto: bert/pscad
def part(m):
    m = pscad.wrapper(defaults.items() + m.items())

    thermal_size = (m.thermal_x, m.thermal_y)
    row = mlp_row(m, m.n / (4 if m.quad else 2))

    if m.quad:
        pads = (
            row, pscad.rotate(90) + row,
            pscad.rotate(180) + row, pscad.rotate(270) + row
        )
    else:
        pads = row, pscad.rotate(180) + row

    all = pscad.pad(itertools.count(1), m.clearance, m.mask) + (
        pads,
        patterns.thermal_pad(patterns.indent_pad(thermal_size, m.indent),
                thermal_size, m.paste_fraction, m.paste_max)
    ), pscad.silk(m.silk) + patterns.corners((m.body_x, m.body_y), m.pad_l, center=True)

    silk = pscad.silk(m.silk) + (
        patterns.placement_courtyard(all, m.placement, m.grid, m.pad_w * D(2)),

        pscad.translate([-m.body_x / D(2), m.body_y / D(2)]) +
        pscad.down(m.silk * D(2)) +
        pscad.line(m.pad_l * D("0.7"))
    )

    return all, silk
Exemplo n.º 2
0
Arquivo: header.py Projeto: bert/pscad
def part(m):
    m = pscad.wrapper(defaults.items() + m.items())

    row = pscad.row(pscad.donut(m.drill_d / D(2), m.drill_d / D(2) + m.annulus), m.pitch, m.n_x, center=True)
    all = pscad.pin(itertools.count(1), m.clearance, m.mask) + (
        pscad.rotate(270) + pscad.row(pscad.rotate(90) + row, m.pitch, m.n_y, center=True)
    )

    silk = pscad.silk(m.silk) + (
        patterns.corners((m.n_x * m.pitch, m.n_y * m.pitch), m.pitch / D(4), center=True)
    )

    return all, silk
Exemplo n.º 3
0
def part(m):
    m = pscad.wrapper(defaults.items() + m.items())

    if 'pads_x' in m:
        pads_x = m.pads_x
    elif m.quad:
        pads_x = m.n / 4
    else:
        pads_x = 0
    pads_y = m.n / 2 - pads_x

    if 'width' in m:
        width = m.width
    else:
        width = m.height

    thermal_size = (m.thermal_x, m.thermal_y)
    row_y = mlp_row(m, pads_y, m.height)

    if m.quad:
        row_x = mlp_row(m, pads_x, width)
        pads = (
            row_y, pscad.rotate(90) + row_x,
            pscad.rotate(180) + row_y, pscad.rotate(270) + row_x
        )
    else:
        pads = row_y, pscad.rotate(180) + row_y

    pin_list = range(m.start_pin, m.n - m.start_pin + 3) + range(1, m.start_pin) + [int(m.n) + 1]
    all = pscad.pad(itertools.cycle(pin_list), m.clearance, m.mask) + (
        pads,
        patterns.thermal_pad(patterns.indent_pad(thermal_size, m.indent),
                thermal_size, m.paste_fraction, m.paste_max)
    ), pscad.silk(m.silk) + patterns.corners((m.body_x, m.body_y), m.pad_l, center=True)

    silk = pscad.silk(m.silk) + (
        patterns.placement_courtyard(all, m.placement, m.grid, m.pad_w * 2),

        pscad.translate([-m.body_x / 2, m.body_y / 2]) +
        pscad.down(m.silk * 2) +
        pscad.line(m.pad_l * D("0.7"))
    )

    return all, silk