Abstract
A method of generating spherical non-uniform rational basis spline curves based on De Boor’s algorithm is presented in this article. The spherical curve preserves many good properties from non-uniform rational basis spline curves in Euclidean space, such as local modification property, convex hull property, rotation invariant property, knot insertion property, and so on. Construction of closed spherical non-uniform rational basis spline curve will be discussed too. Furthermore, a progressive iterative approximation scheme is proposed to approximate the given points on unit sphere using spherical non-uniform rational basis spline curves. The convergence and curve continuity will be discussed. Since the analytical expression of the spherical non-uniform rational basis spline curve is messy, numerical differentiation is used to test its continuity at interior knots. Finally, several examples are presented to verify the effectiveness of the proposed method. The proposed method is applied on tool path generation of five-axis machining to avoid interference by adjusting fewer directions and obtain smooth tool path simultaneously.
Keywords
Introduction
Generating smooth spherical curves on unit sphere can be applied in many situations, such as designing spherical curve, generating smooth rigid motion in computer animation, and tool path generation of multi-axis machining.1–4 Since B-spline has many good properties, it has already been widely used in curves and surface designs.5–9 Therefore, much effort has been made to extend B-spline curve in Euclidean space to the construction of spherical B-spline curves.
In 1979, Parker and Denham proposed a method to interpolate in the ambient space E m+ 1 and normalize to produce a curve in Sm . This method may cause extra geometrical distortion. 10 In 1985, in order to solve the problem of rigid motion interpolation in computer animation, Shoemake 1 proposed the spherical linear interpolation for two points by using spherical distance instead of Euclidean distance. Furthermore, the classical De Casteljau’s algorithm was generalized to 3-sphere S 3. The interpolation spherical curve has C 1 continuity at the curve joint. In 1994, Pobegailo 2 proposed a method for designing spherical curves by two weighted spatial rotations. The generated curve has C 1 continuity, local control, and invariance orthogonal transformations of coordinate system. In 1992, Nielson and colleagues11,12 proposed a spherical B-spline method to construct spherical curve. The inner points of the cubic segment are computed at 1/3 and 2/3 of the geodesic distance between the control points on sphere. In his article, Nielson 11 pointed out that this is the smoothest method he observed. But Kim et al.13,14 thought that the constructed spherical B-spline curve is not C 2 continuous, and furthermore, they proposed a general construction method for unit quaternion curves. The spline curve is reformulated in a cumulative basis form, and the corresponding quaternion curve is generated by converting each vector addition into the quaternion multiplication. This method is easy to evaluate high-order derivatives. But if the order of control points is reversed, the shape of spherical curve will change. 15 Therefore, it cannot be used to construct closed spherical curve. Also in 1995, Kim and Nam 16 presented a method interpolating a given sequence of solid orientation using circular blending quaternion curves. In 2001, Wang and Tang 17 tried to construct a spherical non-uniform rational basis spline (NURBS) curve, but it cannot guarantee that the generated curve lies on the unit sphere. In 1997, Park and Ravani 18 interpolated multiple points in SO(3) by regarding SO(3) as a Lie group equipped with a natural Riemannian metric. Russ and Fillmore 15 proposed a method for computing weighted averages on unit sphere based on the least square method. The existence and uniqueness properties of the weighted averages are proved. Two iterative algorithms are presented to generate smooth average quaternion. In 2005, Séquin et al. 19 proposed a class of circle spline that produced fair-looking G 2-continuous curves without any cusps, which can be used on sphere for spherical curve design. Based on Shoemake’s work, Popiel and Noakes 20 proposed a method to piece spherical Bézier curves together into C 2 splines. Since the velocity and acceleration are considered, this method has good characteristics of controlling their variation. It can also be used to interpolate sparse points on the unit sphere.
In this article, a simple and practical method will be proposed to generate smooth spherical NURBS curves based on De Boor’s algorithm. The structure of this article is organized as follows. In the ‘Definition of spherical NURBS curve based on De Boor’s algorithm’ section, the definition of spherical NURBS curves based on De Boor’s algorithm is proposed. In the ‘PIA of points on a sphere using spherical NURBS curve’ section, a progressive iterative approximation (PIA) scheme is proposed to approximate the given points on unit sphere. In the ‘Case study and discussion’ section, several examples are shown to discuss the continuity of spherical NURBS curve and verify the effectiveness of the proposed method. The ‘Conclusion’ section includes conclusion and discussion.
Definition of spherical NURBS curve based on De Boor’s algorithm
It is supposed that the point on the unit sphere
where
Given a set of control points
where
It should be noted that we still use linear interpolation to get weight

Two triangular tables of control points and weights: (a) control points and (b) weights.
In addition, suppose
According to the knot insertion algorithm of NURBS,
7
after inserting
According to the definition, we know that the constructed spherical curve has many good properties, such as local modification property and convex hull property. In addition, when the control points rotate around the centre of the unit sphere, the shape of spherical curve will not change, which can be proved as follows: apply rotation matrix
Equation (9) shows that the rotation of control points results in the same rotation of the point on the spherical NURBS curve. Therefore, the shape of curve will not change. It is called as rotation invariant property. Since the generation of spherical NURBS curves is based on knot insertion algorithm in Euclidean space, new control points can be added to increase the flexibility of shape control. But it should be noted that the shape of curve will be changed, which is different from NURBS curve in Euclidean space.
PIA of points on a sphere using spherical NURBS curve
According to equation (2), we know that the spherical NURBS curve is not a linear function with respect to control points for
The computing scheme is shown in Table 1, which can be described in detail as follows:
Input: degree
Output: spherical NURBS curve.
There are several methods to determine knot vector
where
Equation (11) just means that
By using parameter
Suppose
In order to find the error
We hope to adjust control points
Obviously,
Let the new spherical NURBS curve be looked as the initial spherical NURBS and repeat steps 2 and 3 until
Approximation of the points using spherical NURBS curve.

Approximation of the given points
As mentioned in step 2, we need to find the closest point
Suppose
According to extremum condition and equation (16), the closest point meets the following necessary condition
As shown in Figure 3, equation (17) means that

Extremum condition of distance between point and spherical curve on the unit sphere.
Case study and discussion
In this section, the proposed method is implemented using MATLAB language. Several cases are shown for different purposes.
Case 1
There are some methods to construct spherical curves as mentioned in the ‘Introduction’ section. Usually, we always hope that the spherical NURBS curve inherit all good properties of NURBS curve in Euclidean space. But it is very difficult, even impossible. Compared with NURBS curve in Euclidean space, we can find that the proposed spherical NURBS curve inherits some good properties. In this case, we will show several typical properties with several examples as follows:
Local modification property: moving
Similar to NURBS curve in Euclidean space,
6
closed spherical NURBS curve can be constructed as follows: design a uniform knot vector

Local modification property of the spherical NURBS curve.

Construction of closed spherical NURBS curves.
Case 2
In this case, the continuity of constructed spherical NURBS curve will be discussed. As mentioned in the ‘Definition of spherical NURBS curve based on De Boor’s algorithm’ section, equation (2) just describes a spherical linear interpolation process. For knot multiplicity
For example 1, control points and weights are shown in Table 2. For
Control points and weights for example 1.

Spherical NURBS curve for example 1.

First- to fourth-order approximate derivatives of spherical NURBS curve for example 1: (a) first-order approximate derivatives, (b) second-order approximate derivatives, (c) third-order approximate derivatives, and (d) fourth-order approximate derivatives (number of sampling points: 1000, blue curve: x component, green curve: y component, and red curve: z component).
For example 2, control points and weights are shown in Table 3. For
Control points and weights for example 2.

Spherical NURBS curve for example 2: (a)

Third-order approximate derivatives are not continuous at two interior knots for example 2 (blue curve: x component, green curve: y component, and red curve: z component).
It seems that this spherical NURBS curve has

Third-order approximate derivatives of spherical NURBS curve for example 1 at knot 0.623 (number of sampling points: 20,000; blue curve: x component, green curve: y component, and red curve: z component).
As shown in Figure 11,

Definition of relative error of the continuity at interior knots.
Case 3
In this case, the approximation of points on sphere using spherical NURBS curve and its convergence will be discussed. Two examples are shown in Figures 12 and 13. Viviani’s curve is a sphere–cylinder intersection. In this example, nine points are sampled from Viviani’s curve on the unit sphere, which is written as

Approximation of nine sampled points from Viviani’s curve: (a) initial spherical NURBS curve defined using sampled point from Viviani’s curve and (b)

Approximation of 30 sampled points from a sphere spiral: (a) the initial spherical NURBS curve and (b)
Let sampling points be the initial control points; for
For
However, it is still needed to note that the two cases have different convergence rates. Since the approximation process is iterative, it is necessary to discuss its convergence further. As shown in Figure 14, 30 sampled points from sphere spiral are approximated with different degree

Analysis of convergence for approximating sampling points from sphere spiral: (a)

Approximation of the points in Table 2 using different ps: (a)
Case 4
Smoothness of tool path is very important for dynamic performance of the machine tool. 25 To overcome the common weakness of dramatic change of tool orientations, a new method has been developed for smooth tool motions by searching the alternative tool orientation in the C-space with the smallest change of tool orientations. 26 But this method cannot smooth the tool path globally. Langeron et al. 27 proposed a new format of tool path polynomial interpolation in five-axis machining using two B-spline curves, which can be used to avoid five-axis singularities 28 and keep the tool path smooth at the same time. The difference between this method and our method is that the tool axis orientation is described as a spherical NURBS curve in this article, which makes it easy to see the variation of tool axis orientation on a sphere. In this case, the proposed method is used to generate smooth tool path without interference in five-axis machining. As shown in Figure 16(a), six typical tool positions and tool axis directions are defined. In computer-aided manufacturing (CAM) system, they are usually defined using man–machine interaction and free of interference. Furthermore, we need to interpolate the six tool axes and get the whole tool path. Since the six directions can be described as six points on a unit sphere, the proposed method is used to approximate these points and get the directions of the whole tool path. The trajectory of the tip of the tool can be interpolated using NURBS curve in Euclidean space. It is obvious that interference happens between the directions of the tool axes and the obstacle. To avoid interference, tool axis A is chosen and adjusted parallel to the observing direction. A new smooth tool path is obtained, as shown in Figure 16(b). Obviously, the interference is eliminated. In addition, the adjustment of tool axis A only affects the initial tool path locally. Thus, this method can be used to modify five-axis tool path locally.

Avoiding interference by adjusting fewer directions and obtaining smooth tool path interference in five-axis machining: (a) tool path with interference and (b) tool path without interference.
Conclusion
A novel and simple method of generating spherical NURBS curve and its application have been studied in this article. The definition of spherical NURBS curves is based on De Boor’s algorithm. We can get the following conclusions:
The generated spherical NURBS curve preserves some good properties from NURBS curve in Euclidean space, such as local modification property, convex hull property, rotation invariant property, and knot insertion property. But we need to know that knot insertion will change the shape of the curve. It is easy to construct closed spherical NURBS curve using the proposed method. This method will be very useful to design spherical curve interactively.
For the sequence of the given points on the unit sphere, a PIA scheme has been proposed to approximate them using smooth spherical NURBS curves. Results show that the position relationship of points will affect the convergence. A practical but not strict convergence condition for approximation is presented.
Since the analytical expression of spherical NURBS curves is messy, numerical differentiation is used to analyse its continuity at interior knots. Results show that spherical NURBS curves may have
The proposed method is applied on tool path generation of five-axis machining to avoid interference by adjusting fewer directions and obtain smooth tool path simultaneously.
Footnotes
Appendix 1
Declaration of conflicting interests
The authors declare that there is no conflict of interest.
Funding
This study was supported by the International Cooperation and Exchange of the National Natural Science Foundation of China (grant no. 51320105009) and the National Natural Science Foundation of China (grant no. 51275344). This study was also supported by the 111 project (B07014).
