mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
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:
parent
89b8b37af2
commit
88ad461514
@ -870,24 +870,10 @@ EDA_ANGLE SHAPE_ARC::GetCentralAngle() const
|
||||
return ANGLE_360;
|
||||
|
||||
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
|
||||
// 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;
|
||||
return angle1.Normalize180() + angle2.Normalize180();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user