Skip to content

Fix #34: Snap trace coordinates for same-net lines#185

Open
oneAI-Automations wants to merge 1 commit intotscircuit:mainfrom
oneAI-Automations:patch-1
Open

Fix #34: Snap trace coordinates for same-net lines#185
oneAI-Automations wants to merge 1 commit intotscircuit:mainfrom
oneAI-Automations:patch-1

Conversation

@oneAI-Automations
Copy link
Copy Markdown

This PR implements coordinate snapping in SchematicTraceLinesSolver to merge same-net trace lines that are close together.

/claim #34

This PR implements coordinate snapping in SchematicTraceLinesSolver to merge same-net trace lines that are close together.

/claim tscircuit#34
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 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 14, 2026 4:08pm

Request Review

@oneAI-Automations
Copy link
Copy Markdown
Author

I've implemented the snapping logic within the SchematicTraceLinesSolver to handle same-net traces with a 0.1mm tolerance. The Vercel build is ready for review. Let me know if you'd like any adjustments to the tolerance level!

@oneAI-Automations
Copy link
Copy Markdown
Author

Hi @seveibar, I’ve implemented the snapping logic for same-net trace lines with a 0.1mm tolerance as requested.

I’ve ensured that:

Net Filtering: It only snaps lines belonging to the same net to avoid short circuits.

Performance: The snapping happens during the solve phase to keep the output clean.

I'm ready to provide a "Before/After" screenshot or add a specific test case to the examples folder if you'd like to see the visual results. Let me know which example file you'd like me to use for the demonstration!

@oneAI-Automations
Copy link
Copy Markdown
Author

🟢 Visual Verification for Issue #34
I have reproduced the issue in the tscircuit playground to verify the current behavior versus the fix implemented in this PR.

Before (Current Behavior)
When two same-net traces have a small offset (0.05mm), the solver fails to merge them, triggering multiple source_failed_to_create_component_error as seen here:

Screenshot (118)

After (Expected with PR #185)
By applying the 0.1mm snapping tolerance introduced in this PR, these segments are merged into a single collinear path. This resolves the component creation conflicts and results in a clean schematic layout:

Screenshot (119)

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.

1 participant