Skip to content

Fix footprint-only EasyEDA imports and preserve BGA pad identifiers - #417

Merged
techmannih merged 2 commits into
mainfrom
al
Jul 30, 2026
Merged

Fix footprint-only EasyEDA imports and preserve BGA pad identifiers#417
techmannih merged 2 commits into
mainfrom
al

Conversation

@techmannih

Copy link
Copy Markdown
Member

Summary

Fixes tsci import RK3566, which successfully finds JLCPCB part C2943786 but fails during EasyEDA conversion.

Root Cause

Search works correctly and resolves RK3566 to C2943786. The failure occurs during the subsequent import/conversion step.

EasyEDA returns this component as footprint-only data:

  • dataStr.shape is explicitly empty, so no EasyEDA schematic symbol is available.
  • editorVersion, hasIdFlag, BBox, and colors are omitted.
  • packageDetail is complete and contains all 565 footprint pads.
  • A CAD model is available.

Our Zod schema incorrectly required the omitted schematic metadata, causing validation to fail before footprint conversion.

There was also a separate parsing issue with BGA ball identifiers such as 1E20. They were interpreted as JavaScript scientific notation and converted to 100000000000000000000, resulting in invalid and duplicate generated port names.

Solution

  • Provide neutral defaults for optional schematic metadata:
    • editorVersion: ""
    • hasIdFlag: false
    • colors: []
    • A zero-size BBox positioned at the schematic origin
  • Preserve exponent-like and alphanumeric BGA identifiers such as 1E20 as strings.
  • Continue converting plain decimal pad identifiers to numbers to preserve existing behavior.

The fix does not add or reconstruct missing EasyEDA schematic data. It only allows footprint-only components to pass validation.

When the generated TSX is executed, tscircuit creates its existing generic chip schematic from the footprint pad identifiers. Therefore, the schematic snapshot represents the tscircuit-generated fallback, not an EasyEDA-provided RK3566 schematic.

Result

C2943786 now imports with:

  • 565 unique footprint pads
  • 565 unique generated ports
  • Preserved BGA identifiers such as 1A1 and 1E20
  • Available CAD model
  • A generic tscircuit fallback schematic

Tests

Added coverage using the actual C2943786 EasyEDA payload:

  • Focused tests for missing schematic metadata
  • Regression test for preserving 1E20
  • Generated TSX inline snapshot
  • PCB SVG snapshot
  • Generated fallback schematic SVG snapshot
  • 3D snapshot

TypeScript, Biome, build, and snapshot tests pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@imrishabh18 imrishabh18 Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seveibar This looks crazy. Maybe a chip this large should automatically be split into multiple <schematicbox /> ?

@techmannih
techmannih merged commit 7f4187e into main Jul 30, 2026
5 checks passed
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.

2 participants