Skip to content

Fix invalid Circuit JSON routes from through-obstacle autorouting#2257

Open
mohan-bee wants to merge 3 commits intotscircuit:mainfrom
mohan-bee:fix--2
Open

Fix invalid Circuit JSON routes from through-obstacle autorouting#2257
mohan-bee wants to merge 3 commits intotscircuit:mainfrom
mohan-bee:fix--2

Conversation

@mohan-bee
Copy link
Copy Markdown
Contributor

@mohan-bee mohan-bee commented May 7, 2026

closes tscircuit/circuit-json-to-kicad#290

This fixes a routing export bug where internal through_pad route points could leak into pcb_trace.route.

through_pad uses start and end, but Circuit JSON traces need normal wire/via route points with top-level x and y. When the internal shape leaked, KiCad export could produce NaN coordinates.

This change converts through_pad points before writing pcb_trace:

creates a via at the start point
adds a wire on the target layer when needed
leaves existing wire and via points unchanged
A repro test was added to make sure rendered autorouter output writes valid pcb_trace routes.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment May 8, 2026 3:30am

Request Review

@mohan-bee mohan-bee marked this pull request as ready for review May 7, 2026 09:10

return circuitJsonRoutePoints
})
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is incorrect, should be through_pad

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

see comment

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

didn't address my comments

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NaN in place of coordinates is causing it to fail.

2 participants