Revert "SHAPE_ARC::GetCentralAngle(): better algo to calculate actual arc."

This reverts commit 8279276fe4fce1f9ff5931614669ccdf26418886.
This commit is probably good, but arc calculations are a mined field.
So revert until is is widely tested in master branch.
This commit is contained in:
jean-pierre charras 2025-06-01 20:14:37 +02:00
parent 89b8b37af2
commit 88ad461514

View File

@ -870,24 +870,10 @@ EDA_ANGLE SHAPE_ARC::GetCentralAngle() const
return ANGLE_360; return ANGLE_360;
VECTOR2L center = GetCenter(); VECTOR2L center = GetCenter();
EDA_ANGLE angle = EDA_ANGLE( m_end - center ) - EDA_ANGLE( m_start - center ); EDA_ANGLE angle1 = EDA_ANGLE( m_mid - center ) - EDA_ANGLE( m_start - center );
EDA_ANGLE angle2 = EDA_ANGLE( m_end - center ) - EDA_ANGLE( m_mid - center );
// Using only m_start and m_end arc points to calculate the central arc is not enough return angle1.Normalize180() + angle2.Normalize180();
// there are 2 arcs having the same center and end points.
// Using the middle point is mandatory to know what arc is the right one.
// IsClockwise() uses m_start, m_middle and m_end arc points to know the arc orientation
if( !IsClockwise() )
{
if( angle < ANGLE_0 )
angle += ANGLE_360;
}
else
{
if( angle > ANGLE_0 )
angle -= ANGLE_360;
}
return angle;
} }