fix(core): populate pcb_via.layers with all spanned layers#2416
Open
gwhthompson wants to merge 1 commit into
Open
fix(core): populate pcb_via.layers with all spanned layers#2416gwhthompson wants to merge 1 commit into
gwhthompson wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pcb_via.layerslisted only[fromLayer, toLayer](the// TODO calculate layers inbetween top and bottom using layer countinVia._getLayers), so on 4-layer boards a drilled via "skipped" the inner layers it physically crosses. Anything that readslayersto decide per-layer interaction gets this wrong — most visibly@tscircuit/copper-pour-solver, whosevia.layers.includes(layer)test makes inner-plane pours flood solid over foreign-net via barrels (no antipad → every through-via shorts to the inner plane in the exported gerbers; invisible to DRC because the pour is resolved after checks).pcb_via.layersnow lists every copper layer betweenfromLayerandtoLayer(inclusive, in from→to order), derived from the subcircuit layer count via a newgetViaSpanLayersutil. Both<via>and the imported-circuit-jsonPcbViapath use it; an explicitlayersprop onPcbViastill wins, and 2-layer boards are unchanged ([top, bottom]).Testing
bun testsuite green (no existing test depends on the 2-entry shape);bunx tsc --noEmitclean.tests/components/primitive-components/via-layer-span.test.tsx:top→bottomvia →["top", "inner1", "inner2", "bottom"](fails before this change:["top", "bottom"])top→inner2via →["top", "inner1", "inner2"]["top", "bottom"][fromLayer, toLayer]).