EasyEDA schematic import: fix nan center for elliptic arcs.

This commit is contained in:
Alex 2024-02-11 23:45:03 +03:00
parent fe1579ebbd
commit bf9d085c15
1 changed files with 2 additions and 5 deletions

View File

@ -660,12 +660,9 @@ void SCH_EASYEDA_PARSER::ParseSymbolShapes( LIB_SYMBOL* aSymbol
VECTOR2D delta = end - start;
double avgRad = ( rad.x + rad.y ) / 2;
double d = delta.EuclideanNorm();
double h = sqrt( rad.x * rad.x - d * d / 4 );
//double aa = sqrt(1/(d*d)* ( 4*d*d*rad - d*d*d*d));
//double h = sqrt( radX - d * d / 4 );
double h = sqrt( std::max( 0.0, avgRad * avgRad - d * d / 4 ) );
//( !far && cw ) => h
//( far && cw ) => -h