Esempio n. 1
0
def part(m):
    m = pscad.wrapper(defaults.items() + m.items())

    pin_names = (i for i in m.pins.split(','))

    all = pscad.pad(pin_names, m.clearance, m.mask) + (
        pscad.row(pscad.rounded_square((m.pad_w, m.pad_l), m.round_off, center=True), m.pitch, 2, center=True)
    )

    if 'body_y' in m:
        body_lines = pscad.rotate(90) + pscad.row(pscad.rotate(90) + pscad.line(m.pitch, center=True), m.body_y, 2, center=True)
    else:
        body_lines = pscad.empty()

    courtyard = pscad.expand_to_grid(pscad.bound((all, body_lines)), m.placement, m.grid)
    courtyard_sz = (courtyard[1][0] - courtyard[0][0], courtyard[1][1] - courtyard[0][1])

    if m.polarized:
        mark = (
            pscad.right(courtyard[0][0]) +
            pscad.rotate(90) +
            pscad.circle(courtyard_sz[1] / D(6), sweep=180)
        )
    else:
        mark = pscad.empty()

    silk = pscad.silk(m.silk) + (
        pscad.translate(courtyard[0]) +
        patterns.brackets(courtyard_sz, m.pad_w),
        mark,
        body_lines
    )

    return all, silk
Esempio n. 2
0
def part(m):
    m = pscad.wrapper(defaults.items() + m.items())

    row = pscad.row(pscad.rounded_square([m.l, m.w], m.round_off, center=True), m.a + m.l, 2, center=True)
    all = pscad.pad(itertools.count(1), m.clearance, m.mask) + (
        pscad.rotate(270) +
        pscad.row(pscad.rotate(90) + row, m.b + m.w, 2, center=True)
    )

    courtyard = pscad.expand_to_grid(pscad.bound(all), m.placement, m.grid)
    courtyard_sz = (courtyard[1][0] - courtyard[0][0], courtyard[1][1] - courtyard[0][1])
    silk = pscad.silk(m.silk) + (
        pscad.translate(courtyard[0]) +
        patterns.brackets(courtyard_sz, m.l)
    )

    return all, silk
Esempio n. 3
0
def placement_courtyard(obj, placement, grid, sz):
    courtyard = pscad.expand_to_grid(pscad.bound(obj), placement, grid)
    courtyard_sz = (courtyard[1][0] - courtyard[0][0], courtyard[1][1] - courtyard[0][1])
    return pscad.translate(courtyard[0]) + corners(courtyard_sz, sz),