def footprint(conf): tedit = format(int(time.time()), 'X') sexp = ["module", conf['name'], ("layer", "F.Cu"), ("tedit", tedit)] sexp += refs(conf) sexp += fab(conf) sexp += silk(conf) sexp += ctyd(conf) sexp += pads(conf) return sexp_generate(sexp)
def dil(pins): name = "DIL-254P-{:02d}".format(2 * pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += dil_pads(pins) sexp += dil_fab(pins) sexp += dil_silk(pins) sexp += dil_ctyd(pins) sexp += dil_refs(name) return name, sexp_generate(sexp)
def dil(pins): name = "DIL-254P-{:02d}".format(2*pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += dil_pads(pins) sexp += dil_fab(pins) sexp += dil_silk(pins) sexp += dil_ctyd(pins) sexp += dil_refs(name) return name, sexp_generate(sexp)
def side_pth_fp(pins): name = "S{:d}B-EH".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += side_pth_refs(name) sexp += side_pth_silk(pins) sexp += side_pth_fab(pins) sexp += side_pth_ctyd(pins) sexp += pth_pads(pins) return name, sexp_generate(sexp)
def side_smd_fp(pins): name = "SM{:02d}B-PASS".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += side_smd_refs(name) sexp += side_smd_silk(pins) sexp += side_smd_fab(pins) sexp += side_smd_ctyd(pins) sexp += side_smd_mount(pins) sexp += side_smd_pads(pins) return name, sexp_generate(sexp)
def top_pth_fp(pins): name = "B{:02d}B-PASK".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += top_pth_refs(name) sexp += top_pth_silk(pins) sexp += top_pth_fab(pins) sexp += top_pth_ctyd(pins) sexp += top_pth_mount(pins) sexp += pth_pads(pins) return name, sexp_generate(sexp)
def sil(pins): name = "SIL-254P-{:02d}".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += sil_pads(pins) sexp += fab(pins, 2.54) sexp += sil_silk(pins) sexp += ctyd(pins, 2.54) sexp += refs(name, 2.54) sexp += sil_model(pins) return name, sexp_generate(sexp)
def kk(pins): name = "MOLEX-KK-254P-{:02d}".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += sil_pads(pins) sexp += kk_fab(pins) sexp += kk_silk(pins) sexp += ctyd(pins, 6.35) sexp += refs(name, 6.35) sexp += kk_model(pins) return name, sexp_generate(sexp)
def top_smd_fp(pins): name = "MOLEX-PICOBLADE-53398-{:02d}71".format(pins) tedit = format(int(time.time()), 'X') sexp = ["module", name, ("layer", "F.Cu"), ("tedit", tedit)] sexp += top_smd_refs(name) sexp += top_smd_silk(pins) sexp += top_smd_fab(pins) sexp += top_smd_ctyd(pins) sexp += top_smd_mount(pins) sexp += top_smd_pads(pins) sexp += top_smd_model(pins) return name, sexp_generate(sexp)
def main(inpath, outpath, xr, xp, yr, yp): with open(inpath) as f: insexp = sexp_parse(f.read()) outsexp = [ "kicad_pcb", ["version", 4], ["host", "panelise.py", datetime.datetime.utcnow().isoformat()], ] simple_types = ("gr_arc", "gr_line", "gr_text", "segment", "via", "module") for node in insexp: if node[0] in ("page", "layers", "setup", "net", "net_class"): outsexp.append(node) elif node[0] in simple_types: simples(node, outsexp, xr, xp, yr, yp) elif node[0] == "zone": zones(node, outsexp, xr, xp, yr, yp) with open(outpath, "w") as f: f.write(sexp_generate(outsexp))
def sfml(pins): name = "SFML-1{:02d}-02-L-D".format(pins) sexp = sfml_base(name, pins) return name, sexp_generate(sexp)
def sfml_lc(pins): name = "SFML-1{:02d}-02-L-D-LC".format(pins) sexp = sfml_base(name, pins) sexp += locking_clip(pins) return name, sexp_generate(sexp)