def part(m): m = pscad.wrapper(defaults.items() + m.items()) if 'skip' in m: skip = lambda name: re.match(m.skip, name) else: skip = None bga_pad = pscad.paste_fraction( pscad.circle(m.pad_size / 2), m.paste_fraction) row = pscad.row(bga_pad, m.pitch, m.n_x, center=True) all = (pscad.pad( bga_names(m.n_x, m.no_letter), m.clearance, m.mask, skip=skip) + pscad.rotate(270) + pscad.row( pscad.rotate(90) + row, m.pitch, m.n_y, center=True), pscad.silk(m.silk) + pscad.square( (m.body_x, m.body_y), center=True)) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1), pscad.translate([-m.body_x / 2, -m.pitch * (m.n_y - 1) / 2]) + pscad.left(m.silk * 2) + pscad.line([0, m.pitch * 2], center=True)) if m.invert: return pscad.mirror([1, 0]) + pscad.rotate(270) + (all, silk) return all, silk
def mlp_pad(m): pad = pscad.union() + ( pscad.down(m.pad_l / 2 - m.rounding) + pscad.square((m.pad_w, m.rounding * 2), rounded=True, center=True), pscad.up((m.pad_l - m.pad_w) / 2) + pscad.circle(m.pad_w / 2) + pscad.left(m.pad_w / 2) + pscad.square((m.pad_w, m.pad_l - m.rounding - m.pad_w / 2)) ) if 'pad_paste_fraction' in m: return pscad.paste_fraction(pad, (1,m.pad_paste_fraction)) else: return pad
def part(m): m = pscad.wrapper(defaults.items() + m.items()) pitch = D("1.27") width = D("6.61") pad_size0 = [D("0.61"), D("1.27")] pad_size1 = [D("0.61"), D("1.02")] pad_size2 = [D("1.65"), D("3.81")] body = [D("5.0"), D("6.25")] thermal_pad = pscad.paste_fraction(pscad.rounded_square(pad_size2, m.round_off, center=True), D("0.5")) all = ( pscad.pad(itertools.count(1), m.clearance, m.mask) + pscad.down((width - pad_size0[1]) / D(2)) + pscad.row(pscad.rounded_square(pad_size0, m.round_off, center=True), pitch, 4, center=True), pscad.pad((i for i in [6, 6, 5, 5]), m.clearance, m.mask) + pscad.up((width - pad_size1[1]) / D(2)) + pscad.row(pscad.rounded_square(pad_size1, m.round_off, center=True), pitch, 4, center=True), pscad.pad((i for i in [6, 5]), m.clearance, m.mask) + pscad.down(width / D(2)) + pscad.up(pad_size0[1] + D("0.82") + pad_size2[1] / D(2)) + pscad.row(thermal_pad, D("0.61") + pad_size2[0], 2, center=True), pscad.silk(m.silk) + patterns.brackets(body, D("0.2"), center=True) ) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, D("0.5")), pscad.down(width / D(2) + m.silk) + pscad.left(pitch * D("1.5")) + pscad.line(pad_size0[0], center=True) ) return all, silk
def part(m): m = pscad.wrapper(defaults.items() + m.items()) try: pin_count = m.n pin_names = itertools.count(1) except: pin_count = len(m.pins.split(',')) pin_names = (i for i in m.pins.split(',')) if 'pads_x' in m: pads_x = m.pads_x elif m.quad: pads_x = pin_count / 4 else: pads_x = 0 pads_y = pin_count / 2 - pads_x try: body_y = m.body_y except: body_y = m.width - m.pad_l - m.silk * 3 if 'height' in m: height = m.height else: height = m.width pad = pscad.rounded_square((m.pad_w, m.pad_l), m.round_off, center=True) row_y = pscad.down(m.width / 2) + pscad.row( pscad.paste_fraction(pad, (1,m.pad_paste_fraction)), m.pitch, pads_y, center=True) if m.quad: row_x = pscad.down(height / 2) + pscad.row( pscad.paste_fraction(pad, (1,m.pad_paste_fraction)), m.pitch, pads_x, center=True) pads = pscad.pad(pin_names, m.clearance, m.mask) + ( row_y, pscad.rotate(90) + row_x, pscad.rotate(180) + row_y, pscad.rotate(270) + row_x ) else: pads = pscad.pad(pin_names, m.clearance, m.mask) + ( row_y, pscad.rotate(180) + row_y ) try: if m.quad: raise Exception() if body_y > m.width - m.pad_l - m.silk * 2: edge = m.body_x / 2 - m.pitch * D(pin_count) / 4 body = patterns.brackets([m.body_x, body_y], edge, center=True) else: body = pscad.square([m.body_x, body_y], center=True) all = pads, pscad.silk(m.silk) + body except: all = pads try: corners = m.corners except: corners = m.pad_w * 2 silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, corners), pscad.down(m.width / 2) + pscad.left(m.silk + m.pitch * pads_y / 2) + pscad.line([0, m.pad_l * D("0.7")], center=True) ) return all, silk