feat: implement TO-220 horizontal variant footprint (to220h)#533
feat: implement TO-220 horizontal variant footprint (to220h)#533victorjzq wants to merge 4 commits intotscircuit:mainfrom
Conversation
Add to220h footprint supporting horizontal TO-220 packages mounted flat against the PCB. Supports TabDown (default) and TabUp orientations via the tabup/tabdown parameter flags. - to220h_3: default 3-pin horizontal, tab pointing down - to220h_3_tabup: 3-pin horizontal, tab pointing up - Aliases: TO-220-3_Horizontal_TabDown, TO-220-3_Horizontal_TabUp - KiCad parity tests for both TabDown and TabUp variants - Holes match to220f: 2.54mm pitch, rect pad on pin1, pill pads on others Fixes tscircuit#185
| test("parity/to220h_3 (TabDown)", async () => { | ||
| const { combinedFootprintElements, booleanDifferenceSvg } = | ||
| await compareFootprinterVsKicad( | ||
| "to220h_3", | ||
| "Package_TO_SOT_THT.pretty/TO-220-3_Horizontal_TabDown.circuit.json", | ||
| ) | ||
|
|
||
| const svgContent = convertCircuitJsonToPcbSvg(combinedFootprintElements, { | ||
| showCourtyards: true, | ||
| }) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "to220h_3") | ||
| expect(booleanDifferenceSvg).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "to220h_3_boolean_difference", | ||
| ) | ||
| }) | ||
|
|
||
| test("parity/to220h_3_tabup (TabUp)", async () => { | ||
| const { combinedFootprintElements, booleanDifferenceSvg } = | ||
| await compareFootprinterVsKicad( | ||
| "to220h_3_tabup", | ||
| "Package_TO_SOT_THT.pretty/TO-220-3_Horizontal_TabUp.circuit.json", | ||
| ) | ||
|
|
||
| const svgContent = convertCircuitJsonToPcbSvg(combinedFootprintElements, { | ||
| showCourtyards: true, | ||
| }) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "to220h_3_tabup") | ||
| expect(booleanDifferenceSvg).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "to220h_3_tabup_boolean_difference", | ||
| ) | ||
| }) |
There was a problem hiding this comment.
This test file contains 2 test() calls (lines 5-20 and 22-37), which violates the rule that a *.test.ts file may have AT MOST one test(...). After the first test, the user should split into multiple, numbered files. To fix this, split the file into two separate files: 'to220h_3_kicad_parity1.test.ts' for the first test and 'to220h_3_kicad_parity2.test.ts' for the second test.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
|
Closing in favor of #534 which includes proper /claim format. |
|
/claim #185 Re-opening this PR (mistakenly closed). Full TO-220 horizontal implementation with KiCad-compatible pads, TabDown/TabUp variants, and 387 passing tests. |
|
Fixed graphite-app review: split |
|
Hey @MustafaMulla29 @rushabhcodes — this PR is CI-green and ready for review. Thanks! |
rushabhcodes
left a comment
There was a problem hiding this comment.
remove updfn4ep from this pr
Summary
Implements the TO-220 horizontal variant footprint as requested in #185.
to220hfootprint for TO-220 packages mounted horizontally (flat against PCB)tabdown(default) andtabuporientationsTO-220-3_Horizontal_TabDown→to220h_3,TO-220-3_Horizontal_TabUp→to220h_3_tabupUsage
Tests
tests/to220h.test.ts: SVG snapshot tests for TabDown, TabUp, and both aliasestests/kicad-parity/to220h_3_kicad_parity.test.ts: KiCad parity tests comparing againstPackage_TO_SOT_THT.pretty/TO-220-3_Horizontal_TabDown.circuit.jsonandTO-220-3_Horizontal_TabUp.circuit.json/claim #185
Fixes #185