to220 computes its lead pitch from the plastic body width instead of using the fixed TO-220 pitch:
const minPitch = 2.5
const maxHoleWidth = w * 0.4
const computedPitch = Math.max(minPitch, maxHoleWidth / (numPins - 1))
For the default 3-pin part (w = 13mm) that resolves to 2.6mm, so the pins land 0.06mm off per step from the JEDEC TO-220 pitch of 0.1 inch (2.54mm). Two follow-on problems:
- the pitch changes whenever the body width changes, but a TO-220 lead pitch is fixed regardless of body size
- the
p parameter is declared (default 5.0mm) yet never read, so to220_p2.54mm has no effect
The pads are also plain circular holes, while KiCad TO-220-3_Vertical uses a rectangular pin-1 pad plus pill lead pads. Running the repo parity harness against Package_TO_SOT_THT.pretty/TO-220-3_Vertical:
courtyardDiffPercent 17.02%
avgRelDiff (copper) 36.52%
The sibling to220f already hardcodes the right value with the comment TO-220F uses 2.54mm standard pitch to match KiCad, so the fix is to bring to220 onto the same KiCad TO-220-3 land.
to220computes its lead pitch from the plastic body width instead of using the fixed TO-220 pitch:For the default 3-pin part (
w= 13mm) that resolves to 2.6mm, so the pins land 0.06mm off per step from the JEDEC TO-220 pitch of 0.1 inch (2.54mm). Two follow-on problems:pparameter is declared (default5.0mm) yet never read, soto220_p2.54mmhas no effectThe pads are also plain circular holes, while KiCad
TO-220-3_Verticaluses a rectangular pin-1 pad plus pill lead pads. Running the repo parity harness againstPackage_TO_SOT_THT.pretty/TO-220-3_Vertical:The sibling
to220falready hardcodes the right value with the commentTO-220F uses 2.54mm standard pitch to match KiCad, so the fix is to bringto220onto the same KiCad TO-220-3 land.