public void ProcessArc(ShxGlyphCommandFractionalArc a) { var arc = FromArcCommand(a, ref _lastPoint); if (_isDrawing) { Paths.Add(arc); } }
public static ShxArc FromArcCommand(ShxGlyphCommandFractionalArc a, ref ShxPoint lastPoint) { var radius = a.HighRadius * 256.0 + a.Radius; var startOctantAngle = a.StartingOctant * 45.0; var endOctantAngle = (a.StartingOctant + a.OctantCount - 1) * 45.0; var startAngleDegrees = (45.0 * a.StartOffset / 256.0) + startOctantAngle; var startAngleRadians = startAngleDegrees * Math.PI / 180.0; var endAngleDegrees = (45.0 * a.EndOffset / 256.0) + endOctantAngle; var endAngleRadians = endAngleDegrees * Math.PI / 180.0; var startVector = ShxPoint.FromAngleRadians(startAngleRadians) * radius; var endVector = ShxPoint.FromAngleRadians(endAngleRadians) * radius; var center = lastPoint - startVector; lastPoint = center + endVector; var arc = new ShxArc(center, radius, startAngleRadians, endAngleRadians); return(arc); }