Abstract

One of the requirements of curves in computer-aided design (CAD) is a curve with monotonic curvature profiles. Generalized log-aesthetic curves (GLACs) comprise a family of aesthetic curves which possesses a monotonic curvature profile. However, we cannot directly implement GLAC in CAD systems since it is in the form of a transcendental form. In this paper, we used cubic trigonometric Bézier (T-Bézier) curves with two shape parameters to approximate GLAC with G2 continuity. The final approximation formula inherits the shape parameters of GLAC whereas T-Béziers’ shape parameters are utilized to satisfy G2 constraints. Numerical results indicate that the proposed algorithm is capable of approximating GLAC within the given tolerance in (at least) two iterations.

1. Introduction

In 2010, Gobithasaan and Miura formulated the generalized log-aesthetic curves (GLACs) [1] by extending the formulation of generalized Cornu spiral (GCS) [2], similar to log-aesthetic curves (LACs) [3]. LAC is a curve obtained by a curve synthesis process using linear representation of logarithmic curvature graph (LCG) which involves the third derivative. Due to its capabilities capturing the shape of natural spirals, LCG has been used as shape interrogation tools [4]. The main characteristic of GLAC is that it has an extra curvature shift parameter (), which increases the flexibility of the curve. In general, the curvature of GLAC is always monotonic and, hence, it produces fair curves where the family is composed of clothoid, logarithmic spiral, circle involute, Neilsen’s curve, and GCS.

There are two types of GLAC, the first one is called -shift GLAC which can be constructed by manipulating the radius of curvature of LAC as follows [1]:

Similarly, the second type of GLAC is called -shift GLAC which can be constructed by manipulating the radius of curvature of LAC as follows [1]:

Thus, the directional angle of GLAC can be represented as follows:and finally, the parametric form of GLAC is as follows:where is the start point, is the angle between the tangent at the start point measured anticlockwise from the x-axis, and are variables related to the shape of the GLAC segment [1]. Fair curves are essential in CAD/CAM environment. However, we cannot implement GLAC in the CAD system directly due to its transcendental form. Thus, one way to implement this curve for design feat is utilizing approximation to traditional curves, for example, quintic Bézier curves approximation using GCS [2] and quintic Bézier curves approximation using LAC [5].

There are numerous works on the representation of splines with trigonometric functions. In 1964, Schoenberg first introduced trigonometric B-splines as a function in space [6]. In 2003, Han introduced piecewise quadratic trigonometric polynomial curves with C1 continuity analogous to the quadratic B-spline curves [7], and in 2004, he further proposed cubic trigonometric polynomial curves with a shape parameter [8]. A class of quartic trigonometric polynomial curves with a shape parameter was presented by Han in 2011 [9].

Similarly, there were attempts to represent traditional Bézier curves with trigonometric coordinate functions. In 1997, Walz introduced trigonometric Lagrange and Berstein polynomials to form Stancu polynomials [10]. A notable work of Han et al. is a cubic trigonometric Bézier (T-Bézier) curve with two shape parameters similar to traditional Bézier curves which were published in 2009 [9]. The advantage of T-Bézier over traditional Bézier curves is twofold: firstly, it can precisely represent circular arcs, cylinders, cones, tori, etc. Thus, CAD implementation becomes an easy task. Secondly, T-Bézier curves are located closer to the control polygon as compared to traditional Bézier curves which are of use during the designing process. The applications of trigonometric splines were the motivation for introducing various types of the trigonometric spline with features suitable for CAD/CAM applications. Readers are referred to [1116] for further advantages of trigonometric splines in geometric modelling.

It is essential to consider the geometric constraints at the endpoints for developing splines which possess local control. For example, creating a piecewise curve which satisfies second-order geometric continuity G2 involves matching the endpoints, its tangent vectors, and curvatures [15, 1720]. In this paper, we approximate GLAC to cubic T-Bézier curves with G2 conditions and derived a stable solution region so that GLAC can be approximated efficiently and directly implemented for the CAD environment.

The rest of the paper is arranged as follows. The next section introduces cubic T-Bézier curves. Section 3 elaborates the formulation to approximate GLAC with cubic T-Bézier curves. Section 4 elaborates on the curvature error measure, and it is followed by Section 5 detailing the solution region of the approximation before laying out the approximation algorithm. Finally, numerical examples are depicted before concluding remarks.

2. Preliminaries

For a given four control points in or , Han et al. presented a cubic trigonometric Bézier curve with two real-valued shape parameters as follows [11]:whereare the basis functions for the cubic T-Bézier curve whenever To note, when , essential properties of traditional Bézier curves are preserved, e.g., non-negativity, partition of unity, monotonicity, and symmetry as proven in [11].

The derivatives of at the endpoints are given as follows:

3. The Approximation Method

Let the GLAC be in a normalized form defined over . We can express a GLAC segment in normalized form by translating it to the origin, then rotate it such that its initial tangent point resides along the positive x-axis () and finally scale it to make the arc length . The rest of this paper employs -shift GLAC for cubic T-Bézier approximation. To note the derivation of -shift approximation [21] is straightforward and similar to the steps shown as follows.

Let be the curvature function of -shift GLAC as stated in equation (2), be the endpoint where (1) and , and be the winding angle at the endpoint such that . Then, the derivatives of GLAC at the endpoints are given as follows:where ' is the differentiation with respect to the parameter s.

To guarantee the second-order geometric continuity () between and at , it is required to establish parameterization equivalent to satisfying the following equation [2]:

The accompanying sets of equations are given as follows [2]:where and are real-valued shape factors. The second-order parametric continuity, , is obtained by letting and .

Consider the th derivative of w.r.t. evaluated at denoted by , then to approximate GLAC segment using cubic T-Bézier curve, we should satisfy the set of equations in equation (9) at the start and endpoints with the shape parameters and used at the start point and the shape parameters and used at the endpoint.

At the start point, we have the following set of equations:

After algebraic simplifications, we get the control points at the start point as follows:

Similarly, at the endpoint, we have the following set of equations:and

For the control points and , each has two expressions at the start and endpoints. Thus, we have four equations in x and y coordinate functions to be solved for and , leading to the following equations:

Definition 1. cubic T-Bézier approximation
A cubic trigonometric approximation curve of GLAC is defined by the following equation:where is the solution region shown in Section 6, with the definitions of basis functions, , as stated in equation (5), and as stated in equations (19) and (20). By employing equations (12), (13), (17), and (18), the control points, , are defined as follows:The free shape parameters for the approximated curve are , and which are inherited from GLAC. and are calculated by searching for suitable values and satisfying data. Once these shape parameters are given values by the designer, then we would be able to identify their corresponding control points as stated in Definition 1.

Definition 2. An alternative to cubic T-Bézier approximation
One can use the equations (14) and (16) instead of equations (13) and (17) to define the control points and while employing the basis functions, , as stated in equation (5), and as stated in equations (19) and (20). Then, the cubic trigonometric approximation of GLAC is defined as follows:whereSince both definitions provide the same results, it is recommended to use in Definition 1 instead of to avoid extra computations in calculating the values of and .

4. Curvature Error Measure

It is known that the curvature of GLAC is a smooth monotonic function which guarantees fairness. Thus, we used the curvature error measure as proposed by Cross and Cripps which was used to approximate GCS [2] as follows:where is the curvature function of the Bézier curve defined in the domain and is the curvature function of the GCS. The advantage of this measure is that it can accurately reflect the curvature profile and produce smooth approximation results. However, the disadvantage is that it is computationally costly due to the arc length reparameterization of the Bézier curve. Thus, to reduce the high computational cost, Albayari [22] proposed another curvature error measure as follows:where is the curvature function of the Bézier curve and is the curvature function of the GCS, and to calculate the error, one has to sample a sequence of equally spaced parameter values . Even though Lu’s curvature error measure takes less computation than Cross and Cripps’s curvature measure, we still must calculate Cross and Cripps’s error measure to exactly identify the quality of an approximation. Hence, one may end up calculating both and for an efficient approximation [23].

In 2016, Albayari et al. proposed a new error measure that can reduce the computations and determine the acceptability of the approximations accurately as follows [21]:where and , are the correspondence curvatures of the curve and the approximation curve at the same arc length, respectively. Although their measure reduces the computation, and it is very accurate to the exact error but the accuracy of the results depends on the numbers of the selected nodes. Since there is no rule to identify an ideal number of nodes which satisfy the exact error for all cases, and the maximum error may occur in between some of the two nodes. Thus, Lu introduced a new error measure as follows [21]:where is the curvature function of normalized to the domain and is the curvature function of the GLAC. By using this error measure, one may obtain a parameterized arc length curvature error measure by interpolating the arc length function of GLAC to avoid unnecessary computation. The default tolerance is set to be 0.05 which guarantees a high-quality approximation as proposed by Cross and Cripps [2].

Similarly, we used the error measure proposed by Lu [21] which is tailored to approximate GLAC as follows:where is the curvature function of normalized to the domain and is the curvature function of the GLAC which can be either -shift or -shift GLAC.

5. Solution Region

The first step in the approximation is to set an initial value to the shape parameters and . A plausible set of initial values for shape parameters are which satisfies continuity [2]. However, in some cases, these initial values provide unacceptable errors. Thus, it is essential to find a suitable solution region for the shape parameters and to meet the tolerance in a shorter period.

Indeed, there is a geometric effect of the two shape parameters and on the initial and end tangent vectors. From equations (12), (13), (17), and (18), it is evident that relates to the magnitude of and relates to the magnitude of . Since ,  > , the shape parameters and should be positive; otherwise, the tangents will point in the opposite direction. Hence, we set the lower bound of and as 0. Additionally, the values of the shape parameters should not be large otherwise the control points will be far away from each other. Since the total arc length of the curve is approximately 1, so using the trapezoid rule, we get the following equation [2]:

Hence, an appropriate upper bound for the shape parameters and is 4. It can be concluded that the entire solution region of the shape parameters and is .

Referring to equations (13) and (17), the value of becomes when . Similarly, the value of becomes at . These values may lead to undefined control points and ; hence, we should drop 0 from the solution region. Since the shape parameters and affect the values of and so we should consider the values in for which and are still in [−2, 1]. Hence, the restricted solution region becomes as follows:

6. The Basis Functions’ Properties of G2 GLAC T-Bézier Approximated Curves

The proposed basis functions for all GLAC approximated curves possess various properties. The following theorems elucidate these properties. Without loss of generality, the case when for -shift GLAC is discussed in Theorems 3 and 4. However, all other 3 different cases are discussed in detail in [21].

Theorem 3. The proposed basis functions of the GLAC cubic trigonometric approximated curve satisfy the partition of unity property.

Proof. After algebraic simplification of the basis functions, the approximated curve basis functions stated in equation (5) can be rewritten as follows:The first four terms of stated in equation (32) are the negation terms of the first four terms of stated in equation (33). Similarly, for the first four terms of stated in equation (34) with the first four terms of stated in equation (35), the summation of the basis functions is as follows:

Theorem 4. The proposed basis functions of the GLAC cubic trigonometric approximated curves satisfy the symmetric property.

Proof. The symmetric property for the basis functions holds if the following equations hold for .From equations (5), (19), and (20), for the -shift GLAC approximated curve can be written as follows:Similarly, the value of can be calculated as follows:It is evident from equations (38) and (39) that it is sufficient to show to prove that .
Based on the trigonometric identities in equations (40) and (41), we can complete the proof by equation (42).To prove the symmetric property for the remaining basis functions, it is required to show that , which recall from equations (5), (19), and (20) that the value of is as follows:where the value of can be calculated as follows:Multiplying the constant −1 by the first parenthesis of equation (43) makes it identically equal to equation (44). Therefore, the symmetric property holds.

Theorem 5. The proposed basis functions are non-negative functions.

Proof. The proposed basis functions are constructed by substituting the proposed formulas of the shape parameters and in Han’s basis functions [7] stated in equation (5) as follows:The search region, , of the shape parameters and for all GLAC approximated curves restricts and over a domain which encloses the corresponding shape parameters and in the interval . Therefore, taking into consideration that the general parameter, , varies over the interval , it becomes clear that , and , which follows that . Similarly, , , and , which follows that , , and .

Theorem 6. For a given parameter , the proposed basis functions preserve monotonicity property for the corresponding shape parameters and as follows.

(1) monotonically decreasing for the corresponding shape parameter .(2) monotonically increasing for the corresponding shape parameter .(3) monotonically increasing for the corresponding shape parameter .(4) monotonically decreasing for the corresponding shape parameter .

Proof. This can be proved by considering the sign of the first derivatives for the basis functions over the entire domain .
From equations in equation (45), the first derivatives of the basis functions with respect to the corresponding shape parameters can be calculated as follows:The derivatives’ functions and are negative over the entire domain , where the derivatives’ function and are positive over the entire domain which proves the monotonicity of the proposed basis functions, as mentioned in Theorem 6.
To proof that the approximation curve is invariant under translation, consider the translation , thenFor the approximation curve to be invariant, the Cauchy’s relation , must be satisfied [24], which is proved in Theorem 3.

7. Approximation Algorithm

This section illustrates the overall algorithm to approximate GLAC with cubic T-Bézier as shown in Algorithm 1. The numerical method used to search for suitable and in the algorithm is the interior point method utilizing the FindMinimum [] command found in Mathematica. Based on numerical results discussed in the next section, the values of and is always around (1, 1). This is because the length of normalized GLAC where the parameter s is equal to 1.

INPUT: GLAC Shape parameters ; by default tol is set as: ; the maximum number of iterations n.
OUTPUT: cubic T-Bézier curve approximating the predetermined GLAC with curvature error .
Begin
Step 1 Set ;
Step 2 Compute the solution region as stated in equation (31)
 Set the initial values as whenever , otherwise set any random values satisfy close to .
 While do step 3–7
Step 3 Compute the control points as stated in equation (22)
Step 4 Compute as stated in (19);
as stated in (20)
Step 5 Use equation (21) to compute the cubic trigonometric Bézier curve basis functions using the values of the shape parameters and gained in step 4.
Step 6 Calculate the curvature error measure as stated in equation (29)
Step 7 If then
 output ; (Procedure completed successfully.)
  stop.
 else
  Select random initial values for and satisfy the solution region and set them as new initial values in step 2, where we   highly recommended choosing values close to initial value, 1.
  Return to step 3 and search using the Interior Point method for values to and which minimize around the maximum error point in the previous iteration.
Step 8 Output (“Method failed after iterations split the GLAC or increase the tolerance 0.05,  = ”, ).
 Stop.

8. Numerical Examples

As stated in the previous section, we may generate LAC with the formulation of GLAC by letting [1]. Table 1 depicts various types of GLAC segments (including LAC) with different values of shape parameters to show the efficiency of the proposed method in approximating the GLAC family with cubic T-Béziers.

Numerous approximation examples of LACs () and GLACs are depicted in Table 1. The First 1–5 examples show the results of approximating various GLACs. The next 6–13 examples depict special cases of GLAC and LAC (). Most cases terminate after the first run which indicates the efficiency of the proposed algorithm. However, two cases (examples 14 and 15) have error of the approximation which is large on the first attempt of approximation, where the next iteration itself minimizes the error with .

Figures 13 are related to rows 3, 7, and 8 in Table 1, respectively. The GLAC and its cubic T-Bézier approximation is shown in 1(a) where the curvature error measure appears in 1(b), the graph of the dependent shape parameters and over the solution region are shown in 1(c) and 1(d), respectively.

For the case of example 14, which shown in Figure 4 below, the error was 0.078 obtained with the initial values of , where their corresponding shape parameters are . To reduce the number of iterations, we recommended searching around the parameter s where the maximum error occurs. In this example, the maximum error of 0.078 occurs at . By inputting this information during the search with the interior point method, we obtained the desired result on the next run itself where the error is 0.045 and the corresponding shape parameters are and , which led to the calculation of cubic T-Béziers’ shape parameters as and .

For example 15, the error was 0.063 with the initial values of , and its corresponding shape parameters were . The maximum error occurs 0.063 occurs at . Similar to example 14, we also obtained the desired result on the next run itself where the error is 0.025 and the corresponding shape parameters are and , which led to the calculation of cubic T-Béziers’ shape parameters as and .

9. Comparing the Proposed T-Bézier Method with the Standard Bézier Method

In this section, we are comparing the proposed T-Bézier method with the standard Bézier method in approximating several GLAC with various arc lengths.

Table 2 shows the results of approximating several normalized -shift GLAC while Table 3 depicts the results of approximating numerous examples of -shift GLAC with several arc lengths. Table 2 shows that the cubic Bézier approximation method does not reach satisfactory approximations without the need of searching for other values of the shape parameters . As a consequence, this method constantly replaces the control points of the cubic Bézier approximated curve with better positions to provide increased accuracy. However, the proposed cubic trigonometric Bézier approximation method completes most of the examples in Table 2 with the given initial values without any change in values. This, then, indicates that the proposed cubic trigonometric Bézier approximation method is more efficient than the cubic Bézier approximation method. Furthermore, although both of the cubic methods require 1 iteration to reach an acceptable approximation for GLAC , the proposed cubic trigonometric Bézier approximation method provides an error of 0.008955 which is more accurate when compared to the cubic Bézier approximation method’s error of 0.017444.

For aesthetic curves with various arc lengths, the cubic trigonometric Bézier approximation method needs iteration for more cases compared to the normalized curves. However, examples with iterations propose that the trigonometric method provides errors of 0.005753 and 0.015615 for the GLAC and GLAC , respectively. This is more accurate than the errors of the cubic Bézier method which are 0.019160 and 0.022365.

Table 4 displays the results of several normalized -shift GLAC approximated curves. Table 5 shows the results of approximating the various -shift GLAC with different arc lengths.

For the normalized -shift GLACs, the cubic Bézier approximation method [21] still requires more iterations to reach satisfactory approximations. It is evident that the cubic trigonometric basis functions of the cubic trigonometric Bézier approximation method contribute to an increase in accurate results compared to the Bernstein polynomial basis functions of the cubic Bézier approximation method. The last example of Table 4 is another example which shows that even though the cubic trigonometric method does not reach a satisfactory approximation with the initial values, it still produces a result that is more accurate than the standard cubic Bézier method.

For -shift GLAC with various arc lengths, the pattern remains the same. The cubic trigonometric method requires less iteration than the cubic Bézier method for most of the examples while it provides more accurate results.

In general, the cubic T-Bézier takes more time than the standard cubic Bézier as more time is needed for computations of the trigonometric basis functions as compared to the Bernstein polynomial basis functions.

Concerning accuracy, as the cubic trigonometric Bézier curve is closer to the control polygon compared to the standard cubic Bézier curve, the cubic trigonometric Bézier curve has an extra degree of freedom. This explains the advantage related to the accuracy of the proposed GLAC cubic trigonometric Bézier approximated curves over cubic Bézier approximated curves.

10. Conclusion and Future Work

A new set of formulas to approximate GLAC with cubic T-Bézier for the two shape parameters and is derived. These new formulas employ the basis functions of cubic T-Bézier as proposed by Han et al. [11] and the intermediate control points are expressed in the form of GLACs’ shape parameters. A solution region is established to ensure the efficiency of the approximation is at optimum. Based on the numerical results, the proposed algorithm may obtain an approximation of GLAC within 0.05 tolerances either on the first or second iteration. Future work includes approximating GLAC with generalized Trigonometric Bézier curves controlled at curvature extrema.

Data Availability

The numerical simulation data used to support the findings of this study are included within the article.

Disclosure

The manuscript was already published as an abstract [25].

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Authors’ Contributions

D.J.A., R.U.G., and K.T.M. conceptualized the study; D.J.A. and R.U.G. designed the methodology; R.U.G. validated the study; R.U.G. and K.T.M. were responsible for the resources; D.J.A. and R.U.G. wrote the original draft; R.U.G. and K.T.M. reviewed and edited the article; R.U.G. and K.T.M. visualized and supervised the study; R.U.G. was responsible for project administration; R.U.G. and K.T.M. were responsible for funding acquisition. All authors have read and agreed to the published version of the manuscript.

Acknowledgments

The authors acknowledge the Arab Evangelical Episcopal Church Council (Ahliyyah and Mutran), Ibn Rushd National Academy, and University Malaysia Terengganu (UMT) for providing facilities to complete this work. This work was partially supported by JST CREST Grant no. JPMJCR1911 and JSPS Grant-in-Aid for Scientific Research (B) Grant no. 19H02048. We acknowledge UMT for providing travel fund to share preliminary outcome of this work at the Geometric Computation and Applications Workshop held in June 2018, at Trinity College, Dublin, Ireland.