Skip to content

fix: keep tssop and sot457 silkscreen clear of the pads (#734) - #736

Open
DPS0340 wants to merge 1 commit into
tscircuit:mainfrom
DPS0340:fix/tssop-sot457-silkscreen
Open

fix: keep tssop and sot457 silkscreen clear of the pads (#734)#736
DPS0340 wants to merge 1 commit into
tscircuit:mainfrom
DPS0340:fix/tssop-sot457-silkscreen

Conversation

@DPS0340

@DPS0340 DPS0340 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Part of #734 — the two non-quad overlaps found by the same scan. Independent of #735 (different files, no conflict).

Two different causes, same symptom

tssop10_w3mm_p0.5mm — outline 0.025 mm onto the pads. The outline was sized from parameters.w:

const sw = parameters.w - (legsoutside ? 0 : parameters.pl * 2) - 0.2

but fine-pitch parts place their pads from wForPads = w - 0.15mm, so the formula describes a body the copper doesn't actually match. The flat - 0.2 is also only 0.1 of inset per side — less than the 0.05 stroke half-width plus any clearance. Now both dimensions are derived from the pads that were really placed:

const sw = Math.min(<existing formula>, (padInnerHalfX - silkPadClearance) * 2)
const sh = Math.max(<existing formula>, (padOuterHalfY + silkPadClearance) * 2)

sh needed it too: the horizontal runs pass above and below the outermost pads and had the same problem. Both are Math.min/Math.max against the original expressions, so footprints that already cleared the copper keep their existing geometry.

sot457_w2_pl1.5_pw0.6 — pin 1 marker 0.005 mm onto pad 1. The marker was offset by a multiple of the pad width:

pin1Position.x -= params.wave ? padWidth : padWidth * 1.7

pw is the pad's short dimension here while the marker moves along the long axis, so the offset is unrelated to how far the pad actually extends. With pl and pw set independently the triangle lands on the pad. Now it's placed from pad 1's real outer edge:

const pin1PadOuterEdgeX = pin1Position.x - padLength / 2
pin1Position.x = pin1PadOuterEdgeX - triangleHeight / 2 - 0.2 - 0.05 / 2

Verification

Segment-to-pad distance minus half the stroke:

                          before    after
tssop10_w3mm_p0.5mm      -0.0250   0.2000
sot457_w2_pl1.5_pw0.6    -0.0050   0.2000
tssop8/14/16/20/28        0.2000   0.2000   ← unchanged
sot457 (default)          0.2000   0.2000   ← unchanged

0.2 mm matches KiCad's own TSSOP-10_3x3mm_P0.5mm and SOT-457T, which I measured first — both report exactly 0.2000 mm silk-to-pad.

The test bites, and I checked each fix separately rather than trusting one combined run. Reverting only tssop.ts fails the tssop cases; reverting only sot457.ts fails with "clears": false. It covers 9 variants and asserts paths.length > 0 so it can't pass vacuously.

Suite: 468 pass / 0 fail, biome format clean, bun run build ok. Courtyard parity is unaffected — both parity tests still report IoU 100.00% (diff 0.00%). I rendered the tssop10 parity snapshot against the KiCad reference: the outline now sits clear of the pad columns with the same margin KiCad uses.

Remaining from #734: sod123 and sot723 emit no silkscreen at all. Happy to send that one next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant