feat: merge nearby same-net trace segments#334
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
digzrow-coder
left a comment
There was a problem hiding this comment.
This implementation is still endpoint-gap based, so it misses the core close-parallel case from #29/#34. endpointCandidate() requires the two segments to have the exact same fixed coordinate (first.fixed === second.fixed) and only closes a small gap between their endpoints. Two same-net duplicate runs that are visually close but on slightly different axes, for example horizontal segments at y=0 and y=0.05 with overlapping x-ranges, never match because their fixed values differ.
That means the visual duplication shown in the issue screenshots remains: close same-net parallel traces are not snapped onto a shared X/Y axis unless they were already collinear. The tests only cover closing a gap between already-collinear endpoint segments; they do not cover the near-parallel overlapping segment case the bounty asks to combine.
The solver needs to compare same-orientation segment pairs by orthogonal distance plus span overlap, then move/snap the relevant internal segment(s) onto a shared axis while preserving endpoint constraints and checking for unsafe crossings.
|
Thanks for the detailed review. I updated this PR to handle the near-parallel overlapping case directly, not just collinear endpoint gaps. The merge solver now detects same-orientation same-net segment pairs whose spans overlap and whose orthogonal distance is within the threshold, then snaps both segments onto a shared X/Y axis. Added focused coverage for:
Verification run locally:
|
|
Thanks for the detailed review. I pushed an update that addresses the close-parallel overlap case directly:
Verification run locally:
|
|
Thanks for the review. I pushed What changed:
Verification run locally:
|
|
Thanks for the detailed review. I pushed Verification run locally:
|
|
Thanks for the review — I pushed an update after this comment that handles the close-parallel overlap case directly instead of only endpoint gaps. What changed:
Local verification now passes:
|
|
Thanks for the detailed review. I updated the PR to handle the near-parallel overlapping case explicitly: same-net same-orientation segments are now compared by orthogonal distance plus span overlap, internal segments are snapped onto a shared axis, and the move is rejected if it would introduce an additional different-net crossing. I also added horizontal/vertical overlap tests plus a crossing-safety regression test. Verification run locally:
|
Summary
SameNetTraceMergeSolverpost-cleanup phase to conservatively join nearby collinear trace segment endpoints on the same global net/claim #29
Testing
bunx biome format .bunx tsc --noEmitbun test