Drawing Bezier Curves

Craig Taakan Scott
3 min readMay 30, 2021

--

I have been reading David F. Rogers’ “An Introduction to NURBS with a Historical Perspective” to immerse myself on NURBS.

This article is meant to briefly cover Chapter 2 of this book and the pseudo-code algorithm in Appendix C.

The equation for a parametric Bezier curve is given by

For the parameter range 0 ≤ t ≤ 1. This is equation 2.1 in the book.

Putting this equation into English,

For every value t within the parameterized curve P(t), a point can be calculated by summing up the contributions of each control polygon (Bi) multiplied by their respective blending function Jn,i(t).

The control polygon is represented as the set of control points

You can generate the blending function by using the Bernstein basis function defined by

One interesting thing to note about the Bernstein basis function is that for each value t, adding up the blending functions equals 1.

If you were to actually calculate each of the blending functions, evaluate at some value t, you would see that the value ends up being 1. The interpolation between contributions of blending functions is something I don’t fully understand, but is definitely something I would like to investigate further.

This somewhat reminds me of generating an orthonormal basis where every point can be represented as a super-position of orthonormal basis points multiplied by some constant.

For example you can represent any point in 3D space with the orthonormal basis {1/sqrt(3), 1/sqrt(3), 1/sqrt(3)} such that

Where e_i corresponds to the basis vector. a_i corresponds to some scalar value that satisfies the equation. Rewriting in summation form

This kind of looks like the formulation for calculating a point on the bezier curve doesn’t it? So in our toy example for 3D space, we are using some base points or vectors with weights to calculate any point in 3D space.

If we reword this to use Bernstein basis functions and control points, we are using Bernstein basis functions as weights and control points as vectors whos output lies on the curve P(t).

Implementing the algorithm in Appendix C we get something that looks like,

The resulting points can be input into any visualization module.

--

--