Support offset thermal pads - #750
Conversation
| test("qfn thermal pad supports independent x and y offsets", () => { | ||
| const soup = fp | ||
| .string( | ||
| "qfn32_thermalpad3.1x3.1mm_thermalpadcenteroffsetx0.25mm_thermalpadcenteroffsety-0.4mm", | ||
| ) | ||
| .circuitJson() | ||
| const thermalPad = soup.find( | ||
| (element) => | ||
| element.type === "pcb_smtpad" && | ||
| element.port_hints.includes("thermalpad"), | ||
| ) | ||
|
|
||
| expect(thermalPad).toMatchObject({ | ||
| shape: "rect", | ||
| x: 0.25, | ||
| y: -0.4, | ||
| width: 3.1, | ||
| height: 3.1, | ||
| }) | ||
|
|
||
| const svgContent = convertCircuitJsonToPcbSvg(soup) | ||
| expect(svgContent).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "qfn32_offset_thermalpad", | ||
| ) | ||
| }) |
There was a problem hiding this comment.
A *.test.ts file may have AT MOST one test(...). This file already contained at least one test(...) block (visible at line 31 and below), and now a second test("qfn thermal pad supports independent x and y offsets", ...) has been added, followed by yet another test("qfn20 supports explicit and shared side pin counts", ...) at line 61. Per the style guide, once a file has more than one test it must be split into multiple numbered files (e.g. qfn1.test.ts, qfn2.test.ts). Move this new test into its own dedicated file such as qfn-offset-thermalpad.test.ts or a numbered variant.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
Summary
thermalpadcenteroffsetxandthermalpadcenteroffsetyparameters to QFN/DFN/SOIC/TSSOP/SSOP/MSOP/VSSOP footprintsWhy
Several common JLCPCB power packages use an exposed pad that is intentionally displaced from the perimeter-pad center. A centered-only thermal pad caps otherwise accurate matches around 80–86% copper IoU.
This enables strings such as:
dfn8_thermalpad2.4mmx2.1mm_thermalpadcenteroffsety0.35mmValidation
bun run buildbun test tests/dual-row-thermalpad.test.ts tests/qfn.test.ts(12 pass)