- Research
- Open access
- Published:
The quartic Catmull–Rom spline with local adjustability and its shape optimization
Advances in Continuous and Discrete Models volume 2022, Article number: 59 (2022)
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 [2–5] 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 [6–13]. The external energy of curves is another common objective functional for optimizing the shape of curves, see [14–16]. 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 [2–5]
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
The basis expressed in (2) has the following properties:
(a) Partition of unity, that is,
(b) Symmetry, that is,
(c) Properties at endpoints, that is,
By computing from Eq. (1) we have
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
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
(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
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 α.
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
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
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.
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.
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
for any \(\alpha _{i}\), where \(k = 1,2,3\).
where
By substituting Eq. (10) into Eq. (9), we have
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:
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
Proof
From Eq. (11) we have
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.
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.
Thereby, we can get the following model:
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
Proof
By Eq. (10) we have
From Eq. (17) we have
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:
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:
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
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:
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
Hoschek, J., Lasser, D.: Fundamentals of Computer Aided Geometric Design. AK Peters, Wellesley (1993)
Catmull, E., Rom, R.: A class of local interpolating splines. Comput. Aided Geom. Des., 317–326 (1974)
Barry, P., Goldman, R.: A recursive evaluation algorithm for a class of Catmull–Rom splines. In: Proceedings of SIGGRAPH, pp. 199–204 (1988)
Derose, T., Barsky, B.: Geometric continuity, shape parameters, and geometric constructions for Catmull–Rom splines. ACM Trans. Graph. 7, 1–41 (1988)
Tayebi Arasteh, S., Kalisz, A.: Conversion between cubic Bezier curves and Catmull–Rom splines. SN Comput. Sci. 2, 398 (2021)
Veltkamp, R., Wesselink, W.: Modeling 3D curves of minimal energy. Comput. Graph. Forum 14, 97–110 (1995)
Xu, G., Wang, G., Chen, W.: Geometric construction of energy-minimizing Bézier curves. Sci. China Inf. Sci. 54, 1395–1406 (2011)
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)
Lu, L.: A note on curvature variation minimizing cubic Hermite interpolants. Appl. Math. Comput. 259, 596–599 (2015)
Eriskin, H., Yücesan, A.: Bézier curve with a minimal Jerk energy. Math. Sci. Appl. E-Notes 4, 139–148 (2016)
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)
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)
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)
Wesselink, W., Veltkamp, R.: Interactive design of constrained variational curves. Comput. Aided Geom. Des. 12, 533–546 (1995)
Juhász, I., Róth, Á.: Adjusting the energies of curves defined by control points. Comput. Aided Des. 107, 77–88 (2019)
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)
Bica, A.M.: Fitting data using optimal Hermite type cubic interpolating splines. Appl. Math. Lett. 25, 2047–2051 (2012)
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)
Han, X., Cubic, G.X.: Hermite interpolation with minimal derivative oscillation. J. Comput. Appl. Math. 331, 82–87 (2018)
Maggini, M., Melacci, S., Sarti, L.: Representation of facial features by Catmull–Rom splines. Lect. Notes Comput. Sci. 4673, 408–415 (2007)
Yuksel, C., Schaefer, S., Keyser, J.: Parameterization and applications of Catmull–Rom curves. Comput. Aided Des. 43, 747–755 (2011)
Uncini, A., Piazza, F.: Blind signal processing by complex domain adaptive spline neural networks. IEEE Trans. Neural Netw. 14, 399–412 (2003)
Scarpiniti, M., Comminiello, D., Parisi, R., Uncini, A.: Nonlinear spline adaptive filtering. In: Signal Processing, vol. 93, pp. 772–783 (2013)
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
Contributions
All authors equally contributed to this work. All authors read and approved the final manuscript.
Corresponding author
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
where M is an undetermined matrix expressed by
By taking derivation calculus to equation (A.1), we have
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
and
From equation (A.2) we have
and
Then from equations (A.3)–(A.6), we can obtain
Secondly, we hope the quartic basis satisfies the partition of unity. From equations (A.7) and (A.8) we have
Finally, we hope the quartic basis satisfies the symmetry. By computing from equation (A.1), we have
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
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/.
About this article
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
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s13662-022-03730-8