Browse Source

PNS: Discard duplicate tracks in FixRoute

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8737
6.0.7
Jon Evans 4 years ago
parent
commit
e61b1f03b8
  1. 4
      pcbnew/router/pns_line_placer.cpp
  2. 11
      pcbnew/router/pns_node.cpp
  3. 2
      pcbnew/router/pns_node.h

4
pcbnew/router/pns_line_placer.cpp

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

11
pcbnew/router/pns_node.cpp

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

2
pcbnew/router/pns_node.h

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

Loading…
Cancel
Save