Skip to content

fix: connect manual pcbPath vias on both layers - #3373

Open
seveibar wants to merge 2 commits into
mainfrom
fix/pcb-route-integrity
Open

fix: connect manual pcbPath vias on both layers#3373
seveibar wants to merge 2 commits into
mainfrom
fix/pcb-route-integrity

Conversation

@seveibar

@seveibar seveibar commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • emit an aligned wire point on each side of every manual pcbPath via
  • make consecutive via entries produce the intended intervening copper segment
  • reuse explicit same-position wire points so the documented workaround remains compatible without zero-length duplicates
  • reject a manual via whose fromLayer disagrees with the current path layer before malformed copper is emitted

Why

A pcbPath containing consecutive vias previously serialized as wire -> via -> via -> wire. There was no wire on the layer between those vias, so Gerber output omitted the intended connecting copper while the source still looked fully specified.

This was reproduced while fixing the reviewed USB-C fan-in in tscircuit/quick-configure. The shared validation companion, tscircuit/checks#232, makes malformed raw Circuit JSON fail closed; this PR fixes the producing path in core.

Compatibility

Existing paths that already place ordinary points at the via coordinates keep the same effective route. Exact same-position/same-layer wire points are deduplicated, while distinct corners and layer changes are preserved.

Validation

  • bun test --timeout 9999999 — 1,432 pass, 40 skip, 0 fail
  • focused manual pcbPath suite — 4 pass, 0 fail
  • snapshots for consecutive vias, explicit-wire compatibility, and invalid via direction
  • bunx tsc --noEmit
  • bun run build

@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview Aug 22, 2026 7:48am

Request Review

@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.

2 participants