Skip to content

fix: resolve #34 — This PR addresses issue #34 by implementing a heuristic to align closely#263

Closed
Ingenieralejo wants to merge 8 commits intotscircuit:mainfrom
Ingenieralejo:fix/issue-34
Closed

fix: resolve #34 — This PR addresses issue #34 by implementing a heuristic to align closely#263
Ingenieralejo wants to merge 8 commits intotscircuit:mainfrom
Ingenieralejo:fix/issue-34

Conversation

@Ingenieralejo
Copy link
Copy Markdown

Summary

Resolves #34.

Changes

  • lib/solvers/TraceCleanupSolver/alignSameNetTraces.ts: Updated to address the issue requirements
  • lib/solvers/TraceCleanupSolver/TraceCleanupSolver.ts: Updated to address the issue requirements
  • tests/issue-34-alignment.test.ts: Updated to address the issue requirements
  • tests/__snapshots__/issue-34-alignment.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example02.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example15.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example18.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example19.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example20.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example21.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example28.snap.svg: Updated to address the issue requirements
  • tests/examples/__snapshots__/example29.snap.svg: Updated to address the issue requirements

Verification

  • Lint passes locally
  • Build succeeds
  • Existing tests pass
  • Changes are minimal and focused on the reported issue

Context

This PR addresses issue #34 by implementing a heuristic to align closely situated trace segments of the same net.

Changes:

  • Added alignSameNetTraces heuristic that clusters horizontal/vertical segments within a 0.3-unit threshold and shifts them to their median coordinate.
  • Integrated the alignment step into the TraceCleanupSolver pipeline (after untangling and before turn minimization).
  • Restricted modifications to internal trace segments only, preserving pin connections and orthogo

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 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 8, 2026 1:25am

Request Review

…cuit#34)

- Add alignSameNetTraces heuristic that clusters horizontal/vertical
  segments within 0.3-unit threshold and shifts them to the median Y/X
  coordinate, reducing visual noise in dense schematic layouts.
- Integrate alignment step into TraceCleanupSolver pipeline between
  untangling and minimizing_turns phases.
- Only modify internal trace segments to preserve pin connections and
  orthogonal routing constraints.
- Add reproduction test (issue-34-alignment.test.ts) with dual-chip
  obstacle scenario.
- Update 8 example snapshots to reflect improved alignment geometry.

Closes tscircuit#34
@Ingenieralejo
Copy link
Copy Markdown
Author

Closing this as redundant. All trace merging logic for issue #34 has been consolidated into PR #233 for a more surgical and high-precision review.

@Ingenieralejo
Copy link
Copy Markdown
Author

Closing this as redundant. All trace merging logic for issue #34 has been consolidated into PR #233 for a more surgical and high-precision review.

1 similar comment
@Ingenieralejo
Copy link
Copy Markdown
Author

Closing this as redundant. All trace merging logic for issue #34 has been consolidated into PR #233 for a more surgical and high-precision review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge same-net trace lines that are close together (make at the same Y or same X)

2 participants