Skip to main content

Theory and Modern Applications

The quartic Catmull–Rom spline with local adjustability and its shape optimization

Abstract

Parametric interpolatory curves play a vital part in geometric modeling. Cubic Catmull–Rom spline is a well-known tool for constructing parametric interpolatory curves, but it cannot be modified once its control points are fixed. We propose a novel quartic Catmull–Rom spline with free parameters to tackle this issue. The quartic Catmull–Rom spline owns shape adjustability based on inheriting the features of the cubic Catmull–Rom spline. Some modeling examples show that the shape of the quartic Catmull–Rom spline can realize both global adjustment and local adjustment by changing the free parameters. In addition, we give three schemes for optimizing the shape of the quartic Catmull–Rom spline, which can generate the spline with minimal internal energy, the shape-preserving spline, and the monotonicity-preserving spline. Numerical examples indicate that the proposed schemes are effective and the quartic Catmull–Rom spline is more practical than the cubic Catmull–Rom spline in data interpolation.

1 Introduction

Parametric curves defined by control points have always been an important research topic in computer-aided geometric design and computer graphics, in which approximation and interpolation are the two most commonly used tools. This paper focuses on parametric interpolatory curves, that is, parametric curves that interpolate their control points.

There are a large number of parametric interpolatory curve constructions that have been developed. We cannot provide an exhaustive survey, but many of these methods can be referred to [1]. Among these methods, the cubic Catmull–Rom spline [25] is a well-known parametric interpolatory curve representation. But the shape of the cubic Catmull–Rom spline cannot be adjusted when the control points are fixed, which limits its applications to a certain extent. For practical shape modeling, we often need to change the local shape of the spline. The first purpose of this paper is to propose a novel quartic Catmull–Rom spline with free parameters that can achieve local and global adjustment by keeping the control points unchanged.

After the new quartic Catmull–Rom spline is constructed, a further problem arises: how to determine the optimal values of the free parameters to make the modified quartic Catmull–Rom spline meet some specific requirements? Indeed, shape optimization of parametric curves has attracted more and more attention in recent years, and various objective functions have been proposed to optimize the shape of parametric curves. The internal energy of curves is a widely used objective function, which usually includes stretch energy, strain energy (also called bending energy), and curvature variation energy (often replaced by Jerk’s energy), see [613]. The external energy of curves is another common objective functional for optimizing the shape of curves, see [1416]. Because the control polygon can be regarded as the simplest shape-preserving interpolation, the quadratic oscillation in average minimization has been adopted to optimize the shape of interpolation curves, see [17, 18]. The derivative oscillation minimization has been used to optimize the shape of some interpolation curves because approximating the derivative of the control polygon can be regarded as the simplest way to construct monotonicity-preserving interpolation, see [19]. Inspired by these shape optimization methods, this paper’s second purpose is to optimize the shape of the quartic Catmull–Rom spline by minimizing the internal energy, the quadratic oscillation in average, and the derivative oscillation.

The main contributions of this paper are as follows:

(a) We present a novel quartic Catmull–Rom spline with free parameters. The spline not only inherits the features of the cubic Catmull–Rom spline but also has local adjustability when the control points remain fixed.

(b) We adopt the internal energy minimization, the quadratic oscillation in average minimization, and the derivative oscillation minimization to determine the optimal values of the free parameters contained in the quartic Catmull–Rom spline. The three minimization methods can construct the quartic Catmull–Rom spline with minimal internal energy, the shape-preserving quartic Catmull–Rom spline, and the monotonicity-preserving quartic Catmull–Rom spline, respectively.

The rest of this paper is organized as follows. In Sect. 2, we briefly review the cubic Catmull–Rom spline. In Sect. 3, we present the definition and characteristics of the quartic Catmull–Rom spline. In Sect. 4, we provide three methods for optimizing the shape of the quartic Catmull–Rom spline. Finally, we give a brief conclusion in Sect. 5.

2 Review of the cubic Catmull–Rom spline

Cubic Catmull–Rom spline is one of the common parametric curves defined by control points. Generally, the cubic Catmull–Rom spline is given by [25]

$$\begin{aligned} \boldsymbol{c}_{ i}(t) = \sum_{j = 0}^{3} b_{j}(t)\boldsymbol{p} {}_{i + j},\quad i = 0,1, \ldots,n - 3, \end{aligned}$$
(1)

where \(0 \le t \le 1\), \(\boldsymbol{p}_{i}\) (\(i = 0,1, \ldots,n;n \ge 3\)) are control points, \(b_{j}(t)\) (\(j = 0,1,2,3\)) is the basis which can be expressed by

$$\begin{aligned} \textstyle\begin{cases} b_{0}(t) = \frac{1}{2} ( - t + 2t^{2} - t^{3} ), \\ b_{1}(t) = \frac{1}{2} ( 2 - 5t^{2} + 3t^{3} ), \\ b_{2}(t) = \frac{1}{2} ( t + 4t^{2} - 3t^{3} ), \\ b_{3}(t) = \frac{1}{2} ( - t^{2} + t^{3} ). \end{cases}\displaystyle \end{aligned}$$
(2)

The basis expressed in (2) has the following properties:

(a) Partition of unity, that is,

$$\begin{aligned} b_{0}(t) + b_{1}(t) + b_{2}(t) + b_{3}(t) \equiv 1. \end{aligned}$$

(b) Symmetry, that is,

$$\begin{aligned} b_{i}(1 - t) = b_{3 - i}(t),\quad i = 0,1,2,3. \end{aligned}$$

(c) Properties at endpoints, that is,

$$\begin{aligned} \textstyle\begin{cases} b_{0}(0) = b_{2}(0) = b_{3}(0) = 0, \qquad b_{1}(0) = 1, \\ b_{0}(1) = b_{1}(1) = b_{3}(1) = 0, \qquad b_{2}(1) = 1, \\ b'_{0}(0) = - 1 / 2, \qquad b'_{1}(0) = b'_{3}(0) = 0, \qquad b'_{2}(0) = 1 / 2, \\ b'_{0}(1) = b'_{2}(1) = 0,\qquad b'_{1}(1) = - 1 / 2, \qquad b'_{3}(1) = 1 / 2. \end{cases}\displaystyle \end{aligned}$$

By computing from Eq. (1) we have

$$\begin{aligned} &\boldsymbol{c}_{ i}(0) = \boldsymbol{p}_{i + 1},\qquad \boldsymbol{c}_{ i}(1) = \boldsymbol{p}_{i + 2}. \end{aligned}$$
(3)
$$\begin{aligned} &\boldsymbol{c'}_{ i}(0) = \frac{1}{2} ( \boldsymbol{p}_{i + 2} - \boldsymbol{p}_{i} ),\qquad \boldsymbol{c'}_{ i}(1) = \frac{1}{2} ( \boldsymbol{p}_{i + 3} - \boldsymbol{p}_{i + 1} ). \end{aligned}$$
(4)

Equation (3) shows that cubic Catmull–Rom spline interpolates its control points except for \(\boldsymbol{p}_{0}\) and \(\boldsymbol{p}_{n}\). From Eqs. (3) and (4) we have \(\boldsymbol{c}_{i + 1}^{(k)}(0) = \boldsymbol{c}_{i}^{(k)}(1)\), \(k = 0,1\), which show that the cubic Catmull–Rom spline satisfies \(C^{1}\) continuity. The interpolation and \(C^{1}\) continuity are the salient features of cubic Catmull–Rom splines.

Due to the interpolation and \(C^{1}\) continuity, the cubic Catmull–Rom spline has been successfully used in geometric design [20, 21] and engineering applications [22, 23]. However, the cubic Catmull–Rom spline would be uniquely determined when all the control points are fixed. In this case, the spline has no degrees of freedom, which limits its applications in engineering. To alleviate the shortcoming of the cubic Catmull–Rom spline in shape adjustment, we need to construct a Catmull–Rom spline that can adjust its shape freely.

3 The quartic Catmull–Rom spline

To construct a Catmull–Rom spline with shape adjustment ability, we raise the spline’s degree to be quartic and introduce free parameters into the spline. In this section, we first construct the basis of the quartic Catmull–Rom spline and then define the quartic Catmull–Rom spline by the proposed basis.

3.1 The basis

The specific construction processes of the basis can be found in the Appendix, we directly give its definition as follows.

Definition 1

The basis \(f_{i}(\alpha;t)\) (\(i = 0,1,2,3\)) of the quartic Catmull–Rom spline is defined by

$$\begin{aligned} \textstyle\begin{cases} f_{0}(\alpha;t) = \frac{1}{2} ( - t + 2(1 + \alpha )t^{2} - (1 + 4\alpha )t^{3} + 2\alpha t^{4} ), \\ f_{1}(\alpha;t) = \frac{1}{2} ( 2 - (5 + 2\alpha )t^{2} + (3 + 4\alpha )t^{3} - 2\alpha t^{4} ), \\ f_{2}(\alpha;t) = \frac{1}{2} ( t + 2(2 - \alpha )t^{2} - (3 - 4\alpha )t^{3} - 2\alpha t^{4} ), \\ f_{3}(\alpha;t) = \frac{1}{2} ( - (1 - 2\alpha )t^{2} + (1 - 4\alpha )t^{3} + 2\alpha t^{4} ), \end{cases}\displaystyle \end{aligned}$$
(5)

where \(0 \le t \le 1\), α is an arbitrary real number.

Theorem 1

The basis expressed in Eq. (5) has the following properties:

(a) Partition of unity.

For any α, there is \(f_{0}(\alpha;t) + f_{1}(\alpha;t) + f_{2}(\alpha;t) + f_{3}(\alpha;t) \equiv 1\).

(b) Symmetry.

For any α, there is \(f_{i}(\alpha;1 - t) = f_{3 - i}(\alpha;t)\), \(i = 0,1,2,3\).

(c) Properties at endpoints.

For any α, there are

$$\begin{aligned} \textstyle\begin{cases} f_{0}(\alpha;0) = f_{2}(\alpha;0) = f_{3}(\alpha;0) = 0, \qquad f_{1}(\alpha;0) = 1, \\ f_{0}(\alpha;1) = f_{1}(\alpha;1) = f_{3}(\alpha;1) = 0, \qquad f_{2}(\alpha;1) = 1, \\ f'_{0}(\alpha;0) = - 1 / 2, \qquad f'_{1}(\alpha;0) = f'_{3}(\alpha;0) = 0, \qquad f'_{2}(\alpha;0) = 1 / 2, \\ f'_{0}(\alpha;1) = f'_{2}(\alpha;1) = 0, \qquad f'_{1}(\alpha;1) = - 1 / 2, \qquad f'_{3}(\alpha;1) = 1 / 2. \end{cases}\displaystyle \end{aligned}$$

(d) Monotonicity.

For any \(t \in [0,1]\), \(f_{0}(\alpha;t)\) and \(f_{3}(\alpha;t)\) are monotonically increasing about α, while \(f_{1}(\alpha;t)\) and \(f_{2}(\alpha;t)\) are monotonically decreasing about α.

Proof

By simple calculations, (a), (b), and (c) are not hard to be deduced. We only verify (d). For any t, from Eq. (16) we have

$$\begin{aligned} &\frac{\mathrm{d}f_{0}(\alpha;t)}{\mathrm{d}\alpha} = \frac{\mathrm{d}f_{3}(\alpha;t)}{\mathrm{d}\alpha} = t^{2}(1 - t)^{2} \ge 0,\\ &\frac{\mathrm{d}f_{1}(\alpha;t)}{\mathrm{d}\alpha} = \frac{\mathrm{d}f_{2}(\alpha;t)}{\mathrm{d}\alpha} = - t^{2}(1 - t)^{2} \le 0. \end{aligned}$$

Thus, the monotonicity has been proved. □

Theorem 1 shows that the proposed basis inherits the features of the basis of the cubic Catmull–Rom spline. It is not difficult to verify that Eq. (5) becomes Eq. (2) when \(\alpha = 0\), that means the basis of cubic Catmull–Rom is a special case of the proposed basis. From the monotonicity, the shape of the proposed basis is dependent on the free parameter α. Figure 1 shows graphs of the basis with multiple values of α.

Figure 1
figure 1

Graphs of the basis with multiple values of α

3.2 The spline

Definition 2

The quartic Catmull–Rom spline \(\boldsymbol{R}_{ i}(\alpha _{i};t)\) (\(i = 0,1, \ldots,n - 3\)) is defined by

$$\begin{aligned} \boldsymbol{R}_{ i}(\alpha _{i};t) = \sum _{j = 0}^{3} f_{j}(\alpha _{i};t) \boldsymbol{q} {}_{i + j},\quad i = 0,1, \ldots,n - 3, \end{aligned}$$
(6)

where \(0 \le t \le 1\), \(\boldsymbol{q}_{i}\) (\(i = 0,1, \ldots,n;n \ge 3\)) are control points, \(f_{j}(\alpha _{i};t)\) (\(j = 0,1,2,3\)) is the basis expressed according to Eq. (5).

We can see from Eq. (6) that each quartic Catmull–Rom spline segment \(\boldsymbol{R}_{ i}(\alpha _{i};t)\) has a free parameter \(\alpha _{i}\). When \(\alpha _{i} = 0\) (\(i = 0,1, \ldots,n - 3\)), the quartic Catmull–Rom spline becomes a cubic Catmull–Rom spline, that means the cubic Catmull–Rom spline is a special case of the quartic Catmull–Rom spline.

Theorem 2

The quartic Catmull–Rom spline expressed in Eq. (6) has salient features as follows:

(a) Interpolation.

For any \(\alpha _{i}\), the spline interpolates its control points except for \(\boldsymbol{q}_{0}\) and \(\boldsymbol{q}_{n}\).

(b) Continuity.

For any \(\alpha _{i}\), the spline reaches \(C^{1}\) continuity.

(c) Shape flexibility.

The shape of the spline can be freely adjusted while all the control points are kept unchanged.

Proof

For any \(\alpha _{i}\), by the endpoints properties of the quartic basis, we have

$$\begin{aligned} &\boldsymbol{R}_{ i}(\alpha _{i};0) = \boldsymbol{q}_{i + 1},\qquad \qquad \boldsymbol{R}_{ i}(\alpha _{i};1) = \boldsymbol{q}_{i + 2}. \end{aligned}$$
(7)
$$\begin{aligned} &\frac{\mathrm{d}\boldsymbol{R}_{i}(\alpha _{i};0)}{\mathrm{d}t} = \frac{1}{2} ( \boldsymbol{q}_{i + 2} - \boldsymbol{q}_{i} ),\qquad \frac{\mathrm{d}\boldsymbol{R}_{i}(\alpha _{i};1)}{\mathrm{d}t} = \frac{1}{2} ( \boldsymbol{q}_{i + 3} - \boldsymbol{q}_{i + 1} ). \end{aligned}$$
(8)

Equation (7) shows that the spline interpolates its control points except for \(\boldsymbol{q}_{0}\) and \(\boldsymbol{q}_{n}\). From Eqs. (7) and (8) we have \(\frac{\mathrm{d}^{k}\boldsymbol{R}_{i + 1}(\alpha _{i + 1};0)}{\mathrm{d}t^{k}} = \frac{\mathrm{d}^{k}\boldsymbol{R}_{i}(\alpha _{i};1)}{\mathrm{d}t^{k}}\), \(k = 0,1\), which shows that the spline reaches \(C^{1}\) continuity.

Since the expression of the spline contains free parameters \(\alpha _{i}\), we can easily adjust the shape of the spline by altering the values of \(\alpha _{i}\) when all the control points are fixed. □

Theorem 2 indicates that the quartic Catmull–Rom spline owns shape adjustability based on inheriting the features of the cubic Catmull–Rom spline. We can change the free parameter of each spline segment to achieve local adjustment, while we can modify all the free parameters to be the same to realize global adjustment of the spline. Figure 2 shows the shape adjustability of the quartic Catmull–Rom spline.

Figure 2
figure 2

The quartic Catmull–Rom spline with different free parameters, where the solid lines represent the spline and the solid points represent the control points

We can see from Fig. 2 that the quartic Catmull–Rom spline can easily achieve local adjustment or global adjustment by modifying the free parameters, which is impossible for a cubic Catmull–Rom spline.

4 Shape optimization of the spline

Although the quartic Catmull–Rom spline has shape adjustability because of the free parameters, it should be noted that the shape of the spline can be unsatisfactory if the free parameters are not appropriately selected; see Fig. 3.

Figure 3
figure 3

The quartic Catmull–Rom spline with inappropriate free parameters, where the solid lines represent the spline and the solid points represent the control points. In each example, the control points are the same as in Fig. 2

In addition, sometimes people may need to determine the free parameters to make the shape of the quartic Catmull–Rom spline meet some specific requirements. Hence, we need to give schemes for optimizing the free parameters according to some objectives. Since the internal energy, the quadratic oscillation in average, and the derivative oscillation have been successfully used to optimize the shape of some parametric curves, we adopt them to optimize the shape of the quartic Catmull–Rom spline and present the schemes in this section.

4.1 The spline with minimal internal energy

Three types of commonly used internal energy of a curve are stretch energy, strain energy (also called bending energy), and curvature variation energy (often replaced by Jerk’s energy). For a parametric curve \(\boldsymbol{b}(t)\), its stretch energy, strain energy, and Jerk’s energy are usually approximately described by \(\int _{0}^{1} \Vert \boldsymbol{b'}(t) \Vert ^{2} \,\mathrm{d}t\), \(\int _{0}^{1} \Vert \boldsymbol{b''}(t) \Vert ^{2} \,\mathrm{d}t\), and \(\int _{0}^{1} \Vert \boldsymbol{b'''}(t) \Vert ^{2} \,\mathrm{d}t\), respectively; see [6, 7]. Because the free parameter of each quartic Catmull–Rom spline segment is local, we only need to consider the internal energy of each spline segment but not that of the whole spline. We can approximately express the three internal energies of each quartic Catmull–Rom spline segment as

$$\begin{aligned} E_{i,k}: = \int _{0}^{1} \biggl\Vert \frac{\mathrm{d}^{k}\boldsymbol{R}_{i}(\alpha _{i};t)}{\mathrm{d}t^{k}} \biggr\Vert ^{2} \,\mathrm{d}t \end{aligned}$$
(9)

for any \(\alpha _{i}\), where \(k = 1,2,3\).

From Eqs. (5) and (6) we have

$$\begin{aligned} \boldsymbol{R}_{i}(\alpha;t) = \boldsymbol{r}_{i}(t)\alpha _{i} + \boldsymbol{s}_{i}(t), \end{aligned}$$
(10)

where

$$\begin{aligned} &\boldsymbol{r}_{i}(t): = \frac{1}{2} \bigl( - t(1 - t)^{2}\boldsymbol{q}_{i} + (1 - t) \bigl(2 + 2t - 3t^{2}\bigr)\boldsymbol{q}_{i + 1} + t\bigl(1 + 4t - 3t^{2}\bigr)\boldsymbol{q}_{i + 2} - (1 - t)t^{2} \boldsymbol{q}_{i + 3} \bigr),\\ &\boldsymbol{s}_{i}(t): = t^{2}(1 - t)^{2}( \boldsymbol{q}_{i} - \boldsymbol{q}_{i + 1} - \boldsymbol{q}_{i + 2} + \boldsymbol{q}_{i + 3}). \end{aligned}$$

By substituting Eq. (10) into Eq. (9), we have

$$\begin{aligned} E_{i,k} &= \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}^{(k)}(t) \alpha _{i} + \boldsymbol{s}_{i}^{(k)}(t) \bigr\Vert ^{2} \,\mathrm{d}t \\ &= \alpha _{i}^{2} \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}^{(k)}(t) \bigr\Vert ^{2} \,\mathrm{d}t + 2\alpha _{i} \int _{0}^{1} \bigl( \boldsymbol{r}_{i}^{(k)}(t) \cdot \boldsymbol{s}_{i}^{(k)}(t) \bigr) \,\mathrm{d}t + \int _{0}^{1} \bigl\Vert \boldsymbol{s}_{i}^{(k)}(t) \bigr\Vert ^{2} \,\mathrm{d}t. \end{aligned}$$
(11)

It is clear that only \(\alpha _{i}\) is a variable to be determined in Eq. (11). Hence, we can get the following model for constructing the quartic Catmull–Rom spline segment with minimal internal energy:

$$\begin{aligned} \min_{\alpha _{i} \in R} \quad E_{i,k}(\alpha _{i}) , \end{aligned}$$
(12)

where \(k = 1,2,3\). Then we can get the following theorem.

Theorem 3

To construct the quartic Catmull–Rom spline segment with minimal internal energy, the free parameter of each spline segment should be taken as

$$\begin{aligned} \alpha _{i} = - \frac{\int _{0}^{1} ( \boldsymbol{r}_{i}^{(k)}(t) \cdot \boldsymbol{s}_{i}^{(k)}(t) ) \,\mathrm{d}t}{\int _{0}^{1} \Vert \boldsymbol{r}_{i}^{(k)}(t) \Vert ^{2} \,\mathrm{d}t}. \end{aligned}$$
(13)

Proof

From Eq. (11) we have

$$\begin{aligned} \frac{\mathrm{d}E_{i,k}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 2\alpha _{i} \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}^{(k)}(t) \bigr\Vert ^{2} \,\mathrm{d}t + 2 \int _{0}^{1} \bigl( \boldsymbol{r}_{i}^{(k)}(t) \cdot \boldsymbol{s}_{i}^{(k)}(t) \bigr) \,\mathrm{d}t. \end{aligned}$$
(14)

To obtain the quartic Catmull–Rom spline segment with minimal internal energy, there should be \(\frac{\mathrm{d}E_{i,k}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 0\). Since the control points are different, \(\int _{0}^{1} \Vert \boldsymbol{r}_{i}^{(k)}(t) \Vert ^{2} \,\mathrm{d}t \ne 0\) always holds. Then we can get Eq. (13) from Eq. (14). Since the solution of \(\frac{\mathrm{d}E_{i,k}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 0\) is unique, Eq. (13) must be the global minimum of Eq. (12). □

After determining the free parameter of each spline segment by Eq. (13), we can generate the whole quartic Catmull–Rom spline with minimal internal energy. However, we find that \(\int _{0}^{1} ( \boldsymbol{r}_{i}^{(k)}(t) \cdot \boldsymbol{s}_{i}^{(k)}(t) ) \,\mathrm{d}t \equiv 0\) (\(k = 2,3\)), then the free parameter calculated by Eq. (13) is \(\alpha _{i} = 0\). This means the quartic Catmull–Rom spline with minimal strain energy or Jerk’s energy is exactly the cubic Catmull–Rom spline. Figure 4 shows curves generated by the quartic Catmull–Rom splines with minimal internal energy.

Figure 4
figure 4

The quartic Catmull–Rom spline with minimal internal energy, where the solid lines represent the spline and the solid points represent the control points. In each example, the control points are the same as in Fig. 2

4.2 The shape-preserving spline

Let \(\boldsymbol{L}(t): = \boldsymbol{L}_{i}(t) = (1 - t)\boldsymbol{d}_{i} + t\boldsymbol{d}_{i + 1}\), where \(\boldsymbol{d}_{i}\) (\(i = 0,1, \ldots,n\)) are data points in the plane, then \(\boldsymbol{L}(t)\) can be regarded as the simplest shape-preserving interpolation. Based on this, quadratic oscillation in average minimization has been used to construct shape-preserving interpolation; see [17, 18]. Here, we adopt the quadratic oscillation in average minimization to construct the shape-preserving quartic Catmull–Rom spline.

Recall that the quartic Catmull–Rom spline segment \(\boldsymbol{R}_{i}(\alpha _{i};t)\) interpolates at \(\boldsymbol{q}_{i + 1}\) and \(\boldsymbol{q}_{i + 2}\), and the value of the free parameter \(\alpha _{i}\) has an influence on the approximation of \(\boldsymbol{R}_{i}(\alpha _{i};t)\) to \(\boldsymbol{Q}_{i}(t)\), where \(\boldsymbol{Q}_{i}(t): = (1 - t)\boldsymbol{q}_{i + 1} + t\boldsymbol{q}_{i + 2}\); see Fig. 5.

Figure 5
figure 5

A segment of quartic Catmull–Rom spline with different shape parameters, where the solid lines represent the spline with different shape parameters, the dotted lines represent the control polygon, and the solid points represent the control points

Thereby, we can get the following model:

$$\begin{aligned} \min_{\alpha _{i} \in R} \quad I_{i}(\alpha _{i}) = \int _{0}^{1} \bigl\Vert \boldsymbol{R}_{i}( \alpha _{i};t) - \boldsymbol{Q}_{i}(t) \bigr\Vert ^{2}\,\mathrm{d}t, \end{aligned}$$
(15)

where \(\boldsymbol{Q}_{i}(t): = (1 - t)\boldsymbol{q}_{i + 1} + t\boldsymbol{q}_{i + 2}\), \(i = 0,1, \ldots,n - 3\). Then we can obtain the theorem as follows.

Theorem 4

To construct the shape-preserving quartic Catmull–Rom spline, the free parameter of each spline segment should be taken as

$$\begin{aligned} \alpha _{i} = - \frac{\int _{0}^{1} ( \boldsymbol{r}_{i}(t) \cdot ( \boldsymbol{s}_{i}(t) - \boldsymbol{Q}_{i}(t) ) ) \,\mathrm{d}t}{\int _{0}^{1} \Vert \boldsymbol{r}_{i}(t) \Vert ^{2} \,\mathrm{d}t}. \end{aligned}$$
(16)

Proof

By Eq. (10) we have

$$\begin{aligned} I_{i}(\alpha _{i}) ={}& \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}(t) \alpha _{i} + \boldsymbol{s}_{i}(t) - \boldsymbol{Q}_{i}(t) \bigr\Vert ^{2}\,\mathrm{d}t \\ ={}& \alpha _{i}^{2} \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}(t) \bigr\Vert ^{2} \,\mathrm{d}t + 2\alpha _{i} \int _{0}^{1} \bigl( \boldsymbol{r}_{i}(t) \cdot \bigl( \boldsymbol{s}_{i}(t) - \boldsymbol{Q}_{i}(t) \bigr) \bigr) \,\mathrm{d}t \\ &{}+ \int _{0}^{1} \bigl\Vert \boldsymbol{s}_{i}(t) - \boldsymbol{Q}_{i}(t) \bigr\Vert ^{2} \,\mathrm{d}t. \end{aligned}$$
(17)

From Eq. (17) we have

$$\begin{aligned} \frac{\mathrm{d}I_{i}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 2\alpha _{i} \int _{0}^{1} \bigl\Vert \boldsymbol{r}_{i}(t) \bigr\Vert ^{2} \,\mathrm{d}t + 2 \int _{0}^{1} \bigl( \boldsymbol{r}_{i}(t) \cdot \bigl( \boldsymbol{s}_{i}(t) - \boldsymbol{Q}_{i}(t) \bigr) \bigr) \,\mathrm{d}t. \end{aligned}$$
(18)

To make the quartic Catmull–Rom spline shape-preserving, there should be \(\frac{\mathrm{d}I_{i}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 0\), \(i = 0,1, \ldots,n - 3\). Since the control points are different, \(\int _{0}^{1} \Vert \boldsymbol{r}_{i}(t) \Vert ^{2} \,\mathrm{d}t \ne 0\) always holds. Then we can get Eq. (16) from Eq. (18). Since the solution of \(\frac{\mathrm{d}I_{i}(\alpha _{i})}{\mathrm{d}\alpha _{i}} = 0\) is unique, Eq. (16) must be the global minimum of Eq. (15). □

After determining the free parameter of each spline segment by Eq. (16), we can generate the whole shape-preserving quartic Catmull–Rom spline. Figure 6 shows the cubic Catmull–Rom spline and the shape-preserving quartic Catmull–Rom spline interpolating the following data:

$$\begin{aligned} &(\mathrm{a})\quad x = 0.5, 0.5, 3.5, 6.0, 8.5, 11, 14, 17, 20, 20,\\ &\hphantom{(\mathrm{a})\quad} y = 93, 93, 104, 120, 98, 86, 102, 81, 90, 90, \\ &(\mathrm{b})\quad x = 0, 0, 0.5, 1.5, 3, 4, 7, 8, 8,\qquad y = x\sin x. \end{aligned}$$
Figure 6
figure 6

The shape-preserving quartic Catmull–Rom spline and the cubic Catmull–Rom spline. In each example, the dotted lines represent the control polygon, the dashed lines represent the cubic Catmull–Rom spline, the solid lines represent the shape-preserving quartic Catmull–Rom spline, and the solid points represent the data points

We can see from Fig. 6 that the shape-preserving quartic Catmull–Rom spline is closer to the control polygon than the cubic Catmull–Rom spline.

4.3 The monotonicity-preserving spline

Given a set of monotonic data points \(\boldsymbol{d}_{i}\) (\(i = 0,1, \ldots,n\)) in the plane, it can be seen that \(\boldsymbol{L'}_{i}(t) = \boldsymbol{d}_{i + 2} - \boldsymbol{d}_{i + 1}\) (\(i = 0,1, \ldots,n - 3\)) reflect the monotonicity of data points. Hence, the derivative oscillation minimization has been considered an effective way to construct monotonicity-preserving interpolation; see [19]. Here, we use the derivative oscillation minimization to construct the monotonicity-preserving quartic Catmull–Rom spline. Then we can get the following model:

$$\begin{aligned} \min_{\alpha _{i} \in R} \quad J_{i}(\alpha _{i}) = \int _{0}^{1} \bigl\Vert \boldsymbol{R'}_{i}( \alpha _{i};t) - \boldsymbol{Q'}_{i}(t) \bigr\Vert ^{2}\,\mathrm{d}t, \end{aligned}$$
(19)

where \(\boldsymbol{Q'}_{i}(t): = \boldsymbol{q}_{i + 2} - \boldsymbol{q}_{i + 1}\), \(i = 0,1, \ldots,n - 3\), \(\boldsymbol{R'}_{i}(\alpha _{i};t)\) represents the derivative of \(\boldsymbol{R}_{i}(\alpha _{i};t)\) about t. Referring to Theorem 4, we give the following theorem without proof.

Theorem 5

To construct the monotonicity-preserving quartic Catmull–Rom spline, the free parameter of each spline segment should be taken as

$$\begin{aligned} \alpha _{i} = - \frac{\int _{0}^{1} ( \boldsymbol{r'}_{i}(t) \cdot ( \boldsymbol{s'}_{i}(t) - \boldsymbol{Q'}_{i}(t) ) ) \,\mathrm{d}t}{\int _{0}^{1} \Vert \boldsymbol{r'}_{i}(t) \Vert ^{2} \,\mathrm{d}t}. \end{aligned}$$
(20)

After determining the free parameter of each spline segment by Eq. (20), we can generate the whole monotonicity-preserving quartic Catmull–Rom spline. Figure 7shows the cubic Catmull–Rom spline and the monotonicity-preserving quartic Catmull–Rom spline interpolating the following monotone data:

$$\begin{aligned} &(\mathrm{a})\quad x = - 3, - 3, - 1, 0, 3, 5, 6, 6,\qquad y = - 3, - 3, - 2, 0, 1, 2, 4, 4, \\ &(\mathrm{b})\quad x = 0.1, 0.1, 0.2, 0.6, 1.0, 1.2, 1.4, 1.4,\qquad y = 1 / x^{2}. \end{aligned}$$
Figure 7
figure 7

The monotonicity-preserving quartic Catmull–Rom spline and the cubic Catmull–Rom spline. In each example, the dotted lines represent the control polygon, the dashed lines represent the cubic Catmull–Rom spline, the solid lines represent the monotonicity-preserving quartic Catmull–Rom spline, and the solid points represent the data points

Figure 7 shows that the monotonicity-preserving quartic Catmull–Rom spline is better than the cubic Catmull–Rom spline when approximating the monotone data.

5 Conclusion

We first proposed a novel quartic Catmull–Rom spline with local free parameters in this paper. Different from the cubic Catmull–Rom spline, the quartic Catmull–Rom spline was not only globally adjustable but also locally adjustable. This feature was very conducive to geometric modeling. To construct the quartic Catmull–Rom spline with specific shapes, three schemes for determining the optimal values of the free parameters were presented. These schemes could generate the spline with minimal internal energy, the shape-preserving spline, and the monotonicity-preserving spline. In contrast to the cubic Catmull–Rom spline, the quartic Catmull–Rom spline was more practical in geometric modeling.

Availability of data and materials

The datasets of the current study are available from the corresponding author on reasonable request.

References

  1. Hoschek, J., Lasser, D.: Fundamentals of Computer Aided Geometric Design. AK Peters, Wellesley (1993)

    MATH  Google Scholar 

  2. Catmull, E., Rom, R.: A class of local interpolating splines. Comput. Aided Geom. Des., 317–326 (1974)

  3. Barry, P., Goldman, R.: A recursive evaluation algorithm for a class of Catmull–Rom splines. In: Proceedings of SIGGRAPH, pp. 199–204 (1988)

    Google Scholar 

  4. Derose, T., Barsky, B.: Geometric continuity, shape parameters, and geometric constructions for Catmull–Rom splines. ACM Trans. Graph. 7, 1–41 (1988)

    Article  Google Scholar 

  5. Tayebi Arasteh, S., Kalisz, A.: Conversion between cubic Bezier curves and Catmull–Rom splines. SN Comput. Sci. 2, 398 (2021)

    Article  Google Scholar 

  6. Veltkamp, R., Wesselink, W.: Modeling 3D curves of minimal energy. Comput. Graph. Forum 14, 97–110 (1995)

    Article  Google Scholar 

  7. Xu, G., Wang, G., Chen, W.: Geometric construction of energy-minimizing Bézier curves. Sci. China Inf. Sci. 54, 1395–1406 (2011)

    Article  MathSciNet  Google Scholar 

  8. Ahn, Y., Hoffmann, C., Rosen, P.: Geometric constraints on quadratic Bézier curves using minimal length and energy. J. Comput. Appl. Math. 255, 887–897 (2014)

    Article  MathSciNet  Google Scholar 

  9. Lu, L.: A note on curvature variation minimizing cubic Hermite interpolants. Appl. Math. Comput. 259, 596–599 (2015)

    MathSciNet  MATH  Google Scholar 

  10. Eriskin, H., Yücesan, A.: Bézier curve with a minimal Jerk energy. Math. Sci. Appl. E-Notes 4, 139–148 (2016)

    MathSciNet  MATH  Google Scholar 

  11. Lu, L., Jiang, C., Hu, Q.: Planar cubic \(G^{1}\) and quintic \(G^{2}\) Hermite interpolations via curvature variation minimization. Comput. Graph. 70, 92–98 (2017)

    Article  Google Scholar 

  12. Xu, G., Zhu, Y., Deng, L., Wang, G., Li, B., Hui, K.: Efficient construction of B-spline curves with minimal internal energy. Comput. Mater. Continua 58, 879–892 (2019)

    Article  Google Scholar 

  13. Li, J., Zhang, L.: Length and curvature variation energy minimizing planar cubic \(G^{1}\) Hermite interpolation curve. J. Taibah Univ. Sci. 14, 60–64 (2020)

    Article  Google Scholar 

  14. Wesselink, W., Veltkamp, R.: Interactive design of constrained variational curves. Comput. Aided Geom. Des. 12, 533–546 (1995)

    Article  MathSciNet  Google Scholar 

  15. Juhász, I., Róth, Á.: Adjusting the energies of curves defined by control points. Comput. Aided Des. 107, 77–88 (2019)

    Article  MathSciNet  Google Scholar 

  16. Cao, H., Zheng, H., Hu, G., Abbas, M.: Adjusting the energy of Ball curves by modifying movable control balls. Comput. Appl. Math. 40, Article ID 76 (2021)

    Article  MathSciNet  Google Scholar 

  17. Bica, A.M.: Fitting data using optimal Hermite type cubic interpolating splines. Appl. Math. Lett. 25, 2047–2051 (2012)

    Article  MathSciNet  Google Scholar 

  18. Li, J., Liu, C., Zhang, L.: Shape-preserving planar quadratic Bézier interpolation spline with minimal stretch energy. J. Test. Eval. 48, 2432–2440 (2020)

    Google Scholar 

  19. Han, X., Cubic, G.X.: Hermite interpolation with minimal derivative oscillation. J. Comput. Appl. Math. 331, 82–87 (2018)

    Article  MathSciNet  Google Scholar 

  20. Maggini, M., Melacci, S., Sarti, L.: Representation of facial features by Catmull–Rom splines. Lect. Notes Comput. Sci. 4673, 408–415 (2007)

    Article  Google Scholar 

  21. Yuksel, C., Schaefer, S., Keyser, J.: Parameterization and applications of Catmull–Rom curves. Comput. Aided Des. 43, 747–755 (2011)

    Article  Google Scholar 

  22. Uncini, A., Piazza, F.: Blind signal processing by complex domain adaptive spline neural networks. IEEE Trans. Neural Netw. 14, 399–412 (2003)

    Article  Google Scholar 

  23. Scarpiniti, M., Comminiello, D., Parisi, R., Uncini, A.: Nonlinear spline adaptive filtering. In: Signal Processing, vol. 93, pp. 772–783 (2013)

    Google Scholar 

Download references

Acknowledgements

Not applicable.

Funding

This work was supported by the Hunan Provincial Natural Science Foundation of China (No. 2021JJ30373, No. 2021JJ30375) and the National Natural Science Foundation of China (No. 12101225).

Author information

Authors and Affiliations

Authors

Contributions

All authors equally contributed to this work. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Juncheng Li.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Appendix:  Construction process of the basis

Appendix:  Construction process of the basis

To introduce free parameters into the basis, we raise the degree of basis to be quartic. Suppose that the new basis \(f_{i}(t)\) (\(i = 0,1,2,3\)) is expressed as

$$\begin{aligned} \begin{pmatrix} f_{0}(t) & f_{1}(t) & f_{2}(t) & f_{3}(t) \end{pmatrix} = \begin{pmatrix} 1 & t & t^{2} & t^{3} & t^{4} \end{pmatrix}M, \end{aligned}$$
(A.1)

where M is an undetermined matrix expressed by

$$\begin{aligned} M = \begin{pmatrix} a_{00} & a_{01} & a_{02} & a_{03} \\ a_{10} & a_{11} & a_{12} & a_{13} \\ a_{20} & a_{21} & a_{22} & a_{23} \\ a_{30} & a_{31} & a_{32} & a_{33} \\ a_{40} & a_{41} & a_{42} & a_{43} \end{pmatrix}. \end{aligned}$$

By taking derivation calculus to equation (A.1), we have

$$\begin{aligned} \begin{pmatrix} f'_{0}(t) & f_{1}^{\prime} (t) & f'_{2}(t) & f'_{3}(t) \end{pmatrix} = \begin{pmatrix} 0 & 1 & 2t & 3t^{2} & 4t^{3} \end{pmatrix}M. \end{aligned}$$
(A.2)

Firstly, we hope the quartic basis satisfies the same properties at the endpoints as the basis of the cubic Catmull–Rom spline. From equation (A.1) we have

$$\begin{aligned} a_{00} = 0,\qquad a_{01} = 1,\qquad a_{02} = 0, \qquad a_{03} = 0, \end{aligned}$$
(A.3)

and

$$\begin{aligned} \textstyle\begin{cases} a_{00} + a_{10} + a_{20} + a_{30} + a_{40} = 0, \\ a_{01} + a_{11} + a_{21} + a_{31} + a_{41} = 0, \\ a_{02} + a_{12} + a_{22} + a_{32} + a_{42} = 0, \\ a_{03} + a_{13} + a_{23} + a_{33} + a_{43} = 0. \end{cases}\displaystyle \end{aligned}$$
(A.4)

From equation (A.2) we have

$$\begin{aligned} a_{10} = - 1 / 2,\qquad a_{11} = 0,\qquad a_{12} = 1 / 2,\qquad a_{13} = 0, \end{aligned}$$
(A.5)

and

$$\begin{aligned} \textstyle\begin{cases} a_{10} + 2a_{20} + 3a_{30} + 4a_{40} = 0, \\ a_{11} + 2a_{21} + 3a_{31} + 4a_{41} = - 1 / 2, \\ a_{12} + 2a_{22} + 3a_{32} + 4a_{42} = 0, \\ a_{13} + 2a_{23} + 3a_{33} + 4a_{43} = 1 / 2. \end{cases}\displaystyle \end{aligned}$$
(A.6)

Then from equations (A.3)–(A.6), we can obtain

$$\begin{aligned} &a_{20} = 1 + a_{40},\qquad a_{21} = - 5 / 2 + a_{41},\qquad a_{22} = 2 + a_{42},\qquad a_{23} = - 1 / 2 + a_{43}, \end{aligned}$$
(A.7)
$$\begin{aligned} \begin{aligned} &a_{30} = - 1 / 2 - 2a_{40},\qquad a_{31} = 3 / 2 - 2a_{41},\qquad a_{32} = - 3 / 2 - 2a_{42},\\ &a_{33} = 1 / 2 - 2a_{43}. \end{aligned} \end{aligned}$$
(A.8)

Secondly, we hope the quartic basis satisfies the partition of unity. From equations (A.7) and (A.8) we have

$$\begin{aligned} a_{40} + a_{41} + a_{42} + a_{43} = 1. \end{aligned}$$
(A.9)

Finally, we hope the quartic basis satisfies the symmetry. By computing from equation (A.1), we have

$$\begin{aligned} a_{40} = a_{43},\qquad a_{41} = a_{42}. \end{aligned}$$
(A.10)

By setting \(a_{40} = \alpha \), from equations (A.9) and (A.10) we have \(a_{40} = - \alpha \), \(a_{42} = - \alpha \), \(a_{43} = \alpha \). Thus, we get

$$\begin{aligned} M = \begin{pmatrix} 0 & 1 & 0 & 0 \\ - 1 / 2 & 0 & 1 / 2 & 0 \\ 1 + \alpha & - 5 / 2 - \alpha & 2 - \alpha & - 1 / 2 + \alpha \\ - 1 / 2 - 2\alpha & 3 / 2 + 2\alpha & - 3 / 2 + 2\alpha & 1 / 2 - 2\alpha \\ \alpha & - \alpha & - \alpha & \alpha \end{pmatrix}. \end{aligned}$$
(A.11)

By substituting equation (A.11) into equation (A.1), we can obtain the expression of the quartic basis.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Li, J., Liu, C. & Liu, S. The quartic Catmull–Rom spline with local adjustability and its shape optimization. Adv Cont Discr Mod 2022, 59 (2022). https://doi.org/10.1186/s13662-022-03730-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-022-03730-8

MSC

Keywords