From 856cc26d4c5f50d2105c1305220f206b6d5e235c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 18 Oct 2021 18:04:54 +0100 Subject: [PATCH] Allow vias the same same-net waiver that pads have for hole clearance Note that in 7.0 we have physical_hole_clearance rules to give a bit more expressivity here. Fixes https://gitlab.com/kicad/code/kicad/issues/9420 --- pcbnew/drc/drc_test_provider_copper_clearance.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index 2cb1824225..977467e1ea 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -613,8 +613,12 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa if( dynamic_cast( other) ) testClearance = false; - // Pads of the same (defined) net get a waiver on clearance and hole tests - if( otherPad && pad->GetNetCode() && otherPad->GetNetCode() == pad->GetNetCode() ) + int padNet = pad->GetNetCode(); + int otherPadNet = otherPad ? otherPad->GetNetCode() : 0; + int otherViaNet = otherVia ? otherVia->GetNetCode() : 0; + + // Pads and vias of the same (defined) net get a waiver on clearance and hole tests + if( ( otherPadNet && otherPadNet == padNet ) || ( otherViaNet && otherViaNet == padNet ) ) { testClearance = false; testHoles = false;