Add via-vs-trace clearance check and integrate into exports and runners#135
Merged
imrishabh18 merged 3 commits intomainfrom Apr 19, 2026
Merged
Add via-vs-trace clearance check and integrate into exports and runners#135imrishabh18 merged 3 commits intomainfrom
imrishabh18 merged 3 commits intomainfrom
Conversation
seveibar
approved these changes
Apr 19, 2026
Contributor
seveibar
left a comment
There was a problem hiding this comment.
a pcb snapshot test would improve this, since the svg snapshots usually show the errors and where the center is (i think)
| actual_clearance: gap, | ||
| center: { | ||
| x: (via.x + (segment.x1 + segment.x2) / 2) / 2, | ||
| y: (via.y + (segment.y1 + segment.y2) / 2) / 2, |
Contributor
There was a problem hiding this comment.
this isn't the best center fwiw- this will always appear "off", you have to ask "which point on the segment is closest to the via", then go between that closest point and the via. The closest point can be computed by "projecting" the via point onto the segment, which has a small formula
Also best to have a pcb visual snapshot for this to see the point
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
lib/check-via-trace-clearance.tswhich implementscheckViaTraceClearanceusingsegmentToCircleMinDistance, connectivity checks, and returnspcb_via_trace_clearance_errorobjects when clearance is below the configured minimum.checkViaTraceClearancefromindex.tsand including it inrunAllRoutingChecksinlib/run-all-checks.ts.README.mdto document the newcheckViaTraceClearancefunction and list it in the routing checks overview.tests/lib/check-via-trace-clearance.test.tsand updatepackage.jsondev/peer dependency ordering and version metadata.Testing
bun test, which executedtests/lib/check-via-trace-clearance.test.tsand the two added assertions passed.Codex Task