fix: deduplicate vias from freerouting session output#126
Open
blessuselessk wants to merge 2 commits intotscircuit:mainfrom
Open
fix: deduplicate vias from freerouting session output#126blessuselessk wants to merge 2 commits intotscircuit:mainfrom
blessuselessk wants to merge 2 commits intotscircuit:mainfrom
Conversation
Freerouting can output duplicate vias at the same coordinates, both within a single net and across different nets. This causes duplicate pcb_via elements in the circuit JSON output. Track via positions in a Set keyed by coordinates and skip duplicates during session-to-circuit-json conversion. Closes tscircuit/tscircuit#2408
Changed addedViaKeys from Set to Map to track which net first claimed each via location. When a via at the same coordinates appears in a different net, emit a console.warn about a possible short circuit in the routing output.
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
viasarray and across different nets in the session fileSet-based deduplication keyed by"${viaX},${viaY}"inconvertDsnSessionToCircuitJsonthat skips vias already processed at the same coordinatespcb_viaelements and duplicate via route points in the circuit JSON outputTest plan
repro15-duplicate-vias.test.tswith two cases:repro10-via.test.ts(via count consistency) still passes