Fixed bug where via violations were sometimes counted multiple times.

This commit is contained in:
Daniel Treffenstädt 2025-02-19 20:21:06 +01:00
parent 71224ca4bc
commit 850c773f9d
No known key found for this signature in database
GPG Key ID: 3D92CAF477537F3E

View File

@ -148,12 +148,17 @@ bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T )
{ {
if( visited.contains( track ) )
continue;
PCB_VIA* via = static_cast<PCB_VIA*>( track ); PCB_VIA* via = static_cast<PCB_VIA*>( track );
int len = length + (point - via->GetPosition()).EuclideanNorm() - via->GetDrill(); int len = length + (point - via->GetPosition()).EuclideanNorm() - via->GetDrill();
if( len < length_limit ) if( len < length_limit )
{ {
visited.emplace( track );
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_PAD_FANOUT_VIA_DISTANCE ); std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_PAD_FANOUT_VIA_DISTANCE );
wxString msg; wxString msg;
@ -171,7 +176,6 @@ bool DRC_TEST_PROVIDER_FANOUT_CHECKS::Run()
} }
else if( track->Type() == PCB_ARC_T ) else if( track->Type() == PCB_ARC_T )
{ {
// TODO: Figure out how to support arcs.
PCB_ARC* arc = static_cast<PCB_ARC*>( track ); PCB_ARC* arc = static_cast<PCB_ARC*>( track );
SHAPE_ARC arc_shape { arc->GetStart(), arc->GetMid(), arc->GetEnd(), arc->GetWidth() }; SHAPE_ARC arc_shape { arc->GetStart(), arc->GetMid(), arc->GetEnd(), arc->GetWidth() };