feat: SameNetTraceMergeSolver — merge close same-net trace segments#424
Open
wbobbynmworley wants to merge 2 commits into
Open
feat: SameNetTraceMergeSolver — merge close same-net trace segments#424wbobbynmworley wants to merge 2 commits into
wbobbynmworley wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
New pipeline phase that merges trace segments belonging to the same net when their endpoints are within a configurable threshold (default 0.1mm). Handles axis-aligned connections (direct concat), small gaps (noise tolerance), and non-axis-aligned gaps (L-bridge insertion). Priority order for net identification: userNetId > globalConnNetId > dcConnNetId. Replaces PR tscircuit#351 with a cleaner implementation that integrates properly into the pipeline (between TraceCleanupSolver and NetLabelPlacementSolver). Includes comprehensive unit tests (8 test cases). Closes tscircuit#29
dfa9746 to
d84bb42
Compare
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.
Problem
Fixes #29 (bounty: $100)
When multiple trace segments belong to the same net, they should be merged into a single continuous trace if their endpoints are close enough. This reduces visual clutter and ensures the schematic renderer produces cleaner output.
Solution
New pipeline phase
SameNetTraceMergeSolverinserted betweenTraceCleanupSolverandNetLabelPlacementSolver.Net identification priority:
userNetId→globalConnNetId→dcConnNetIdMerge logic:
Key differences from PR #351:
Testing
8 unit test cases covering:
Files Changed
lib/solvers/SameNetTraceMergeSolver/SameNetTraceMergeSolver.ts— solver implementationlib/solvers/SameNetTraceMergeSolver/SameNetTraceMergeSolver.test.ts— 8 test caseslib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts— pipeline integration