From d0796399a248f3ca3154c6ec250cc7ecf3f8143e Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 11 Apr 2022 16:55:54 -0700 Subject: [PATCH] DP tolerance needs to be 1IU on each axis ApproximatelyParallel will only check for parallel within 1 IU, so a 1x1 SEG will always be parallel and the projection is invalid --- pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp index 2d58fdc17c..a3f8a6eb26 100644 --- a/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp +++ b/pcbnew/drc/drc_test_provider_diff_pair_coupling.cpp @@ -210,9 +210,9 @@ static void extractDiffPairCoupledItems( DIFF_PAIR_ITEMS& aDp, DRC_RTREE& aTree SEG ssp ( sp->GetStart(), sp->GetEnd() ); SEG ssn ( sn->GetStart(), sn->GetEnd() ); - // 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) ) + // Segments that are ~ 1 IU in length per side are approximately parallel (tolerance is 1 IU) + // with everything and their parallel projection is < 1 IU, leading to bad distance calculations + if( ssp.SquaredLength() > 2 && ssn.SquaredLength() > 2 && ssp.ApproxParallel(ssn) ) { DIFF_PAIR_COUPLED_SEGMENTS cpair; bool coupled = commonParallelProjection( ssp, ssn, cpair.coupledP, cpair.coupledN );