From 33aa6edb0186b0a1e9b4717ed6e5e492db4b441f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 3 Jan 2021 23:26:42 +0000 Subject: [PATCH] Don't run clearance tests on unflashed NPTH pad layers. --- .../drc_test_provider_copper_clearance.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index 2ba700bf00..bf9b3e0e37 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -162,9 +162,6 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run() if( !reportProgress( ii++, count, delta ) ) return false; - if( item->Type() == PCB_FP_TEXT_T && !static_cast( item )->IsVisible() ) - return true; - m_copperTree.Insert( item, m_largestClearance ); return true; }; @@ -271,6 +268,14 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( TRACK* track, SHA int actual; VECTOR2I pos; + if( other->Type() == PCB_PAD_T ) + { + PAD* pad = static_cast( other ); + + if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) ) + testClearance = false; + } + if( testClearance ) { constraint = m_drcEngine->EvalRulesForItems( CLEARANCE_CONSTRAINT, track, other, layer ); @@ -520,6 +525,12 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa testClearance = false; } + if( pad->GetAttribute() == PAD_ATTRIB_NPTH && !pad->FlashLayer( layer ) ) + testClearance = false; + + if( !IsCopperLayer( layer ) ) + testClearance = false; + // Track clearances are tested in testTrackClearances() if( dynamic_cast( other) ) testClearance = false; @@ -615,6 +626,9 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa // Pads of the same (defined) net get a waiver on clearance tests if( pad->GetNetCode() && otherPad->GetNetCode() == pad->GetNetCode() ) testClearance = false; + + if( otherPad->GetAttribute() == PAD_ATTRIB_NPTH && !otherPad->FlashLayer( layer ) ) + testClearance = false; } if( testClearance )