main
John Lauer Component record TPS16850VMAR: files batch 1 6db00ed 20h ago
#!/usr/bin/env python3
"""adom-lbr 2.47.5 hub fix before the Altium export. import-kicad does not read pad layers, so the exposed pad 24
(copper + mask only in KiCad; TI's paste is six 0.98 x 1.04 mm windows, SLVSHA1D p.56) would get a full-size paste
opening in the PcbLib, and the hub's footprint polygons on a non-copper Altium layer are not written by
export-altium/assemble-altium (checked: the PcbLib bytes are identical with and without them). So pad 24 gets a
paste expansion of -0.174 mm: one aperture of 3.052 x 2.002 mm = 6.110 mm2, the same area as TI's six windows
(6.115 mm2, 76.5 % of the pad). The KiCad footprint and the Fusion library carry TI's six windows.
usage: hub_fix.py hub.json"""
import json, sys
hub = sys.argv[1]
d = json.load(open(hub))
ep = [p for p in d["footprint"]["pads"] if p["number"] == "24" and not p.get("drill_mm") and p["w_mm"] > 3]
assert len(ep) == 1
ep[0]["paste_margin_mm"] = -0.174
json.dump(d, open(hub, "w"), indent=1)
print("OK", hub, "pad 24 paste expansion -0.174 mm (area of TI's six windows)")