Skip to content

fix: merge overlapping collinear segments in schematic traces #34#114

Open
GDN84 wants to merge 1 commit intotscircuit:mainfrom
GDN84:main
Open

fix: merge overlapping collinear segments in schematic traces #34#114
GDN84 wants to merge 1 commit intotscircuit:mainfrom
GDN84:main

Conversation

@GDN84
Copy link

@GDN84 GDN84 commented Feb 4, 2026

Description

This PR addresses issue #34 by implementing a segment-merging phase in the main solve function.

Changes

  • lib/index.ts: Added mergeCollinearSegments helper function to identify and combine overlapping or touching segments on the same X or Y axis.
  • lib/index.ts: Updated the solve function to map input edges, process them through the merger, and return the cleaned-up results.
  • tests/issue34.test.ts: Created a new test file with overlapping segments to verify the fix.

Testing Results

  • The new test case confirms that 3 overlapping segments (which previously resulted in 3 separate edges) are now correctly merged into 1 single edge.
  • Pass Status: 1 pass, 0 fail.

Closes #34

@vercel
Copy link

vercel bot commented Feb 4, 2026

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

Project Deployment Actions Updated (UTC)
schematic-trace-solver Error Error Feb 4, 2026 4:56pm

Request 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)

1 participant