Skip to content

fix: preserve polarized capacitor symbols - #562

Open
hrithik18k wants to merge 3 commits into
tscircuit:mainfrom
hrithik18k:fix/c335982-polarized-capacitor
Open

fix: preserve polarized capacitor symbols#562
hrithik18k wants to merge 3 commits into
tscircuit:mainfrom
hrithik18k:fix/c335982-polarized-capacitor

Conversation

@hrithik18k

Copy link
Copy Markdown
Contributor

Motive

Preserve the electrical meaning and original curved symbol of polarized EasyEDA capacitors during TSX conversion.

Description

C335982 uses numeric pin labels, so label-only polarity detection emitted a non-polarized capacitor with two straight plates. This change detects two-pin polarized capacitors from EasyEDA's curved plate geometry or explicit capacitor metadata, passes that semantic separately into TSX generation, and retains the existing +/− label mapping when it is available. The merged #561 reproduction now asserts polarized output and the native capacitor_polarized_right symbol, while the existing ordinary and explicitly labelled capacitor cases remain covered.

Snapshot diff

Before (#561) After (this fix)
Before: two straight plates After: curved polarized plate

Validation

  • bun test tests/convert-to-ts/C335982-polarized-capacitor-repro.test.ts tests/convert-to-ts/C1525-to-ts.test.ts (6 passed)
  • bun run build

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