Skip to content

feat: add checkViaPadClearance DRC check#146

Open
brone1323 wants to merge 1 commit into
tscircuit:mainfrom
brone1323:feat/check-via-pad-clearance-v2
Open

feat: add checkViaPadClearance DRC check#146
brone1323 wants to merge 1 commit into
tscircuit:mainfrom
brone1323:feat/check-via-pad-clearance-v2

Conversation

@brone1323

Copy link
Copy Markdown

Summary

Implements checkViaPadClearance — a new placement DRC check that detects when a via's copper annular ring is too close to a pad on a different electrical net. This addresses issue #44.

  • Adds lib/check-via-pad-clearance.ts using the same distance helpers from @tscircuit/circuit-json-util that other checks use
  • Handles both circular and rectangular pads
  • Defaults to JLCPCB min_trace_to_pad_edge_clearance; respects board-level DRC overrides
  • Wired into runAllPlacementChecks() and exported from the package index
  • 4 unit tests: violation detected, clean clearance, same-net skipped, no-via no-op

Test plan

  • bun test tests/lib/check-via-pad-clearance.test.ts — 4 pass, 0 fail
  • Existing related tests (check-same-net-via-spacing, check-pad-pad-clearance, check-via-trace-clearance) still pass

Implements a new placement check that detects when a via's copper
annular ring is too close to a pad on a different electrical net.
Uses the same circle/polygon distance helpers as existing checks,
defaults to JLCPCB min_trace_to_pad_edge_clearance, and is wired
into runAllPlacementChecks / the package index.

Includes 4 unit tests covering violation, clean, same-net, and
no-via cases.
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