router: DP_GATEWAYS::FilterByOrientation() should have exactly opposite filtering condition!

Fixes: lp:1797914
* https://bugs.launchpad.net/kicad/+bug/1797914
This commit is contained in:
Tomasz Włostowski 2018-10-18 14:29:06 +02:00
parent baa4019448
commit bdc64ff0b3
2 changed files with 7 additions and 1 deletions

View File

@ -403,7 +403,7 @@ void DP_GATEWAYS::FilterByOrientation ( int aAngleMask, DIRECTION_45 aRefOrienta
m_gateways.erase( m_gateways.erase(
std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) { std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) {
DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() ); DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() );
return !( orient.Angle( aRefOrientation ) & aAngleMask ); return ( orient.Angle( aRefOrientation ) & aAngleMask );
} ), m_gateways.end() } ), m_gateways.end()
); );
} }

View File

@ -661,14 +661,20 @@ bool DIFF_PAIR_PLACER::routeHead( const VECTOR2I& aP )
m_prevPair->CursorOrientation( fp, midp, dirV ); m_prevPair->CursorOrientation( fp, midp, dirV );
VECTOR2I fpProj = SEG( midp, midp + dirV ).LineProject( fp ); VECTOR2I fpProj = SEG( midp, midp + dirV ).LineProject( fp );
// compute 'leader point' distance from the cursor (project cursor position
// on the extension of the starting segment pair of the DP)
int lead_dist = ( fpProj - fp ).EuclideanNorm(); int lead_dist = ( fpProj - fp ).EuclideanNorm();
gwsTarget.SetFitVias( m_placingVia, m_sizes.ViaDiameter(), viaGap() ); gwsTarget.SetFitVias( m_placingVia, m_sizes.ViaDiameter(), viaGap() );
// far from the initial segment extension line -> allow a 45-degree obtuse turn
if( lead_dist > m_sizes.DiffPairGap() + m_sizes.DiffPairWidth() ) if( lead_dist > m_sizes.DiffPairGap() + m_sizes.DiffPairWidth() )
{ {
gwsTarget.BuildForCursor( fp ); gwsTarget.BuildForCursor( fp );
} }
// close to the initial segment extension line -> keep straight part only, project as close
// as possible to the cursor
else else
{ {
gwsTarget.BuildForCursor( fpProj ); gwsTarget.BuildForCursor( fpProj );