An Introduction to BSpline Curves
Key Takeaways

Basis splines, or Bsplines, are a type of spline function often used for curve fitting.

The main definition for a Bspline equation is as a piecewise polynomial.

Areas as diverse as CFD simulations, computer graphics, statistics, and machine learning make use of Bsplines for polynomial curve fitting.
These Bspline curves are described by a set of piecewise polynomial equations
If you’ve ever used curve fitting tools in your favorite mathematical analysis software, you’ve probably seen an option for spline fitting, or Bspline fitting, more specifically. A basis spline, or Bspline, is a piecewise polynomial function with specific properties that determine the polynomial degree/order. The idea behind using a Bspline curve is to determine a unique polynomial representation of a set of data, whether that data be structural points in 3D space or a set of data on a graph.
Depending on the amount of data available and the chosen order/degree of the polynomial representation, Bsplines can produce very accurate approximations to data. Thus, they may be useful in situations where a functional transformation does not reduce a set of data to a linear trend (e.g., machine learning and statistics) or when a curved representation of a set of discrete data is desired (e.g., computer graphics and 3D printing). In this article, we give an overview of Bspline curves and their useful properties in some example applications.
BSpline Curve Definition
Formally, a Bspline curve is defined as a piecewise polynomial curve with minimum support. The piecewise nature of a Bspline curve means that its representative equation is a linear combination of Bsplines of particular degrees. All Bspline curves are constructed by defining the following elements:
 Polynomial degree  The user has freedom to determine the polynomial degree that will be used to interpolate their data to a Bspline curve model. A higher polynomial degree generally gives more accurate results, although there is a risk of overfitting between data points when the data is sparse.
 Knots  These are points along a Bspline curve where the curve sections meet and connect. All Bsplines have at least two knots, which will define the end points of the Bspline curve.
 Control points  The control points are like the data used for interpolation; they will determine the shape of the resulting Bspline curve and the curve may not intersect with these points.
 Basis functions  These are the polynomial functions to be summed in an iterative fashion in each curve section. The knots define where a new basis function “activates” and begins contributing to the overall curvature of the Bspline curve.
For a curve with knots located at t and indexed by i, and a discrete set of data located at x, the polynomial section defined in section k is determined using an iterative relation:
These Bspline curves are described by a set of piecewise polynomial equations
Each of the basis functions B(x) are a Bezier curve of degree D, which is chosen by the analyst. The above iterative curve generation technique is simple enough to be calculated from sets of tabulated data at each value of x. Some scripting languages (Python, R, etc.) will include libraries that can calculate the form of the basis functions in each curve section.
Extension to Multivariate BSpline Curves
Bsplines are readily extended into multivariate settings, where a single dependent variable is tabulated as a function of multiple independent variables:
Y = f (X_{1},X_{2},...,X_{N})
The above definitions for Bspline curves are then rewritten as vectors and tensors to create a 3D parametric Bspline representation of multivariate data. This is the type of approach used in multivariate statistics and machine learning, and such an approach can be implemented in R, MATLAB, Mathematica, and other analysis software.
For something like computer graphics or CFD simulations, the multivariate function to be regressed is simply a relation between a set of points. In other words, we would have tabulated data for one dimension (e.g., zaxis height) versus tabulated data in the two orthogonal dimensions (the xy plane). This gives a 2D function to be interpolated using Bsplines as a function of only two other variables. Visually, the Bspline curves would appear as contours along the idealized surface, and combining this with color and texture representations would create a realistic looking representation of a real object.
Example with Bspline curves fit to a 3D surface
Finally, to construct an animation, the Bspline curves representing the input data are determined at each moment in time, and the evolution of the curve between time points will appear smooth if the temporal resolution is sufficiently high. This approach does not need to be customcoded when working with mechanical or CFD simulations involving complex surfaces; higher order meshing algorithms are used to construct meshes based on Bspline curves, which are then used in standard numerical techniques involving the NavierStokes equations.
When you need to construct highquality meshes using Bspline curves, take advantage of the automated meshing features in Pointwise from Cadence. Modern numerical approaches used in aerodynamics simulations, turbulent and laminar flow simulations, reduced fluid flow models, and much more can be implemented in Cadence’s CFD simulation tools.
Subscribe to our newsletter for the latest CFD updates or browse Cadence’s suite of CFD software, including Omnis and Pointwise, to learn more about how Cadence has the solution for you.