Allow diffpair gap to override normal netclass clearance.

Fixes https://gitlab.com/kicad/code/kicad/issues/7975
This commit is contained in:
Jeff Young 2021-04-29 10:23:18 +01:00
parent 64d35ecebc
commit c149ed8905
1 changed files with 11 additions and 4 deletions

View File

@ -288,10 +288,17 @@ void DRC_ENGINE::loadImplicitRules()
netclassRule->m_Condition = new DRC_RULE_CONDITION( expr );
netclassItemSpecificRules.push_back( netclassRule );
DRC_CONSTRAINT constraint( DIFF_PAIR_GAP_CONSTRAINT );
constraint.Value().SetMin( bds.m_MinClearance );
constraint.Value().SetOpt( nc->GetDiffPairGap() );
netclassRule->AddConstraint( constraint );
DRC_CONSTRAINT gapConstraint( DIFF_PAIR_GAP_CONSTRAINT );
gapConstraint.Value().SetMin( bds.m_MinClearance );
gapConstraint.Value().SetOpt( nc->GetDiffPairGap() );
netclassRule->AddConstraint( gapConstraint );
// The diffpair gap overrides the netclass min clearance, but not the board
// min clearance.
DRC_CONSTRAINT clearanceConstraint( CLEARANCE_CONSTRAINT );
clearanceConstraint.Value().SetMin( std::max( bds.m_MinClearance,
nc->GetDiffPairGap() ) );
netclassRule->AddConstraint( clearanceConstraint );
}
if( nc->GetViaDiameter() || nc->GetViaDrill() )