feat: merge same-net trace lines that are close together (align to same X/Y) #34#166
Open
mitchellecm7 wants to merge 4 commits intotscircuit:mainfrom
Open
feat: merge same-net trace lines that are close together (align to same X/Y) #34#166mitchellecm7 wants to merge 4 commits intotscircuit:mainfrom
mitchellecm7 wants to merge 4 commits intotscircuit:mainfrom
Conversation
- Added SameNetSegmentMergingSolver to merge close same-net trace segments - Integrated into SchematicTracePipelineSolver pipeline - Added demo page SameNetSegmentMergingDemo.page.tsx - Merges collinear segments within 0.5 unit threshold
- Add alignParallelSegments() method for horizontal/vertical alignment - Add alignThreshold parameter (default 0.5) - Cluster same-net parallel segments within threshold distance - Align clusters to median X (vertical) or Y (horizontal) coordinate - Maintain connectivity through perpendicular segments Fixes tscircuit#34
|
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.
/claim #34
Demo Video
@tscircuit_schematic-trace-solver.-.Google.Chrome.2026-04-07.17-31-00.mp4
Problem
Same-net trace lines that are close together (e.g., multiple IOVDD traces) are drawn at slightly different Y or X coordinates, causing non-aligned parallel lines.
Solution
Enhanced SameNetSegmentMergingSolver to detect and align parallel segments on the same net within a threshold distance.
Changes Made
SameNetSegmentMergingSolver.ts
alignThresholdparameter (default 0.5)alignParallelSegments()method that:alignThresholddistancerebuildTracesFromSegments()helperSchematicTracePipelineSolver.ts
alignThreshold: 0.5to SameNetSegmentMergingSolverHow It Works
Testing
Tested with netlist containing multiple IOVDD pins:
Visual Result
Before: Parallel traces at slightly different positions
After: Perfectly aligned traces on same X/Y coordinates
Fixes #34