Fix false positive DRC footprint parity test.

This fix removed the Euclidean normalization test and replaced it with an
arc center X and Y coordinate differential check.  The error epsilon was
increased to 200nm due to the arc center position calculation code using
the near 100nm position.

https://gitlab.com/kicad/code/kicad/-/issues/15917
This commit is contained in:
Wayne Stambaugh 2023-10-21 12:37:17 -04:00
parent 5a51a6b179
commit e664605c90
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2021-2022 KiCad Developers. * Copyright (C) 2021-2023 KiCad Developers.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -216,9 +216,11 @@ bool shapesNeedUpdate( const FP_SHAPE* a, const FP_SHAPE* b )
TEST( a->GetStart0(), b->GetStart0() ); TEST( a->GetStart0(), b->GetStart0() );
TEST( a->GetEnd0(), b->GetEnd0() ); TEST( a->GetEnd0(), b->GetEnd0() );
// Arc center is calculated and so may have round-off errors when parents are // Arc center is calculated to the nearest 100nm increment and may have round-off errors
// differentially rotated. // when parents are differentially rotated. See CalcArcCenter() function in
if( ( a->GetCenter0() - b->GetCenter0() ).EuclideanNorm() > pcbIUScale.mmToIU( 0.0001 ) ) // ./libs/kimath/src/trigo.cpp.
if( ( std::abs( a->GetCenter0().x - b->GetCenter0().x ) > pcbIUScale.mmToIU( 0.0002 ) ) ||
( std::abs( a->GetCenter0().y - b->GetCenter0().y ) > pcbIUScale.mmToIU( 0.0002 ) ) )
return true; return true;
break; break;