Handle severity ignore rules in router.

Fixes https://gitlab.com/kicad/code/kicad/issues/11609
This commit is contained in:
Jeff Young 2022-07-09 11:24:19 -06:00
parent fb5604022c
commit b8479bf6f1
2 changed files with 29 additions and 12 deletions

View File

@ -97,13 +97,13 @@ bool ITEM::collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferent
{
int holeClearance = aNode->GetHoleClearance( this, aOther );
if( holeA && holeA->Collide( shapeB, holeClearance + lineWidthB ) )
if( holeClearance >= 0 && holeA && holeA->Collide( shapeB, holeClearance + lineWidthB ) )
{
Mark( Marker() | MK_HOLE );
return true;
}
if( holeB && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
if( holeB && holeClearance >= 0 && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
{
aOther->Mark( aOther->Marker() | MK_HOLE );
return true;
@ -113,7 +113,7 @@ bool ITEM::collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferent
{
int holeToHoleClearance = aNode->GetHoleToHoleClearance( this, aOther );
if( holeA->Collide( holeB, holeToHoleClearance ) )
if( holeToHoleClearance >= 0 && holeA->Collide( holeB, holeToHoleClearance ) )
{
Mark( Marker() | MK_HOLE );
aOther->Mark( aOther->Marker() | MK_HOLE );
@ -130,18 +130,27 @@ bool ITEM::collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferent
int clearance = aOverrideClearance >= 0 ? aOverrideClearance : aNode->GetClearance( this, aOther );
if( m_parent && m_parent->GetLayer() == Edge_Cuts )
if( clearance >= 0 )
{
int actual;
VECTOR2I pos;
if( m_parent && m_parent->GetLayer() == Edge_Cuts )
{
int actual;
VECTOR2I pos;
return( shapeA->Collide( shapeB, clearance + lineWidthA, &actual, &pos )
&& !aNode->QueryEdgeExclusions( pos ) );
}
else
{
return shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB );
if( shapeA->Collide( shapeB, clearance + lineWidthA, &actual, &pos )
&& !aNode->QueryEdgeExclusions( pos ) )
{
return true;
}
}
else
{
if( shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB ) )
return true;
}
}
return false;
}

View File

@ -280,6 +280,14 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
if( hostConstraint.IsNull() )
return false;
if( hostConstraint.GetSeverity() == RPT_SEVERITY_IGNORE )
{
aConstraint->m_Value.SetMin( -1 );
aConstraint->m_RuleName = hostConstraint.GetName();
aConstraint->m_Type = aType;
return true;
}
switch ( aType )
{
case PNS::CONSTRAINT_TYPE::CT_CLEARANCE: