Skip to content

Add test config#177

Open
mitchellecm7 wants to merge 6 commits intotscircuit:mainfrom
mitchellecm7:add-test-config
Open

Add test config#177
mitchellecm7 wants to merge 6 commits intotscircuit:mainfrom
mitchellecm7:add-test-config

Conversation

@mitchellecm7
Copy link
Copy Markdown

Fix: Merge same-net trace lines that are close together (#34)

/claim #34

Problem
When multiple traces on the same net are routed in parallel, the
TraceOverlapShiftSolver offsets them slightly to avoid exact overlap.
This results in visually redundant near-duplicate lines that should
render as one.

Solution
Added mergeCloseParallelSegments utility that:

  • Groups solved traces by globalConnNetId
  • For each same-net trace pair, scans all segment combinations
  • If two segments are horizontal and within threshold distance in Y,
    and their X-intervals overlap → snaps both to midpoint Y
  • If two segments are vertical and within threshold distance in X,
    and their Y-intervals overlap → snaps both to midpoint X
  • Default threshold: 0.1 schematic units (configurable)

Integrated into TraceCleanupSolver so it runs automatically in the pipeline.
Demo

Before: (two separate parallel same-net traces):

1

After: (merged to same Y):

1a

the UI video link

correct.mp4

Files Changed

  • lib/utils/mergeCloseParallelSegments.ts — core merge utility
  • lib/solvers/TraceCleanupSolver/TraceCleanupSolver.ts — integrate merge pass
  • site/SchematicTracePipelineSolver/MergeSameNetTraces.page.tsx — demo fixture
  • tests/mergeCloseParallelSegments.test.ts — unit tests

Tests

  • ✅ Horizontal same-net segments snap to midpoint Y
  • ✅ Vertical same-net segments snap to midpoint X
  • ✅ Different-net segments are NOT merged
  • ✅ Segments beyond threshold are NOT merged
  • ✅ Non-overlapping segments are NOT merged

- Added SameNetSegmentMergingSolver to merge close same-net trace segments
- Integrated into SchematicTracePipelineSolver pipeline
- Added demo page SameNetSegmentMergingDemo.page.tsx
- Merges collinear segments within 0.5 unit threshold
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 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 12, 2026 11:22pm

Request Review

@mitchellecm7
Copy link
Copy Markdown
Author

100% bounty claim
@rushabhcodes good day

@rushabhcodes
Copy link
Copy Markdown

Hey @mitchellecm7 ! We have stopped the bounty program. But we do sponsor people. For more information about this, look into the docs, you can alos join our discord.

@mitchellecm7
Copy link
Copy Markdown
Author

@rushabhcodes but did I pass the bounty, and also you do sponsor people? The docs and discord Link

@rushabhcodes
Copy link
Copy Markdown

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.

2 participants