feat: add plated hole drill-to-drill clearance DRC check - #191
Open
zkasuran wants to merge 1 commit into
Open
Conversation
Flag pairs of plated holes whose drilled holes sit closer than the minimum drill edge to drill edge clearance. Implements the Pad Hole-to-Hole Spacing item from tscircuit#15. checkPadPadClearance measures copper and skips same-net pairs, so same-net through holes with their drills too close passed DRC. This check is net independent like checkSameNetViaSpacing because drill spacing is a fabrication constraint.
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.
What
Adds
checkPlatedHoleDrillClearance, a DRC check that flags pairs of plated holes whose drilled holes sit closer than the minimum drill edge to drill edge clearance. This implements the "Pad Hole-to-Hole Spacing" item tracked in #15.Why
min_plated_hole_drill_edge_to_drill_edge_clearance(0.15mm on JLCPCB) is defined in@tscircuit/jlcpcb-manufacturing-specsand can be set per board, but no check reads it today. Two plated holes drilled too close cannot be fabricated reliably: the web of material between the holes breaks down and the drill can wander or break out. The current checks miss this:checkPadPadClearancemeasures the copper pad edges rather than the drill. It also skips same-net pairs, so two same-net through holes can sit with their drills almost touching and still pass.checkSameNetViaSpacingandcheckDifferentNetViaSpacingonly look atpcb_via, notpcb_plated_hole.So a board that should error returns
[]. Minimal repro: two same-net plated holes with 0.05mm annular rings (so the copper does not overlap) whose drills sit 0.12mm apart.runAllChecksreturns[]on this board before this change and a singlepcb_pad_pad_clearance_errorafter it.How
segmentToSegmentMinDistanceminus the two radii, so circle, oval, pill and the rect-pad hole variants are all handled, includinghole_offsetand rotation.checkSameNetViaSpacing, which enforces via hole spacing regardless of connectivity. Copper pad clearance stays incheckPadPadClearance.runAllPlacementChecksnext tocheckPadPadClearanceand exported from the index.Tests
checkPadPadClearancereturns[]while this check returns one error.runAllCheckson that same board returns exactly the new error, which nothing caught before.Verified locally, all green:
bun test(148 pass),bunx tsc --noEmit,bun run format:check,bun run build,bunx @tscircuit/dependency-check.AI assistance
I used AI assistance (Claude) while writing this change. I designed the approach, reviewed the code and verified the behavior myself. Verified locally before submitting:
bun test(148 pass, including the new file),bunx tsc --noEmit,bun run format:check,bun run buildandbunx @tscircuit/dependency-checkall pass.