diff --git a/pcbnew/drc/drc_test_provider_physical_clearance.cpp b/pcbnew/drc/drc_test_provider_physical_clearance.cpp index 42f8384009..e9104130c6 100644 --- a/pcbnew/drc/drc_test_provider_physical_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_physical_clearance.cpp @@ -647,7 +647,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem if( aItem->Type() == PCB_VIA_T ) { - wxCHECK_MSG( aItem->GetLayerSet().Contains( aLayer ), violations, + LSET layers = aItem->GetLayerSet(); + + if( layers.Contains( F_Cu ) ) + layers |= LSET::FrontBoardTechMask().set( F_CrtYd ); + + if( layers.Contains( B_Cu ) ) + layers |= LSET::BackBoardTechMask().set( B_CrtYd ); + + if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) ) + layers |= LSET::AllCuMask(); + + wxCHECK_MSG( layers.Contains( aLayer ), violations, wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); itemHoleShape = aItem->GetEffectiveHoleShape(); @@ -659,7 +670,18 @@ int DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aItem if( other->Type() == PCB_VIA_T ) { - wxCHECK_MSG( other->GetLayerSet().Contains( aLayer ), violations, + LSET layers = other->GetLayerSet(); + + if( layers.Contains( F_Cu ) ) + layers |= LSET::FrontBoardTechMask().set( F_CrtYd ); + + if( layers.Contains( B_Cu ) ) + layers |= LSET::BackBoardTechMask().set( B_CrtYd ); + + if( layers.Contains( F_Cu ) && layers.Contains( B_Cu ) ) + layers |= LSET::AllCuMask(); + + wxCHECK_MSG( layers.Contains( aLayer ), violations, wxT( "Bug! Vias should only be checked for layers on which they exist" ) ); otherHoleShape = other->GetEffectiveHoleShape();