Skip to content

fix: number msop and son right-column pins counterclockwise#678

Open
chayan-1906 wants to merge 4 commits into
tscircuit:mainfrom
chayan-1906:fix/msop-son-ccw-pin-numbering
Open

fix: number msop and son right-column pins counterclockwise#678
chayan-1906 wants to merge 4 commits into
tscircuit:mainfrom
chayan-1906:fix/msop-son-ccw-pin-numbering

Conversation

@chayan-1906

Copy link
Copy Markdown

Summary

msop and son numbered their right-column pins top→bottom (same direction as the left column), instead of the standard counterclockwise order every other dual-row footprint in this repo uses (soic/dfn/sop8 via getCcwSoicCoords, tssop/ssop in their own coord functions). The pad positions were fine — only the pin→pad mapping was mirrored, so pins 5↔8 / 6↔7 (msop8, son8), 4↔6 (son6), 6↔10 / 7↔9 (msop10) would route to the wrong nets. This never showed in SVG snapshots because pin numbers aren't rendered there.

Fixes #677

Expected vs actual (msop8, default params)

pin before after soic8 for reference
5 y = +0.975 (top-right ❌) y = −0.975 (bottom-right) y = −1.905 (bottom-right)
8 y = −0.975 (bottom-right ❌) y = +0.975 (top-right) y = +1.905 (top-right)

Changes

  • src/fn/msop.ts / src/fn/son.ts: one-line fix in the coord helpers — the right column now runs bottom→top (vssop already worked around this same helper by remapping pin numbers, which is why it wasn't affected)
  • tests/msop.test.ts / tests/son.test.ts: added counterclockwise-numbering assertions for msop8, son8, son6 so this can't regress invisibly again

Testing

  • New tests fail on main (verified by running them against the unfixed code) and pass with the fix
  • Full suite: 434 pass, 0 fail — no snapshot changes (layout is visually identical, only pin numbering changed)
  • Pin 1 / silkscreen / courtyard are computed from pin 1 and spans, so they're unaffected
  • bun run build and bunx biome format clean

🤖 Generated with Claude Code

chayan-1906 and others added 4 commits July 3, 2026 11:48
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

msop and son footprints number the right-column pins in reverse (pins 5↔8, 6↔7 swapped on 8-pin parts)

1 participant