Skip to content

feat: add TraceCombineSolver to merge close same-net segments#154

Open
sanadidari wants to merge 2 commits intotscircuit:mainfrom
sanadidari:feat/trace-combine-solver
Open

feat: add TraceCombineSolver to merge close same-net segments#154
sanadidari wants to merge 2 commits intotscircuit:mainfrom
sanadidari:feat/trace-combine-solver

Conversation

@sanadidari
Copy link
Copy Markdown

feat: add TraceCombineSolver phase to merge same-net trace segments (#29)

Summary

This PR introduces a new pipeline phase, TraceCombineSolver, designed to identify and merge parallel trace segments belonging to the same net that are within a defined distance threshold. This significantly reduces visual clutter in complex schematics where multiple connections on the same net might run in parallel.

🛠️ Strategic Changes

  • New Solver: Implemented a robust segment-based snapping and merging algorithm for Manhattan traces.
  • Decomposition: Traces are now decomposed into horizontal and vertical segments before comparison.
  • Snapping & Merging: Segments with coordinates within the distanceThreshold are snapped to a common axis and overlapping intervals are merged into single continuous paths.
  • Pipeline Integration: Injected between TraceLabelOverlapAvoidanceSolver and TraceCleanupSolver to optimize the input for subsequent cleanup phases.

🧪 Testing & Validation

  • Created a new test suite: tests/solvers/TraceCombineSolver/TraceCombineSolver.test.ts.
  • Validated against simple parallel paths and complex paths with varying point counts.
  • Successfully ran the entire project test suite (some existing snapshots updated as expected due to the merging logic).

📈 Impact

  • Cleaner final schematics.
  • Reduced segment count in the output JSON/SVG.
  • Better performance for downstream cleanup/label placement solvers.

Signed-off-by: [Votre Nom/GitHub ID]

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 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 Mar 31, 2026 9:03am

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.

1 participant