Skip to content

fix: number sot723 pins to match the datasheet (pins 1↔3 were swapped)#688

Open
chayan-1906 wants to merge 2 commits into
tscircuit:mainfrom
chayan-1906:fix/sot723-pin-numbering
Open

fix: number sot723 pins to match the datasheet (pins 1↔3 were swapped)#688
chayan-1906 wants to merge 2 commits into
tscircuit:mainfrom
chayan-1906:fix/sot723-pin-numbering

Conversation

@chayan-1906

Copy link
Copy Markdown

Summary

sot723 placed its pads at the correct KiCad/Toshiba positions but assigned the pin numbers 1 and 3 to the wrong pads: the lone right pad was numbered 1 and the top-left pad was numbered 3. Every other 3-pin SOT in this repo (sot23, sot23w, sot323) and KiCad's official SOT-723.kicad_mod (which references the Toshiba datasheet) use the standard arrangement: pin 1 top-left, pin 2 bottom-left, pin 3 alone on the right. A real part placed on this footprint gets cross-wired (e.g. base↔collector on a transistor).

This never showed in SVG snapshots or the KiCad parity test because both only compare copper shapes — pin numbers aren't rendered.

Fixes #686

Expected vs actual (default params)

pin before after (= KiCad SOT-723)
1 (+0.575, 0) — right ❌ (−0.575, +0.4) — top-left
2 (−0.575, −0.4) ✅ unchanged
3 (−0.575, +0.4) — top-left ❌ (+0.575, 0) — right

The pad positions, sizes (0.45 × 0.4) and pitch (±0.575) already matched KiCad exactly — this PR only fixes which number each pad carries. Introduced in #404, which fixed the pad positions but kept the old pin→pad assignment.

Changes

  • src/fn/sot723.ts: two-line swap in getCcwSot723Coords — pin 1 now takes the top-left spot and pin 3 the lone right spot (the order now actually runs counterclockwise, as the helper's name says)
  • tests/sot723.test.ts: added a pin-to-position assertion so this can't regress invisibly again

Testing

  • New test fails on main (verified against the unfixed code) and passes with the fix
  • Full suite: 432 pass, 0 fail — no snapshot changes (copper is identical, only pin numbering changed)
  • tests/kicad-parity/sot723_kicad_parity.test.ts still passes with 100% courtyard IoU
  • bun run build and bun run format clean

🤖 Generated with Claude Code

chayan-1906 and others added 2 commits July 3, 2026 21:22
Pins 1 and 3 were swapped: the lone right pad was numbered 1 and the
top-left pad was numbered 3. KiCad's SOT-723 (Toshiba datasheet) and the
repo's own sot23/sot323 convention put pin 1 top-left, pin 2 bottom-left
and pin 3 alone on the right.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The SVG snapshot and the KiCad parity test only compare copper shapes,
so a pin-numbering swap passes both. This asserts the pin-to-position
mapping directly so it can't regress invisibly again.

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.

sot723 footprint numbers pins 1 and 3 on the wrong pads (1↔3 swapped vs datasheet)

1 participant