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
def part(m): m = pscad.wrapper(defaults.items() + m.items()) pin2 = pscad.donut(D("0.65"), D("0.85")) pin13 = pscad.donut(D("0.5"), D("0.7")) pins = pscad.down(D("11.5") / 2) + pscad.right(D("11.0") / 2) + pscad.left(D("4.5")) + ( pscad.up(D("8.6")) + ( pscad.left(D("3.8")) + pscad.pin("1", m.clearance, m.mask) + pin13, pscad.left(D("0.5")) + pscad.pin("3", m.clearance, m.mask) + pin13, ), pscad.up(D("9.0")) + ( pscad.right(D("3.5")) + pscad.pin("2", m.clearance, m.mask) + pin2, ), pscad.up(D("1.5")) + ( pscad.hole(m.clearance, 0) + pscad.circle(D("0.9")) ), ) all = ( pins, pscad.silk(m.silk) + pscad.square((D("11.0"), D("11.5")), center=True) ) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1), ) return all, silk
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 part(m): m = pscad.wrapper(defaults.items() + m.items()) row = pscad.row(pscad.donut(D("1.8") / D(2), D("1.8") / D(2) + D("0.5")), D("4.2"), 3) all = ( pscad.pin(itertools.count(1), m.clearance, m.mask) + ( row, pscad.down(D("4.2")) + row ), pscad.hole(m.clearance, 0) + ( pscad.up(D("7.30")) + pscad.row(pscad.circle(D("3.0") / D(2)), D("8.4"), 2) ), pscad.silk(m.silk) + ( pscad.right(D("4.2")) + pscad.up(D("7.3") + D("6.6") - D("12.8") / D("2")) + pscad.square((D("13.8"), D("12.8")), center=True) ) ) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1), pscad.right(D("4.2") - D("4") / D(2)) + pscad.up(D("7.3") + D("6.6")) + pscad.square((D("4"), D("3.5"))) ) return all, silk
def part(m): m = pscad.wrapper(defaults.items() + m.items()) pad1 = pscad.rounded_square([D("0.7"), D("2.0")], m.round_off, center=True) pad1_row1 = pscad.pad(itertools.count(1, 2), m.clearance, m.mask) + ( pscad.row(pad1, 1, (m.n + 1) / 2, center=True) ) pad1_row2 = pscad.pad(itertools.count(2, 2), m.clearance, m.mask) + ( pscad.row(pad1, 1, (m.n - 1) / 2, center=True) ) pad2 = pscad.rounded_square([D("1.3"), D("3.4")], m.round_off, center=True) pad2_row = pscad.pad(m.n + 1, m.clearance, m.mask) + ( pscad.row(pad2, (m.n - 1) / D(2) + D("5.7"), 2, center=True) ) bore = pscad.hole(m.clearance, 0) + pscad.circle(D("1.3") / 2) bore_row = pscad.row(bore, (m.n - 1) / D(2) + D("3.1"), 2, center = True) # Reverse up/down for plug/receptacle pads = ( bore_row, pscad.up(D("2.5")) + pad1_row1, pscad.down(D("2.5")) + pad1_row2, pad2_row, bore_row ) all = pads silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1) ) return all, silk
def part(m): m = pscad.wrapper(defaults.items() + m.items()) pad1 = pscad.rounded_square([D("0.7"), D("1.5")], m.round_off, center=True) pad1_row = pscad.pad(itertools.count(1), m.clearance, m.mask) + ( pscad.row(pad1, D("1.5"), 6, center=True) ) pad2 = pscad.rounded_square([D("0.8"), 1], m.round_off, center=True) pad2_row = pscad.pad("7", m.clearance, m.mask) + ( pscad.rotate(90) + pscad.row(pad2, D("2.1"), 2, center=True) ) bore = pscad.hole(m.clearance, 0) + pscad.circle(D("0.9") / 2) bore_row = pscad.row(bore, 5, 2, center = True) pads = ( bore_row, pscad.up(1 + D("1.5") / 2) + pad1_row, pscad.left(D("11.8") / 2) + pad2_row, pscad.right(D("11.8") / 2) + pad2_row ) all = ( pads, pscad.silk(m.silk) + pscad.square((D("11.3"), D("2.6")), center=True) ) tick = pscad.line((0, D("0.5")), center=True) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1), pscad.down(D("1.3")) + pscad.row(tick, D("1.5"), 5, center=True) ) return all, silk
def mlp_pad(m): return pscad.union() + ( pscad.down(m.pad_l / D(2) - m.round_off) + pscad.square((m.pad_w, m.round_off * D(2)), rounded=True, center=True), pscad.up((m.pad_l - m.pad_w) / D(2)) + pscad.circle(m.pad_w / D(2)) + pscad.left(m.pad_w / D(2)) + pscad.square((m.pad_w, m.pad_l - m.round_off - m.pad_w / D(2))) )
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()) pin_row = pscad.row(pscad.donut(m.drill_r, m.drill_r + m.annulus), m.pitch, m.n / 2, center=True) pins = pscad.pin(itertools.count(1), m.clearance, m.mask, square=True) + ( pscad.down(m.width / 2) + pin_row, pscad.up(m.width / 2) + pscad.rotate(180) + pin_row ) length = m.pitch * (m.n + 1) / 2 silk = pscad.silk(m.silk) + ( pscad.square([length, m.width - (m.drill_r + m.annulus) * 2 - m.silk * 4], center=True), pscad.left(length / 2) + pscad.rotate(270) + pscad.circle(m.width / D(10), sweep=180) ) return pins, silk
def part(m): m = pscad.wrapper(defaults.items() + m.items()) pad_row = pscad.rotate(180) + pscad.row(pscad.rounded_square( (D("0.5"), D("2.0")), m.round_off, center=True), D("0.8"), 5, center=True) gnd_row = pscad.row(pscad.donut(I("0.034"), I("0.045")), D("5.3"), 2) side = ( pscad.pin("G", m.clearance, m.mask, square=True) + ( pscad.left(D("3.6")) + pscad.up(2) + pscad.rotate(-90) + gnd_row, ), pscad.hole(m.clearance, 0) + ( pscad.left(D("1.7")) + pscad.down(D("1.3")) + pscad.circle(I("0.018")) ), pscad.silk(m.silk) + ( pscad.left(D("3.6")) + pscad.up(D("4.6")) + pscad.polygon([(0, 0), (0, D("1.3")), (0, D("3.9")), (0, D("6.6"))], [(0, 1), (2, 3)]) ) ) all = ( pscad.pad(itertools.count(1), m.clearance, m.mask) + ( pscad.down(D("3.5")) + pad_row ), side + pscad.mirror([1, 0]) + side, pscad.silk(m.silk) + ( pscad.up(D("4.6")) + pscad.line(D("7.2"), center=True), ) ) silk = pscad.silk(m.silk) + ( patterns.placement_courtyard(all, m.placement, m.grid, 1), ) return all, silk