An Approximation of Bézier Curves by a Sequence of Circular Arcs

Some researches have investigated that a Bézier curve can be treated as circular arcs. This work is to propose a new scheme for approximating an arbitrary degree Bézier curve by a sequence of circular arcs. The sequence of circular arcs represents the shape of the given Bézier curve which cannot be expressed using any other algebraic approximation schemes. The technique used for segmentation is to simply investigate the inner angles and the tangent vectors along the corresponding circles. It is obvious that a Bézier curve can be subdivided into the form of subcurves. Hence, a given Bézier curve can be expressed by a sequence of calculated points on the curve corresponding to a parametric variable t . Although the resulting points can be used in the circular arc construction, some duplicate and irrelevant vertices should be removed. Then, the sequence of inner angles are calculated and clustered from a sequence of consecutive pixels. As a result, the output dots are now appropriate to determine the optimal circular path. Finally, a sequence of circular segments of a Bézier curve can be approximated with the pre-defined resolution satisfaction. Furthermore, the result of the circular arc representation is not exceeding a user-specified tolerance. Examples of approximated n th -degree Bézier curves by circular arcs are shown to illustrate efficiency of the new method.


Introduction
In geometric modeling, there are different kinds of file formats used in design and production processes. In the design process, models are usually designed by Bézier curves and B-spline but such models cannot be directly used in the production process. Besides the vector graphics format used in design applications, the raster graphics format is another format applied in the production process. Exchanging data between processes, shapes must be converted into arcs or lines for each supported format because arcs and lines can be used as media for both data form ats: vector and raster. Using only line segments, the machine will receive numerous lines of code in production. Reducing lines of code, circular arcs must be used.
In CAD/CAM applications Bézier curves are commonly used because it can model complex curves with shape preservation during control point relocation [4]. In the past, only quadratic and cubic Bézier curves were used to design because of some limitations. However, some technologies are developed to accept arbitrary degree Bézier curves for drawing models e.g. the style spline feature in SolidWorks application [19]. Thus, investigation in the arbitrary degree of Bézier curves is appropriate to represent the model of data exchange between design and production process with modern technologies.
In manufacturing industries, Computerized Numerical Control (CNC) can only support arc and line segments to cut the workpieces. Typically, a nonlinear shape can only be subdivided into a sequence of line segments. The method can be called a linearization process. Linearizing with the high precision of interpolation, it will be dramatically increased by a large number of the line segments. To improve the efficiency of the production of CNC machine, a quadratic Bézier curve can be approximated by a sequence of arc segments [1, 10-12, 14, 20]. The curve fitting using linear and circular-arc interpolation was first presented by L. Piegl [14] in 1986. However, this method could only create a continuous path and errors always occured at the joints of subcurves. Later, this approximation algorithm was applied to the cases of quadratic Bézier curves [20]. Although convexity and C 1 properties were improved by approximating methods [1,[10][11][12], these methods are only appropriate for the quadratic Bézier curve. Therefore, the approximation quadratic Bézier curves were used instead of the linearization method.
As regards the cubic Bézier curves representation, subdivision method [15] was invented to improve the efficiency of approximation and to reduce the number of arc segments. The subdivision strategies were applied by bisection method, developed by J. H. Yong et al. [21]. Later, the subdivision algorithm was improved to reduce the number of arcs by A. Riskus [16] in 2013. Besides, a Bézier curve could be described as arc splines by using Hough transform [8]. Nevertheless, the previous circular arc approximation methods employ recursive methods with a number of factors which cause a high computational time and the techniques to cubic Bézier curves were only restricted.
In curve comparison or image matching, for example pattern recognition, curvature [17] is generally used as a feature for characterizing shapes. The curvature at any point of curve can be defined by the inverse of the radius of its osculating circle. Using curvature as a shape description, different primitives are identified with rotation, scaling, and translation invariance. Comparing a raster image (bit-mapped image) to a vector image by extracting curvature as features [7], the vector-to-raster conversion (rasterization) can be discarded. Avoiding rasterization, vector images can keep various merits such as scalability, smoothness and continuity. Nonetheless, there are few methods used to extract curvatures suitably for simple, fast and robust implementation.
Besides vector graphics formats used in applications, a sequence of points or raster images can be used as an input in industries for example trajectory robot arm. A sequence of points is approximated by arcs for supporting machines in production and movement of robotic automation. An optimal arc spline approximation was presented by G. Maier [9] in 2014. This method computes a SMAP (smooth minimum arc path) to construct the path of given point sequences with user-defined tolerance. Approximating path of robot movement, algorithm for planar movement was proposed in [2]. The path of robot movement was approximated by using three points to define a circle technique. Later in 2017, this technique was improved to apply in spatial movement [3]. Moreover, the velocity of the movement is increased while the size of code can be reduced. This paper focuses on circular arc approximation of n th -degree Bézier curves. The key parameter used in this study is linear interpolation of the equal-arc length portions (inscribed regular polygon) on the curve segments. Regarding the merit of polygon, circular arcs can be approximated that proved in [22]. Thus, the inscribed regular polygons are treated as circular arcs on Bézier curve segments. The method to approximate Bézier curves by a sequence of arc splines with inscribed regular polygon was proposed in [13]. The cubic and quintic monotonic Bézier curves were approximated. In this research, the algorithm is improved for approximating arbitrary degree Bézier curves. Section 2 proposes a method of circular arcs approximation of an arbitrary degree Bézier curve by using geometric analysis of a circle. As a result, a set of circular arcs for a Bézier curve approximation can be obtained. Some examples of circular arc approximation of arbitrary degree Bézier curves are shown in Section 3.

Circular Arc Approximation for a Bézier Curve
This section presents an approximation method for a Bézier curve construction by circular arcs. Employing geometric analysis, a sequence of points on a circle has been calculated with the same arc length. However, a Bézier curve can be represented in Bernstein basis function by For any arc lengths of ( ) t B from a to b, point-based methods applied by Simpson's rule [5] is used to estimate the arc length of a Bézier curve as follows: , can be computed from sampling Bézier curve into M equal-length arc portions. By Equation (2), the arc length of each curve segment where 0 j M ≤ ≤ . Then, the equal-arc length portions must satisfy 1 1 .
Any uniform arc vertices j v can be directly calculated by assigning parametric variables, denoted by i t . Then, and it is satisfied by the condition | | 0.
In this paper, uniform arc length vertices are used to detect circular arcs. Such a sequence of vertices will be linearly interpolated to construct an inscribed polygon in a curve. If the sides of a polygon are abundant, the polygon is approaching a curve. It can be implied that the error of linear interpolation depends on a number of sampled points. The more sampled points, the less error of linear interpolation.
has an appropriate number of uniform arc length sampled points, denoted by M , that is satisfied the given error of linear interpolation, called tolerance (τ ) if where t  is a parameter.
It has an error of interpolation, denoted by In calculus, an error ε can be maximized and simplified in terms of interval width, . h b a = − The maximum ε can be considered by τ and defined as follows: The relationship between width of each segment, denoted by h , and number of sampling points, denoted by M , inversely varies to each other as Therefore, By Lemma 1, the number of sampled points can be evaluated adaptively due to the user defined tolerance. Beside tolerance, shape and curve resolutions are also affected by interpolation error. However, shape and curve resolution depend on a set of control points that can be expressed in term of ( ) t B . Hence, Lemma 1 can be applied on any shapes and resolutions of Bézier curves.

Definition 3. (Representation of Bézier subcurves). A Bézier curve defined by a sequence of vertices,
can be subdivided into a sequence of subcurves, denoted by 0 1 2 cos .  are corresponding to the Bézier curve portions, an incidence matrix of Bézier curve can be represented by Considering the incidence matrix, the adjacent edges share a joint point joining two subcurves. Using the incidence matrix to detect circular arcs, a given sequence of edges will be classified as a circular arc if a regular polygon can be inscribed in a given sequence --satisfied Definition 4. First, two edges 0 e and 1 e are combined into a circular path 0 . c Then, incidence matrix is transformed as follows:

Definition 6. (Interior vertices on circular path). Let
Considering inner angle 1 a and 2 a at vertices 1 v and 2 v respectively, the edge 2 e will be merged with circular path 0 c and incidence matrix is transformed as follows: The next step of transforming the incidence matrix, inner angles 2 a and 3 a are considered. An incidence matrix will not be changed because inner angles 2 a and 3 a are not equal. The last pair of inner angles 3 a and 4 a are equal so the incidence matrix will be combined 3 e and 4 e to a new circular path as follows: As a result of incidence matrix transformation in this demonstration, two circular paths are generated by merging edges with the same inner angles. Therefore, there are two circular arcs in such a Bézier curve portion. The first circular arc contains a sequence of ver-  q q q as a circular arc, all points on these subcurves must be points on a circle with radius .
R Considering maximum error ε between i e and i q , it can be determined that The maximum error can be reduced by bisection subcurves as shown in Figure 2. By bisection of subcurves, new subcurves, (1) i q , are subdivided and new line segments, i e , are interpolated. Furthermore, the maximum error is reduced into After bisectioning subcurves times, the maximum error can be defined as follows:

Algorithm for Circular Arcs Approximation
The algorithm uniformly chooses the points on an n th -degree Bézier curve by two techniques by time parameter t and space . s For the first calculation, a great number of generated points, denoted by N , is used to compute an arc length array,  The new sequence of edges with subcurve bisection

Examples
For the convenience of estimation, the algorithm can be implemented with screen coordinate. Considering an initial number of segments N , all distances among adjacent points must be less than a point pixel to generate the continuous arc length parameter . i s The maximum distance between two adjacent points is actually the endpoints of the curve so we must approximate 1 p which is next to 0 p (when 0 p is the first control point 0 b ).
Suppose that 1 t is the corresponding parameter 1 p , Then, it is obtained that By Newton Raphson's method [18], the parameter 1 t can be approximated by (11) where 0 t is an initial condition given by the user.
Evaluating the similarity between the given original curve and the calculated curve, both curves are scan converted into two sets of points. After performing scan conversion of a given Bézier curve, such a curve is represented by a sequence of points. The maximum distance between two adjacent points must be less than or equal to one pixel on the screen coordinate. Then, all points are rounded and combined all duplicate points. Employing the scan conversion for an approximated curve, Bresenham's circle algorithm [6] is adopted to render points on each circular arc on the Bézier path. The distance error determination of a point on the given curve and a corresponding point on the calculated curve is considered and compared in Table 1.
Example 1. Given a 5 th -degree Bézier curve ( ) t B with control points 0 (0, 600) , and 5 (900, 0) = b (see Figure 3). A sequence of circular arcs approximates ( ) t B with the given tolerance 1. τ = The curve of ( ) t B can be approximated by 25 circular arcs (as shown in Figure 4). The maximum error distance is 1.41421 pixels, and the average error distance is 0.26925 pixels. (see Figure 5) is considered. Circular arcs approximate ( ) t B with the given tolerance 1. τ = The curve of ( ) t B

Figure 4
A circular arcs approximation curve is approximated by 43 circular arcs (see Figure 6). The maximum error distance is 1.41421 pixels, and the average error distance is 0.170438 pixels.  (see Figure 7). Circular arcs approximate ( ) t B with a given tolerance 1.
is generated by 33 circular arcs (see Figure 8). The maximum error distance is 1.0 pixel, in other words, the average error distance is 0.235443 pixels.  If Bézier curve is approximated by circular arcs, then there may be some unpredicted constraints, for example, the degree of the Bézier curve, the inflection point investigation, and the resolution of the curve.
To improve the approximation, the analytic geometry of a circle is applied by classifying the regular polygon segment on each set of subcurves.

Figure 9
An 14 th -degree Bézier curve Table 1 shows the maximum and mean errors of the circular arcs approximation using the proposed method. Accordingly, Bézier curves can be approximated with in a user-specified tolerance band.

Figure 10
A circular arcs approximation curve Table 1 The maximum and mean errors of the circular arc approximation via our proposed algorithm The determination of a Bézier curve can be represented by a sequence of circular arcs on a raster graphic display. Applying analytic geometry of a circle, a sequence of Bézier subcurves, which can be inscribed by a regular polygon, can be classified as a circular arc. The relationship among vertices and edges can be shown as an incidence matrix. It can be transformed into a simpler form by row elimination with the condition that the inner angles are equal. Hence, a sequence of circular arcs is simplified. As a result, each row of the final transformation matrix represents a circular arc of a given Bézier curve. Ultimately, a given Bézier curve can be expressed in terms of these circular arcs.

Conclusions
This paper presents a simple and elegant algorithm used for converting an arbitrary degree of Bézier curve into a collection of consecutive circular arcs.
Moreover, this algorithm can also be applied to the input cases of hand-drawn curves. This is very useful for contemporary input devices, e.g., touchscreen or pen-based devices. This approximate algorithm is not only novel and easy to implement in any programming language but also adaptively generates the various results according to the user-defined resolutions. If the given input is very detailed, the result will be more accurate. Nonetheless, the computational complexity of the operation is quadratic 2 ( ( )).

O n
The soundproof for the correctness of our algorithm is also provided in this paper. Since the matrix formulation is adopted to use in this approximation process, the formal and clear proof for each step of the transformation is explicitly well-defined.