Skip to content

fix: keep duplicate pad numbers on one logical pin (#411) - #413

Open
DPS0340 wants to merge 1 commit into
tscircuit:mainfrom
DPS0340:fix/duplicate-pad-numbers-411
Open

fix: keep duplicate pad numbers on one logical pin (#411)#413
DPS0340 wants to merge 1 commit into
tscircuit:mainfrom
DPS0340:fix/duplicate-pad-numbers-411

Conversation

@DPS0340

@DPS0340 DPS0340 commented Jul 24, 2026

Copy link
Copy Markdown

Fixes #411.

Problem

When an EasyEDA footprint represents one logical pin with multiple physical pad geometries, convertEasyEdaJsonToCircuitJson treats every geometry as a separate logical pin: duplicate pad numbers are passed independently to normalizePinLabels, which renumbers the later geometries into synthetic pins.

On C5656610 (ICS-43434, pads numbered 1,2,4,5,6,3,3,3,3):

before:  source ports 1,2,4,5,6,3,7,8,9   pad hints pin1..pin6, pin7, pin8, pin9
after:   source ports 1,2,3,4,5,6         pad hints pin1..pin6, pin3, pin3, pin3

Downstream (tscircuit → KiCad) the synthetic pins previously became separate unconnected pads.

Fix

  • Normalize one label set per unique pad number (pads without a number keep per-index identity), then map every geometry back to its logical pin's labels — duplicate geometries share the same pinN hint.
  • Emit one source_port per logical pin instead of one per geometry.

Verification

  • New regression test tests/convert-to-soup-tests/duplicate-pad-numbers-411.test.ts with the C5656610 asset from the issue (fails on main with synthetic pins 7/8/9)
  • Full suite: 121 pass, 0 fail
  • Snapshot updates for C2838502 / C2913206 / C51950748 — ESP32 modules whose thermal-pad geometries (8-9 pads all numbered for the GND paddle) were previously renumbered into pin54..pin61 with pin49_alt1 hints; they now correctly share the GND pin, which is visible in the diffs as the synthetic pins disappearing
  • bunx tsc --noEmit / biome check — clean

Fixes tscircuit#411.

When an EasyEDA footprint represents one logical pin with multiple
physical pad geometries (e.g. C5656610's four polygon pads all numbered
3 — one GND terminal), convertEasyEdaJsonToCircuitJson passed every
geometry independently to normalizePinLabels, which renumbered the
later duplicates into synthetic pins (7/8/9). Downstream consumers then
bound those shapes as separate unconnected pads.

Pin labels are now normalized once per unique pad number, all duplicate
geometries share the same logical pin hint, and only one source_port is
emitted per logical pin.

Snapshot updates: C2838502 / C2913206 / C51950748 (ESP32 modules whose
thermal-pad geometries were previously renumbered into synthetic pins —
they now correctly share the GND pin).
@DPS0340

DPS0340 commented Jul 25, 2026

Copy link
Copy Markdown
Author

@Abse2001 could you take a look at this one when you have a moment? Small and self-contained.

Fixes #411. The official JLCPCB footprint for C5656610 (ICS-43434) has nine pad geometries numbered 1, 2, 4, 5, 6, 3, 3, 3, 3 — the four pads numbered 3 are four copper shapes for one GND terminal. convertEasyEdaJsonToCircuitJson passed each geometry to normalizePinLabels independently, so the repeats were renumbered into synthetic pins that don't exist on the part.

The fix groups geometries by pad number before normalizing, so duplicates stay on one logical pin. Test covers the real C5656610 shape; CI is green and it's MERGEABLE / CLEAN.

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.

Duplicate EasyEDA pad numbers are renumbered into synthetic logical pins

1 participant