Browse Source

Handle severity ignore rules in router.

Fixes https://gitlab.com/kicad/code/kicad/issues/11609
7.0
Jeff Young 4 years ago
parent
commit
b8479bf6f1
  1. 33
      pcbnew/router/pns_item.cpp
  2. 8
      pcbnew/router/pns_kicad_iface.cpp

33
pcbnew/router/pns_item.cpp

@ -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;
}

8
pcbnew/router/pns_kicad_iface.cpp

@ -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:

Loading…
Cancel
Save