Browse Source

Ensure that we check tracks exiting pads for gaps

The DP gap check should look for sections of track that are coupled by
wider than a given spacing.  Our primitive check of looking for
collisions on the segment between the start poins causes tracks exiting
but not entering pads to be excluded.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21561
master
Seth Hillbrand 2 months ago
parent
commit
1e76f1a11d
  1. 37
      pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp

37
pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp

@ -22,6 +22,7 @@
#include <board.h>
#include <board_design_settings.h>
#include <pcb_track.h>
#include <pad.h>
#include <pcb_generator.h>
#include <drc/drc_item.h>
#include <drc/drc_test_provider.h>
@ -361,6 +362,24 @@ static void extractDiffPairCoupledItems( DIFF_PAIR_ITEMS& aDp )
return false;
}
}
else if( aItem->Type() == PCB_PAD_T )
{
PAD* pad = static_cast<PAD*>( aItem );
auto trackExitsPad = [&]( PCB_TRACK* track )
{
bool startIn = pad->HitTest( track->GetStart(), 0 );
bool endIn = pad->HitTest( track->GetEnd(), 0 );
return startIn ^ endIn;
};
if( trackExitsPad( static_cast<PCB_TRACK*>( coupled->parentP ) )
|| trackExitsPad( static_cast<PCB_TRACK*>( coupled->parentN ) ) )
{
return false;
}
}
return true;
};
@ -438,6 +457,24 @@ static void extractDiffPairCoupledItems( DIFF_PAIR_ITEMS& aDp )
return false;
}
}
else if( aItem->Type() == PCB_PAD_T )
{
PAD* pad = static_cast<PAD*>( aItem );
auto arcExitsPad = [&]( PCB_ARC* arc )
{
bool startIn = pad->HitTest( arc->GetStart(), 0 );
bool endIn = pad->HitTest( arc->GetEnd(), 0 );
return startIn ^ endIn;
};
if( arcExitsPad( static_cast<PCB_ARC*>( coupled->parentP ) )
|| arcExitsPad( static_cast<PCB_ARC*>( coupled->parentN ) ) )
{
return false;
}
}
return true;
};

Loading…
Cancel
Save