Bézier Splines: Continuity

We provide a tool to explore the continuity of Bézier splines interactively on the web. Bézier splines can be created and modified at will. Different continuity conditions can be enforced. Notably, the first and second derivative vectors are visualized to illuminate the connection between their values and the continuity of the spline.

About Bézier Splines and their Continuity

Bézier Curve Bézier Spline

A Bézier curve (left) and a cubic Bézier spline (right) defined by the same set of control points.

Given a control polygon consisting of n + 1 Bézier points, Bézier curves interpolate the first and last point while approximating all other points. They are polynomial curves of degree n. Moving any Bézier point changes the entire curve, i.e., local control is missing.

Bézier splines consist of several Bézier curves that have been joined consecutively. This alleviates the issue of a high polynomial degree and provides local control in most circumstances. Bézier splines can have different levels of continuity at the joint, which can be characterized using the first and second derivative (velocity and acceleration):

Bézier spline with C0 continuity Bézier spline with G1 continuity Bézier spline with C1 continuity Bézier spline with C2 continuity
Bézier spline with C0 continuity Bézier spline with G1 continuity Bézier spline with C1 continuity Bézier spline with C2 continuity
Bézier spline with C0 continuity Bézier spline with G1 continuity Bézier spline with C1 continuity Bézier spline with C2 continuity
C0-continuity: continuous curve, discontinuous velocity and acceleration G1-continuity: continuous curve, semi-discontinuous velocity, discontinuous acceleration C1-continuity: continuous curve and velocity, discontinuous acceleration C2-continuity: continuous curve, velocity, and acceleration

Two cubic Bézier curves joined together to create a spline. The three interpolated points are identical in all examples, but the different positions of the other points allow for different continuity conditions at the joint.

Using the picture from above, we make the following observations:

User Interface

The top of the user interface provides buttons to enforce different continuity conditions. It is also possible to clear all curves, and to show a single Bézier curve (instead of a spline) through all input points.

Buttons of the user interface

The main part of the user interface provides a large canvas on the right to draw a Bézier spline, and the corresponding velocity and acceleration plots on the left side.

Canvas and plots of the user interface

Authorship and Acknowledgements

This tool has been created by Jule Schmidt and Tino Weinkauf for the course DH2320/DD2258 at KTH Royal Institute of Technology, Stockholm, Sweden.

Our work is inspired by Freya Holmér's video The Continuity of Splines. The setup presented in our tool is similar to what is shown at 20:42 in the video. Note, however, that our C2-continuous spline uses a different setup: we restrict the ends of the spline using the natural end condition, which makes it rather well-behaved. The C2-continuous spline in the video yeets off because the constraints are set differently.

We use Bryce Wilson's code for solving C2 and G2 Bézier splines. The latter are obtained through a knot vector representing the distance ratios between the knots.

We use Plotly to visualize the velocity and acceleration.

Resources

Contents