router: increase parallelity detection threshold for AssembleDiffPair()

Partially fixes the misrecognized diff pairs issue.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/8567
This commit is contained in:
Tomasz Wlostowski 2021-11-22 01:33:32 +01:00
parent 5d2f3257da
commit 89228e1ebe
2 changed files with 4 additions and 2 deletions

View File

@ -463,7 +463,7 @@ bool TOPOLOGY::AssembleDiffPair( ITEM* aStart, DIFF_PAIR& aPair )
s->Width() == refSeg->Width() )
{
int dist = s->Seg().Distance( refSeg->Seg() );
bool isParallel = refSeg->Seg().ApproxParallel( s->Seg() );
bool isParallel = refSeg->Seg().ApproxParallel( refSeg->Seg(), DP_PARALLELITY_THRESHOLD );
SEG p_clip, n_clip;
bool isCoupled = commonParallelProjection( refSeg->Seg(), s->Seg(), p_clip,
@ -496,7 +496,7 @@ bool TOPOLOGY::AssembleDiffPair( ITEM* aStart, DIFF_PAIR& aPair )
int gap = -1;
if( refSeg->Seg().ApproxParallel( coupledSeg->Seg() ) )
if( refSeg->Seg().ApproxParallel( coupledSeg->Seg(), DP_PARALLELITY_THRESHOLD ) )
{
// Segments are parallel -> compute pair gap
const VECTOR2I refDir = refSeg->Anchor( 1 ) - refSeg->Anchor( 0 );

View File

@ -88,6 +88,8 @@ public:
const std::set<ITEM*> AssembleCluster( ITEM* aStart, int aLayer );
private:
const int DP_PARALLELITY_THRESHOLD = 5;
bool followTrivialPath( LINE* aLine, bool aLeft, ITEM_SET& aSet, std::set<ITEM*>& aVisited,
JOINT** aTerminalJoint = nullptr );