The mathematics behind NURBS

 
 
 

Polynomial equations

Starting with the simplest mathematical representation, we all remember from geometry class that we can represent a (two dimensional) line with an equation like y = 2x. For each value of x, we multiply it by 2 to get the value of y, and plot the two values on a graph.

The generalized form of this type of equation is ax + by = c. The expression to the left of the equals sign is called a polynomial (“poly” means many. It refers to the fact that the expression has more than one term).

We can make more complicated expressions where x is multiplied by itself, as y = x * x * x. Instead of writing out all the xs in a term, we usually just count them and write the count as a superscript. The superscript is called “the exponent”. So the expression above is written as y = x 3 .

We can write polynomials with exponents, such as:y = ax 2 + bx + c (You may recall from math class that this is a quadratic equation). The exponent (the 2) on the first occurrence of x means that the graph of this function is curved rather than straight.

Degree

The degree of a polynomial equation is the largest exponent in the equation. Recall that the largest exponent on the equation for a line was 1. (When a term has no visible exponent, that is the same as an exponent of 1.)

Parametric representations

There are two general ways to write an equation for a curve. The implicit representation combines every variable in one long, non-linear equation, such as: ax 3 + by 2 + 2cxy + 2dx +2ey +f = 0.

In this representation, to calculate the x and y values to plot them on a graph, we must solve the entire non-linear equation.

The parametric representation rewrites the equation into shorter, easily solved equations that translate one variable into values for the others: x = a + bt + ct 2 + dt 3 + ... y = g + ht + jt 2 + kt 3 + ...

Using this representation, the equations for x and y are simple. We just need a value for t, the point along the curve for which we want to calculate x and y.

You can visualize parametric curves as being drawn by a point moving through space. At any time t, we can calculate the x and y values of the moving point.

This is a very important point, because the concept of associating a parameter number with every point on the line is used by many tools. This corresponds to the U dimension of the curve.

Complex curve types with NURBS

The lower the degree of a curve equation, the simpler the curve described. What if we want to represent complex curves? The simple answer might be to increase the degree of the curve, but this is not very efficient. The higher the degree of the curve, the more computations are required. Also, curves with degree higher than 7 are subject to wide oscillations in their shape, which makes them impractical for interactive modeling.

The answer is to join relatively low-degree (1 to 7) curve equations together as segments of a larger, more complex composite curve. The points at which the curve segments, or spans, join together is called an edit point.

Higher degree curves should not be completely discounted, however. Degree 5 and 7 curves have certain advantages such as smoother curvature and more “tension”. They are often used in automotive design.

Smooth joins

The degree of the curve determines the smoothness of the joins between spans. Degree 1 (linear) curves give positional continuity at the join. Degree 2 (quadratic) curves give tangent continuity. Degree 3 (cubic) curves give curvature continuity.