## Abstract

Splines are one of the main methods of mathematically representing complicated shapes, which have become the primary technique in the fields of Computer Graphics (CG) and Computer-Aided Geometric Design (CAGD) for modeling complex surfaces. Among all, Bézier and Catmull–Rom splines are the most common in the sub-fields of engineering. In this paper, we focus on conversion between cubic Bézier and Catmull–Rom curve segments, rather than going through their properties. By deriving the conversion equations, we aim at converting the original set of the control points of either of the Catmull–Rom or Bézier cubic curves to a new set of control points, which corresponds to approximately the same shape as the original curve, when considered as the set of the control points of the other curve. Due to providing simple linear transformations of control points, the method is very simple, efficient, and easy to implement, which is further validated in this paper using some numerical and visual examples.

### Similar content being viewed by others

Avoid common mistakes on your manuscript.

## Introduction

### Motivation

One of the main challenges in computer-aided design is finding a suitable shape representation which is both performant and flexible, when implemented in a computer software. Especially with curves, a software engineer is usually presented with a plethora of possible shape representations to choose from. The wide range of candidates and their specific advantages and disadvantages motivate the application of this work. A brief overview of the main purpose of curves and splines as well as the necessity of a conversion method in engineering fields will prepare the reader for the subsequent theory and evaluation part within this paper.

Designers in the car industry often need to construct clay models or sketches of vehicles, where the mathematical representation needs to allow for interactive modifications to curve properties, such as curvature and continuity. Furthermore, one of the key properties of the available mathematical representations is the distinction between *interpolating* and *approximating* curves [10]. This property is related to whether a curve goes through its *Control Points* or not and can be observed as one of the main differences between the two shape representations discussed in this work. Indeed, the reason for conducting this research was the need to support two different curve representations in a common file format, and therefore, the remainder of this paper is focused on proposing a closed-form conversion equation.

Furthermore, according to the German Association of the Automotive Industry (VDA)^{Footnote 1}, different manufacturers and their subcontractors have different geometric modeling systems for curve and surface representations. Thus, another motivating view on exchanging data between different geometric modeling systems to compensate differences in the types of polynomial bases, maximum polynomial degrees and mesh sizes of curve and surface representations is discussed more thoroughly in Ref. [14].

### Engineering Purpose and Related Work

As the field of Computer Graphics (CG) develops, techniques for modeling complex curves and surfaces are being increasingly important. An example may be the rendering of highly detailed landscapes which need to be subdivided (tessellated) depending on the viewing distance to reduce the processing time for a geometry that is barely visible from the current camera viewpoint [12, 30]. One of the major techniques to realize such dynamic tessellation algorithms is the use of parametric splines in which a curve is defined by piecing together a succession of curve segments, and especially, surfaces defined by stitching together a mosaic of surface patches [1].

Splines are a mathematical means of representing a complex curve. For example, it is not possible to define a circle using only a single cubic Bézier curve. Therefore, a common approximation to model a circle is to use four Bézier curve segments [7]. Eventually, a complete path can be defined using a series of points at intervals along the curve segments and defining a function that allows to interpolate along the curve to retrieve additional points within each interval to be calculated. This is often the first step when creating procedural virtual worlds, i.e., generating smooth and infinite highways using Catmull–Rom splines in games [8]. The impressive power of splines is demonstrated when procedural landscapes and roads are combined to create entire virtual city models randomly, as can be seen, for instance in the *SceneCity* Blender addon^{Footnote 2}. As seen with the CG examples, it is possible to generate paths and surfaces using splines. In addition, Splines can be used to animate objects or virtual cameras along predefined paths [27]. Recently, the research community involved in solving the inverse problem to CG, namely, Computer Vision (CV), increasingly discovers splines for recovering the real camera movement from image sequences. In robotics, related research is often concerned with solving the visual Simultaneous Localization And Mapping (SLAM) problem. However, since cameras usually take pictures at specific points in time, the resulting estimated trajectory is discrete. Imposing constraints on the camera path using splines has shown advantages in handling a common image sensor deficiency called *rolling shutter*, where the image exhibits a pixel warping deformation (informally often called a *Jello Effect*) due to a rowwise exposure [5]. Describing the camera trajectory using continuous B-splines offers the advantage that any exposure time along the path can be interpolated and thus allows for correcting the rolling shutter for both monocular [24] and stereo (RGB-D) [20] cameras. To predict and plan the future paths for Automated Driving Systems (ADS), while taking into account obstacles and driving comfort, it was shown that Bézier curves are a reliable solution for an optimal trajectory generation [11, 21].

This short review of interdisciplinary research contains many different types of spline representation, such as Bézier [7, 11, 21], Catmull–Rom [8], B-Splines [20, 24] and Non-uniform Rational B-Spline (NURBS) [12] surfaces. This shows the relevance of providing conversion methods between the various representations of which one is discussed in this paper.

### Paper Structure and Contributions

In this paper, we do not go through the properties and details of Bézier and Catmull–Rom Splines, but rather the aim is to focus on the conversion equations. First, we give a brief explanation of Bézier curves in "Bézier Curves" section as well as a brief explanation of Catmull–Rom Splines in "Catmull–Rom Splines" section. Then, we go through the conversion equations in "Conversion". Note that by conversion, we mean conversion of control points of a curve to the control points of another curve, which results in approximately the same curve as the curve before conversion represents^{Footnote 3}. In "Experiments and Results" section, we validate the equations with some numerical and graphical examples. We use **bold-face** notation for vector representation here. "Discussion" section discusses the conversion equations with regard to the real-world applications and the limitations and proposes some potential future work. Finally, the conclusions are stated in "Conclusion" section.

## Bézier Curves

There are two basic ways of defining a curve—in terms of the polygon vertices, and in terms of the polygon sides [10]. Even though, the latter is the form, which was originally used by Pierre Bézier [2,3,4], we consider the former throughout our paper. There are two reasons for developing a formulation of the Bézier curve in terms of polygon vertices rather than polygon sides. To begin with, the formulation becomes more elegant. Furthermore, as a general principle, it is better to program in terms of absolute vectors rather than a chain of relative vectors, irrespective of the particular user interface, when transformations such as rotation are to be applied to the vectors, because rounding errors do not have the cumulative effect which sometimes give rise to poor drawings. This can be particularly noticeable when transformations are performed, for reasons of speed, in a small satellite graphics computer [10].

A parametric Bézier curve is defined by its control points. The curve does not necessarily go through the control points. There may be 2, 3, 4 or more. For instance, Fig. 1 shows a linear, a quadratic, and cubic Bézier curve, respectively. The figures are drawn using a geometric approach called “de Casteljau’s algorithm”. It is the most common approach for drawing Bézier curves in CAGD. For more details on the algorithm, see Ref. [9].

A cubic Bézier curve can be written in a matrix form by expanding the analytic definition of the curve into its Bernstein polynomial coefficients, and then writing these coefficients in a matrix form using the polynomial power basis [15]. The Bernstein polynomials^{Footnote 4} of degree *n* are defined by Eq. 1 (for more details on Bézier curves, see Ref. [18]):

A Bézier curve uses Bernstein polynomials as basis. A cubic (degree 3 or order 4) is represented by the following:

## Catmull–Rom Splines

Catmull–Rom splines are a family of cubic interpolating splines formulated such that the tangent at each point \({\mathbf {P}} _{i}\) is calculated using the previous and next point on the spline [29]. Unlike a Bézier curve, a (Centripetal) Catmull–Rom spline is defined for only 4 control points (see Fig. 2), i.e., a single Catmull–Rom segment is cubic. As it is an interpolating spline, the curve goes, through its control points, \({\mathbf {P}} _{0},{\mathbf {P}} _{1},{\mathbf {P}} _{2},{\mathbf {P}} _{3}\), and it is only drawn from \({\mathbf {P}} _{1}\) to \({\mathbf {P}} _{2}\) (Fig. 2). The curve is named after Edwin Catmull and Raphael Rom. The principal advantage of this technique is that the points along the original set of points also make up the control points for the spline curve [6].

Catmull–Rom splines are based on the concept of “tension”: the higher the tensions, the shorter the tangents at the departure and arrival points. It affects how sharply the curve bends at the (interpolated) control points [29]. When tension is set to 1 (as it often is), the resulting segments between control points will be straight lines. The basic Catmull–Rom curve arrives and departs with tangents equal to half the distance between the two adjacent points.

The matrix form of a Catmull–Rom^{Footnote 5} spline is shown in Eq. 4:

where \(\tau\) is the tension factor^{Footnote 6}. See Ref. [17] for the proof of Eq. 4 with \(\tau = 1\).

## Conversion

We will use only cubic splines for both Catmull–Rom and Bézier throughout this paper, as the Catmull–Rom splines are only defined with four control points. It is always possible to concatenate multiple splines to create the desired curve. A series of unique cubic polynomials are fitted between each of the data points, with the stipulation that the curve obtained be continuous and appear smooth [22]. As a matter of fact, in industrial applications, it is often found that a particular curve segment is not sufficiently powerful or flexible (i.e., it does not have sufficient degrees of freedom) to adopt a desired shape [10].

Comparing Eqs. 3 and 4, we wish to find the transformation matrix *A* to convert from Catmull–Rom to Bézier:

Consequently, we have,

with *M* and \(M'\) being the following matrices:

The difference is somewhere in the *M* and \(M'\) matrices, since *t* and the coordinate values are identical. Therefore, we should solve the matrix equation in Eq. 10:

We left-multiply both sides by the inverse of the Bézier matrix, to get rid of the Bézier matrix on the right side of the equals sign:

which brings us to Eq. 12.

Multiplying this *A* with our coordinates will give us a proper Bézier matrix expression again, as in Eqs. 13 and 14:

Thus, a Catmull–Rom to Bézier conversion, based on coordinates, requires turning the Catmull–Rom coordinates on the left into the Bézier coordinates on the right (with \(\tau\) being our tension factor), according to Eq. 15:

In addition, in the same way, a Bézier to Catmull–Rom conversion instead requires turning the Bézier coordinates on the left into the Catmull–Rom coordinates on the right. Note that, there is no tension factor this time, because Bézier curves do not have any. Converting from Bézier to Catmull–Rom is simply a default-tension Catmull–Rom curve, based on Eq. 16:

## Experiments and Results

In this section, we use sets of exemplary control points to validate the transformation equations.

### Numerical Analysis

Having the fact that we only consider some random values here, this part cannot be considered as a mathematical proof. However, it gives a sound overview of how the conversion equations (Eqs. 15 and 16) work.

Looking at the equations, it is trivial that the conversion equations are valid for any number of dimensions. In this part, we explain our examples with 3-dimensional (3D) control points.

In the following, first, we validate the conversion from cubic Bézier curves to cubic Catmull–Rom splines by experimenting two random timepoints. In addition, in the second part, we do the reverse and validate the conversion from cubic Catmull–Rom splines to cubic Bézier curves by experimenting two other random timepoints.

#### Conversion from Bézier to Catmull–Rom

Let us have a cubice Bézier curve with the following 3D control points:

Using Eq. 16, we get the following control points for the Catmull–Rom spline with the tension factor \(\tau =1\):

Now, we replace the set of control data points in Eq. 3 and with a random choice of \(t= 0.2\), we get the following:

The obtained value should be the same when using Eq. 4 with \(t= 0.2\):

Solving the matrix equation, we get the following control points:

which are equal to the results of using Eq. 16. \(\square\)

*Another timepoint* Now, to show the equation is valid for any timepoint, we choose another random time \(t= 0.64\) and follow the same procedure as above for the same control points:

Solving the matrix equation, we again get the following values:

which are again equal to the results of using Eq. 16. \(\square\)

#### Conversion from Catmull–Rom to Bézier

In this part, we do the reverse and start with a cubic Catmull–Rom spline with the following 3D control points:

Using Eq. 15, we get the following control points for the Bézier curve with the tension factor \(\tau =1\):

Replacing the set of control data points in Eq. 4 and with a random choice of \(t= 0.45\), we get the following:

The obtained value should be the same, when using Eq. 3 with \(t= 0.45\):

Solving the matrix equation, we again get the following values:

which are equal to the results of using Eq. 15. \(\square\)

*Another timepoint* Now, to show the equation is valid for any timepoint, we choose another random time \(t= 0.32\) and follow the same procedure as above for the same control points:

Solving the matrix equation, we again get the following values:

which are again equal to the results of using Eq. 15. \(\square\)

### Graphical Fitting

In this part, we aim at showing the validity of the conversion equations (Eqs. 15 and 16) by illustrating graphical examples. For the ease of illustration, we assume 2-dimensional (2D) curves in this part.

Figure 3a shows a cubic Bézier curve which is drawn for 1000 timepoints (\(t \in [0,1]\) with a step size of 0.001). Furthermore, the aforementioned figure is drawn using the following randomly generated 2D control points:

Using Eq. 16, we convert the above Bézier control points to the respective control points of a Catmull–Rom cubic spline with the tension factor \(\tau =1\):

and sketch the corresponding cubic Catmull–Rom spline of these new control points for the same 1000 timepoints (\(t \in [0,1]\) with a step size of 0.001). Figure 3b illustrates the resulting curve, which is almost the same as in Fig. 3a.

In a similar way, Fig. 4 shows the reverse conversion from Catmull–Rom to Bézier using Eq. 15 and the following randomly generated 2D control points and the resulting converted control points:

## Discussion

The method proposed in this work allows for converting control points between Bézier and Catmull–Rom definitions. This conversion can be applied in situations, where one of these mathematical representations is not supported in specific software implementations and thus allows to use data, such as 2D drawings, 3D camera trajectories or surfaces across individual software pipelines. For instance, the open source 3D creation suite Blender does not support Catmull–Rom curve primitives^{Footnote 7} but it does support Bézier curves. Therefore, one of the many applications of the proposed method in this paper would be to convert the control points of a Catmull–Rom curve to the Bézier representation to be able to draw the curve in Blender.

This work has also some limitations. The proposed method is solely valid for cubic curve segments, i.e., curves which are defined by four control points. However, Bézier curves may be defined with an arbitrary number of control points and consequently, contain a higher degree polynomial. The advantage of lower degree polynomials is less computations during both the evaluation of the curve and the calculation of derivatives (comparing the definitions in Eqs. 1 and 2, the number of summations/loops depends on the degree of the curve). Therefore, the higher the degree, the higher the number of evaluations. To use our proposed method with higher degree curves, additional techniques such as *Degree Reduction* [26] or *Curve Subdivision* using De Casteljau’s algorithm [23] need to be applied to the curve prior to type conversion. Moreover, B-Splines might be utilized in many applications instead of Bézier splines, due to the fact that they could provide finer local shape control by introducing a *knot vector*. Even though there is a conversion method between B-Splines and Bézier splines [25], the authors are not aware of a method to directly convert between B-Splines and Catmull–Rom splines. Such generalizations to other spline representations are expected to be formulated in future research.

## Conclusion

In this paper, we focused on conversion of control points of a cubic Bézier curve to those of a Catmull–Rom curve and vice versa. It was shown that, to do so, according to Eqs. 15 and 16, we merely need basic linear transformations of the positions of the control points. Moreover, we illustrated that the equations are valid for any timepoint and for control points with arbitrary number of dimensions.

## Notes

In German: Verband der Automobilindustrie.

SceneCity is a procedural city generation addon for Blender available at: https://www.cgchan.com/.

To encourage reproducibility, the source code of the project is publicly accessible here: https://github.com/starasteh/bezier_catmullrom/.

\(\mathbf {P_i'}, i\in \lbrace 0,1,2,3\rbrace\) show the Catmull–Rom spline control points.

In many references, you may find the matrix form of the Catmull–Rom splines as

$$\begin{aligned} \text {Catmull-Rom}(t) =\frac{1}{2}\cdot \begin{bmatrix} 1&t&t^2&t^3 \end{bmatrix}\cdot \begin{bmatrix} 0&{}2&{}0&{}0 \\ -1&{}0&{}1&{}0 \\ 2&{}-5&{}4&{}-1 \\ -1&{}3&{}-3&{}1 \end{bmatrix}. \begin{bmatrix} \mathbf {P'_0}\\ \mathbf {P'_1}\\ \mathbf {P'_2}\\ \mathbf {P'_3} \end{bmatrix} \end{aligned}$$(5)which is the case when \(\tau = 1\).

See the supported curve types in Blender here: https://docs.blender.org/manual/en/latest/modeling/curves/primitives.html.

## References

Bartels RH, Beatty JC, Barsky BA. An Introduction to Splines for Use in Computer Graphics & Geometric Modeling. San Francisco: Morgan Kaufmann Publishers Inc.; 1987.

Bézier P. How Renault uses numerical control for car body design and tooling. Society of Automotive Engineers, Paper SAE 680010; 1968.

Bézier P. Procédé de définition numérique des courbes et surfaces non mathématiques. Automatisme. 1968;13(5):189–96.

Bézier P. Emploi des machines à commande numérique. Paris: Masson; 1970.

Cai Y, Lam E, Howlett T, Cai A. Spatiotemporal analysis of “jello effect” in drone videos. In: Advances in human factors in robots and unmanned systems. Cham: Springer International Publishing; 2020. p. 197–207.

Catmull E, Rom R. A class of local interpolating splines. In: Barnhill RE, Riesenfeld RF, editors. Computer Aided Geometric Design. New York: Academic Press; 1974.

Dokken T, Dæhlen M, Lyche T, Mørken K. Good approximation of circles by curvature-continuous bézier curves. Comput Aided Geom Design. 1990;7(1):33–41.

Dunlop R. Introduction to catmull-rom splines. Microsoft DirectX Most Valuable Professional (MVP) http://www.mvps.org/directx/articles/catmull/

Farin G. Curves and Surfaces for Computer Aided Geometric Design. 5th ed. Burlington: Morgan Kaufmann; 2001.

Forrest AR. Interactive Interpolation and Approximation by Bézier Polynomials. Comput J. 1972;15(1):71–9.

Gonzalez Bautista D, Pérez J, Lattarulo R, Milanes V, Nashashibi F. Continuous curvature planning with obstacle avoidance capabilities in urban scenarios. 17th IEEE international conference on intelligent transportation systems (ITSC); 2014.

Guthe M, Balázs Á, Klein R. Gpu-based trimming and tessellation of nurbs and t-spline surfaces. ACM Trans Graphics. 2005;24(3):1016–23.

Hadunsford, CC BY-SA 3.0 https://creativecommons.org/licenses/by-sa/3.0, via Wikimedia Commons; 2013. https://commons.wikimedia.org/wiki/File:Catmull-Rom_Spline.png.

Hoschek J. Approximate conversion of spline curves. Comput Aided Geom Design. 1987;4(1):59–66 (

**Topics in CAGD**).Joy KI. A Matrix Formulation of the Cubic Bezier Curves. On-Line Geometric Modeling Notes: University of California, Davis; 1997.

Joy KI. Bernstein Polynomials. On-Line Geometric Modeling Notes: University of California, Davis; 2000.

Joy KI. Catmull-Rom Splines. On-Line Geometric Modeling Notes: University of California, Davis; 2002.

Kamermans M. A primer on bézier curves, [online] https://pomax.github.io/bezierinfo/

Kantor I. Bezier curve. The Modern JavaScript Tutorial; 2020. [Online] https://javascript.info/bezier-curve/.

Kerl C, Stückler J, Cremers D. Dense continuous-time tracking and mapping with rolling shutter RGB-D cameras. In: IEEE international conference on computer vision (ICCV); 2015.

Lattarulo R, Pérez J. A hybrid planning approach based on mpc and parametric curves for overtaking maneuvers. Sensors. 2021;21:595.

McKinley S, Levine M. Cubic spline interpolation. College Redw. 1998;45(1):1049–60.

Micchelli CA, Prautzsch H. Uniform refinement of curves. Linear Algebra Appl. 1989;114–115:841–70.

Patron-Perez A, Lovegrove S, Sibley G. A spline-based trajectory representation for sensor fusion and rolling shutter cameras. Int J Comput Vis. 2015;113:208–19.

Prautzsch H, Boehm W, Paluszny M. Bézier and B-Spline techniques. Berlin: Springer; 2002.

Shimin H, Jiaguang S, Tongguang J, Guozhao W. Approximate degree reduction of bezier curves. Tsinghua Sci Technol. 1998;3(2):997–1000.

Spencer-Smith T, Wyvill G. Four dimensional splines for motion control in computer animation. In: State-of-the-art in computer animation. Tokyo: Springer Japan; 1989. p. 153–67.

Stark EL. Bernstein polynome, 1912–1955. In: Butzer PL, editor. ISNM60; 1981. p. 443–61.

Twigg C. Catmull-rom splines. Computer. 2003;41(6):4–6.

Zhang L, She J, Tan J, Wang B, Sun Y. A multilevel terrain rendering method based on dynamic stitching strips. ISPRS Int J Geoinform. 2019;8:255.

## Acknowledgements

This work was supported by Siemens Mobility GmbH, Erlangen, Germany.

## Funding

Open Access funding enabled and organized by Projekt DEAL.

## Author information

### Authors and Affiliations

### Corresponding author

## Ethics declarations

### Conflict of interest

All authors declare that they have no conflict of interest.

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## 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

Tayebi Arasteh, S., Kalisz, A. Conversion Between Cubic Bezier Curves and Catmull–Rom Splines.
*SN COMPUT. SCI.* **2**, 398 (2021). https://doi.org/10.1007/s42979-021-00770-x

Received:

Accepted:

Published:

DOI: https://doi.org/10.1007/s42979-021-00770-x