Skip to content

Add DRC check: vias too close to pads#133

Open
fengfirewudi wants to merge 3 commits intotscircuit:mainfrom
fengfirewudi:add-via-to-pad-spacing-check
Open

Add DRC check: vias too close to pads#133
fengfirewudi wants to merge 3 commits intotscircuit:mainfrom
fengfirewudi:add-via-to-pad-spacing-check

Conversation

@fengfirewudi
Copy link
Copy Markdown

Summary

  • Adds checkViaToPadSpacing() that detects vias too close to pads (pcb_smtpad and pcb_plated_hole)
  • Uses rect-to-circle distance for rectangular pads, center-to-center minus radii for circular pads
  • Skips via-pad pairs on the same net or on different layers
  • Wired into runAllRoutingChecks and exported from the package index

Test plan

  • Added 6 test cases covering: rect pad too close, far enough, same net (no error), different layers (no error), circle pad too close, plated hole too close
  • TypeScript compiles cleanly (tsc --noEmit passes)

Closes #44

fengfirewudi and others added 3 commits April 15, 2026 17:26
Implements a new check that detects when vias are too close to pads
(pcb_smtpad and pcb_plated_hole), using rect-to-circle distance
calculations for rectangular pads. Skips pairs on the same net or
different layers. Closes tscircuit#44.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test for "no error when via and pad are on the same net" was
failing because the pcb_trace was missing its source_trace_id link,
so the connectivity map could not resolve via and pad as connected.
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.

New DRC Check: Check vias aren't too close to pads

1 participant