component
MAL216099702E3 - 100 uF 80 V SMD Aluminium Electrolytic Capacitor, 150 C
Public Made by Adomby adom
Vishay BCcomponents MAL216099702E3 (160 CLA series): polarized SMD aluminium electrolytic capacitor, 100 uF +-20 %, 80 V, -55 C to +150 C, low impedance, AEC-Q200, 12.5 x 12.5 x 16 mm 4-pin case (1216). KiCad, Fusion and Altium libraries, 3D model and datasheet.
main
#!/usr/bin/env python3
"""Finish the adom-footprint output for MAL216099702E3: replace the square F.Fab body and the silkscreen outline with
the base plate's real shape (12.8 mm square, the two anode-side (-X) corners bevelled 2.6 mm, Vishay doc 28405
Fig. 2 / Fig. 4), keep the silk clear of the pads, drop the generic pin-1 tick and add a "+" beside pad 1 (anode).
Value set to the MPN. usage: fp_finish.py in.kicad_mod out.kicad_mod"""
import re, sys
src, out = sys.argv[1:3]
s = open(src).read()
s = re.sub(r'\s*\(fp_rect \(start -6\.4 -6\.4\) \(end 6\.4 6\.4\)\s*\(stroke[^)]*\)[^)]*\)\) \(fill none\) \(layer "F\.Fab"\)\)', "", s)
s = re.sub(r'\s*\(fp_line \(start [^)]*\) \(end [^)]*\)\s*\(stroke \(width 0\.12\) \(type default\)\) \(layer "F\.SilkS"\)\)', "", s)
def line(a, b, layer, w):
return f'\n (fp_line (start {a[0]} {a[1]}) (end {b[0]} {b[1]})\n (stroke (width {w}) (type default)) (layer "{layer}"))'
h, bev = 6.4, 2.6
fab = [(-h + bev, -h), (h, -h), (h, h), (-h + bev, h), (-h, h - bev), (-h, -h + bev), (-h + bev, -h)]
add = "".join(line(fab[i], fab[i + 1], "F.Fab", 0.1) for i in range(len(fab) - 1))
g = 6.52; gb = 3.85 # silk 0.12 outside the plate; bevel points
silk = [((-2.71, -g), (g, -g)), ((g, -g), (g, -1.46)), ((g, 1.46), (g, g)), ((g, g), (2.71, g)), # top/bottom stop 0.21 short of the MP pads
((-2.71, g), (-gb, g)), ((-gb, g), (-g, gb)), ((-g, gb), (-g, 1.46)),
((-g, -1.46), (-g, -gb)), ((-g, -gb), (-gb, -g)), ((-gb, -g), (-2.71, -g))]
add += "".join(line(a, b, "F.SilkS", 0.12) for a, b in silk)
add += line((-8.1, -2.6), (-7.1, -2.6), "F.SilkS", 0.15) + line((-7.6, -3.1), (-7.6, -2.1), "F.SilkS", 0.15) # "+" beside pad 1
s = s.replace('\n (fp_text reference', add + '\n (fp_text reference', 1)
s = s.replace('(fp_text value "mal216099702e3"', '(fp_text value "MAL216099702E3"')
open(out, "w").write(s); print("OK", out)