PNS: Discard duplicate tracks in FixRoute

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8737
This commit is contained in:
Jon Evans 2021-07-13 21:13:40 -04:00
parent ff2e470a6e
commit e61b1f03b8
3 changed files with 14 additions and 3 deletions

View File

@ -1365,7 +1365,9 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
std::unique_ptr<ARC> ap = std::make_unique<ARC>( arc );
lastItem = ap.get();
m_lastNode->Add( std::move( ap ) );
if( !m_lastNode->Add( std::move( ap ) ) )
lastItem = nullptr;
lastArc = arcIndex;
}
}

View File

@ -662,10 +662,19 @@ void NODE::addArc( ARC* aArc )
}
void NODE::Add( std::unique_ptr< ARC > aArc )
bool NODE::Add( std::unique_ptr< ARC > aArc, bool aAllowRedundant )
{
const SHAPE_ARC& arc = aArc->CArc();
if( !aAllowRedundant && findRedundantArc( arc.GetP0(), arc.GetP1(), aArc->Layers(),
aArc->Net() ) )
{
return false;
}
aArc->SetOwner( this );
addArc( aArc.release() );
return true;
}

View File

@ -257,7 +257,7 @@ public:
bool Add( std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant = false );
void Add( std::unique_ptr< SOLID > aSolid );
void Add( std::unique_ptr< VIA > aVia );
void Add( std::unique_ptr< ARC > aArc );
bool Add( std::unique_ptr< ARC > aArc, bool aAllowRedundant = false );
void Add( LINE& aLine, bool aAllowRedundant = false );