Skip to content

fix(schematic): render electrical pin directions - #128

Open
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:fix/schematic-component-display-mode
Open

fix(schematic): render electrical pin directions#128
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:fix/schematic-component-display-mode

Conversation

@KrishnaX12

@KrishnaX12 KrishnaX12 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Render Altium pin-direction markers from each schematic pin electrical type by default.
  • Input pins point toward the component, output pins point away, and I/O pins use the Altium diamond marker.
  • Reserve one common marker slot so all pin designators align at a constant offset from the component edge.
  • Passive, HiZ, and power pins remain unmarked while their designators stay aligned with marked pins.
  • Preserve explicit inner/outer pin symbols: clock and inversion symbols take precedence over the automatic electrical marker.
  • Allow callers to restore plain rendering with showPinDirections: false.

Root Cause

The SVG serializer parsed ELECTRICAL but did not use it when rendering schematic pins. Missing ELECTRICAL values in binary SchDoc records represent Altium default input pins and are handled accordingly.


Visual Verification: altiumts (Fixed) vs Altium 365 Viewer (Reference)

Component / Sheet altiumts (Fixed) Altium 365 Viewer (Ground Truth)
TI TMDS62LEVM: U61
(Sheet 12)
U61 altiumts U61 Altium 365
TI TMDS62LEVM: U57
(Sheet 13)
U57 altiumts U57 Altium 365
TI TMDS62LEVM: U121
(Sheet 14)
U121 altiumts U121 Altium 365
TI TMDS62LEVM: U71 JTAG/MDIO
(Sheet 33)
U71 altiumts U71 Altium 365
Designator Constant Offset Alignment Alignment altiumts Alignment Altium 365
Edge-Symbol Precedence (Clock/Invert) Precedence altiumts Precedence Altium 365

Testing

  • Added real binary regression coverage for the exact TI TMDS62LEVM components shown in the report: U61 on sheet 12, U57 on sheet 13, U121 on sheet 14, and U71 JTAG/MDIO pins on sheet 33.
  • Added a mixed-electrical-type assertion proving that visible pin designators use one consistent offset from the component body.
  • Added coverage for the showPinDirections: false opt-out using those real records.
  • Added an assertion that existing clock/inversion pin-symbol rendering remains free of automatic direction markers; its snapshot is byte-for-byte unchanged from main.
  • Regenerated 52 existing schematic SVG snapshots; no synthetic snapshot was added.
  • All 122 SVG tests, typechecks, formatting, package build, and site build pass.

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@KrishnaX12 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

@KrishnaX12
KrishnaX12 force-pushed the fix/schematic-component-display-mode branch from 08f12b6 to a05a748 Compare September 3, 2026 19:04
@KrishnaX12 KrishnaX12 changed the title fix(schematic): render active component alternate display modes fix(schematic): render electrical pin directions Sep 3, 2026
@KrishnaX12
KrishnaX12 force-pushed the fix/schematic-component-display-mode branch 6 times, most recently from a3c2888 to 23ebea5 Compare September 3, 2026 20:06
@KrishnaX12
KrishnaX12 force-pushed the fix/schematic-component-display-mode branch 4 times, most recently from 6b27e1d to 55e45fc Compare September 4, 2026 12:21
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