Skip to content

fix: snap same-net parallel trace segments to unified coordinates#410

Open
khozakhulile27-netizen wants to merge 3 commits into
tscircuit:mainfrom
khozakhulile27-netizen:fix/snap-same-net-parallel-traces
Open

fix: snap same-net parallel trace segments to unified coordinates#410
khozakhulile27-netizen wants to merge 3 commits into
tscircuit:mainfrom
khozakhulile27-netizen:fix/snap-same-net-parallel-traces

Conversation

@khozakhulile27-netizen
Copy link
Copy Markdown

@khozakhulile27-netizen khozakhulile27-netizen commented May 22, 2026

Fixes #29. Fixes #34.

Implements a new TraceCleanupSolver phase that snaps same-net parallel trace segments onto unified coordinates, merging traces that are at nearly identical X or Y positions. This eliminates the redundant/duplicate trace lines shown in issues #29 and #34.

Changes:

  • Added new solver phase that finds same-net trace segments close together (< 0.3 units)
  • Snaps horizontal segments to the same Y coordinate and vertical segments to the same X coordinate
  • All existing unit tests pass

/claim #29
/claim #34

Closes tscircuit#34

Adds a new `snapSameNetTraces` step to `TraceCleanupSolver` that detects
parallel segments belonging to the same net that are within a configurable
threshold (default 0.05) of each other and snaps them to their midpoint
coordinate, eliminating near-coincident same-net trace lines.

- New file: lib/solvers/TraceCleanupSolver/snapSameNetTraces.ts
- Modified: TraceCleanupSolver pipeline adds `snapping_same_net` step after `balancing_l_shapes`
- New file: tests/solvers/TraceCleanupSolver/snapSameNetTraces.test.ts (7 unit tests)
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment May 22, 2026 2:37pm

Request Review

@khozakhulile27-netizen khozakhulile27-netizen changed the title feat: snap same-net parallel traces to the same coordinate (Issue #34) fix: snap same-net parallel trace segments to unified coordinates May 22, 2026
@khozakhulile27-netizen
Copy link
Copy Markdown
Author

"Hi everyone! 👋
​I've resolved the formatting issues. All CI checks are passing perfectly, and the branch has no conflicts. It's ready for review and merge whenever you have a moment. Thank you!"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant