Handle severity ignore rules in router.
Fixes https://gitlab.com/kicad/code/kicad/issues/11609
This commit is contained in:
parent
fb5604022c
commit
b8479bf6f1
|
@ -97,13 +97,13 @@ bool ITEM::collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferent
|
||||||
{
|
{
|
||||||
int holeClearance = aNode->GetHoleClearance( this, aOther );
|
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 );
|
Mark( Marker() | MK_HOLE );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( holeB && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
|
if( holeB && holeClearance >= 0 && holeB->Collide( shapeA, holeClearance + lineWidthA ) )
|
||||||
{
|
{
|
||||||
aOther->Mark( aOther->Marker() | MK_HOLE );
|
aOther->Mark( aOther->Marker() | MK_HOLE );
|
||||||
return true;
|
return true;
|
||||||
|
@ -113,7 +113,7 @@ bool ITEM::collideSimple( const ITEM* aOther, const NODE* aNode, bool aDifferent
|
||||||
{
|
{
|
||||||
int holeToHoleClearance = aNode->GetHoleToHoleClearance( this, aOther );
|
int holeToHoleClearance = aNode->GetHoleToHoleClearance( this, aOther );
|
||||||
|
|
||||||
if( holeA->Collide( holeB, holeToHoleClearance ) )
|
if( holeToHoleClearance >= 0 && holeA->Collide( holeB, holeToHoleClearance ) )
|
||||||
{
|
{
|
||||||
Mark( Marker() | MK_HOLE );
|
Mark( Marker() | MK_HOLE );
|
||||||
aOther->Mark( aOther->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 );
|
int clearance = aOverrideClearance >= 0 ? aOverrideClearance : aNode->GetClearance( this, aOther );
|
||||||
|
|
||||||
if( m_parent && m_parent->GetLayer() == Edge_Cuts )
|
if( clearance >= 0 )
|
||||||
{
|
{
|
||||||
int actual;
|
if( m_parent && m_parent->GetLayer() == Edge_Cuts )
|
||||||
VECTOR2I pos;
|
{
|
||||||
|
int actual;
|
||||||
|
VECTOR2I pos;
|
||||||
|
|
||||||
return( shapeA->Collide( shapeB, clearance + lineWidthA, &actual, &pos )
|
if( shapeA->Collide( shapeB, clearance + lineWidthA, &actual, &pos )
|
||||||
&& !aNode->QueryEdgeExclusions( pos ) );
|
&& !aNode->QueryEdgeExclusions( pos ) )
|
||||||
}
|
{
|
||||||
else
|
return true;
|
||||||
{
|
}
|
||||||
return shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB );
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( shapeA->Collide( shapeB, clearance + lineWidthA + lineWidthB ) )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -280,6 +280,14 @@ bool PNS_PCBNEW_RULE_RESOLVER::QueryConstraint( PNS::CONSTRAINT_TYPE aType,
|
||||||
if( hostConstraint.IsNull() )
|
if( hostConstraint.IsNull() )
|
||||||
return false;
|
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 )
|
switch ( aType )
|
||||||
{
|
{
|
||||||
case PNS::CONSTRAINT_TYPE::CT_CLEARANCE:
|
case PNS::CONSTRAINT_TYPE::CT_CLEARANCE:
|
||||||
|
|
Loading…
Reference in New Issue