Don't extract dp segment info from minimal-length

segments with 1IU of length are approximately parallel to everything and
the distance projections break down into rounding errors

Fixes https://gitlab.com/kicad/code/kicad/issues/8541
This commit is contained in:
Seth Hillbrand 2021-06-02 17:13:10 -07:00
parent 059f79dfdb
commit f40f696c37
1 changed files with 3 additions and 1 deletions

View File

@ -209,7 +209,9 @@ static void extractDiffPairCoupledItems( DIFF_PAIR_ITEMS& aDp, DRC_RTREE& aTree
SEG ssp ( sp->GetStart(), sp->GetEnd() );
SEG ssn ( sn->GetStart(), sn->GetEnd() );
if( ssp.ApproxParallel(ssn) )
// Segments that are == 1 IU in length are approximately parallel with everything and their
// parallel projection is < 1 IU, leading to bad distance calculations
if( ssp.SquaredLength() > 1 && ssn.SquaredLength() > 1 && ssp.ApproxParallel(ssn) )
{
DIFF_PAIR_COUPLED_SEGMENTS cpair;
bool coupled = commonParallelProjection( ssp, ssn, cpair.coupledP, cpair.coupledN );