Skip to content

fix: merge same-net collinear traces (#34)#180

Open
a25955813-cloud wants to merge 5 commits intotscircuit:mainfrom
a25955813-cloud:fix/merge-same-net-traces-34
Open

fix: merge same-net collinear traces (#34)#180
a25955813-cloud wants to merge 5 commits intotscircuit:mainfrom
a25955813-cloud:fix/merge-same-net-traces-34

Conversation

@a25955813-cloud
Copy link
Copy Markdown

@a25955813-cloud a25955813-cloud commented Apr 13, 2026

Fixes #34

What this does

Merges collinear trace segments that belong to the same net and share the same X or Y coordinate into a single segment.

Changes

  • Added lib/utils/mergeCollinearTraces.ts — core merge algorithm
  • Added lib/solvers/SameNetTraceMergeSolver.ts — solver class
  • Added tests/merge-collinear-traces.test.ts — 8 passing tests

How it works

  1. Groups segments by net ID
  2. Separates horizontal/vertical/diagonal segments
  3. Merges overlapping or touching segments on the same axis
  4. Leaves diagonal segments untouched

/attempt #34
/claim #34

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 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 Apr 13, 2026 9:39am

Request Review

@a25955813-cloud
Copy link
Copy Markdown
Author

Hi @tscircuit, I've successfully linked my bank account on Algora and it's showing as Active. Could you please confirm if the reward process has been initiated? Thanks!

@a25955813-cloud
Copy link
Copy Markdown
Author

I have updated this PR with a more robust geometric approach. I've added a specialized merge-logic.ts within the TraceCleanupSolver directory that uses a distance tolerance to unify traces. It handles floating-point errors and unifies overlapping segments, providing a more complete fix for #34 than simple state resets.

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

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