You are on page 1of 38

Non-Uniform Rational B-spline

(NURBS)
DEFINITION & BASIC KNOWLEDGE
PART 2 OF 2

By Francisco Cisneros
From National Autonomous University of Mexico
June 2017
Before we start
Presentation scope
Formulas and concepts of a parametric equation and the difference of an implicit equation

Study of the formulas of the polynomials that make up the Bzier Curves

Detailed study of formulas that form basis functions

Study of the parameterization of a line and a Bzier curve

Detailed Study of the formulas of de Casteljau Algorithm

Graphic representation and demonstration of a Rational Bzier curve

Continuity of a Rational Curve. Preliminary study of the first derivative and curvature
Parametric,
Summary Implicit and
Explicit Equations
Parametric
equation
References

table The equation of a


Bzier curves

Bzier curve Bzier curves over


arbitrary
parameter
Curves and surfaces intervals

Lines
Parametric
equations of
Curve

Degree Elevation
of a Bzier Curve
The de Casteljau (Funny website)
Algorithm

Derivatives

First Derivative
Rational Bzier
Continuity
Curves
Curvature
Parametric, Implicit and Explicit Equations
There are basically three types of equations that can be used to express in mathematical form a planar
curve: implicit, explicit, and parametric. The parametric equation of a plane curve takes the form:

, = 0 Implicit equation

= Explicit equation


=
Parametric
equation of a
rational curve

=

Parametric, Implicit and Explicit Equations
Examples for a Description
Name General equation
circumference

An implicit function is
a function that is defined
Implicit equation , = 0 + =0 implicitly by an implicit equation,
by associating one of the
variables (the value) with the
others (the arguments).

Explicit form provides a solution for



= or for , however we will not be
Explicit equation able to calculate an equation of
=
an entire circle as a single
= equation that defines both
coordinates.


= ; = cos These instead of defining
Parametric ( = ()) and ( = ()),
equation of a both are defined by a third
rational curve = sin variable, i.e. a parameter
=

Table 1.- Types of equation
Parametric equation
In mathematics, parametric equations define a group of quantities as functions of one or
more independent variables called parameters. Parametric equations are commonly used to express
the coordinates of the points that make up a geometric object such as a curve or surface.
These instead of defining ( = ()) and ( = ()), both are defined by a third variable, that is, a
parameter .
It has the advantage of being able to quickly compute the (, ) coordinates of points on the curve
for plotting purposes. Also, it is simple to dene a curve segment by restricting the parameter to a
nite range, for example 0 1.
Bzier Curves
NURBS is a mathematical model commonly used to represent curves and surfaces. When you are
already plotted, this method offers great flexibility and. (Wait!).
Fig() shows three different Bezier curves, with their corresponding control polygons.
Each control polygon is comprised of four control points that are connect with line segments. (These
control polygons are not closed, and might more properly be called polylines.)
The beauty of the Bezier representation is that a Bezier curve mimics the shape of its control polygon.

As we had previously studied


Complicated shapes can be created by using a sequence of
Bezier curves. Since Bezier curves are tangent to their control
polygons, it is easy to join together two Bezier curves such that
they are tangent continuous. (Therefore ... Continuity)

Fig .- Examples of cubic Bzier curves


The equation of a Bzier Curves
The equation of a Bezier curve is similar to the equation for the center of mass of a set of point
masses. Consider the four masses , , , and in Fig(.a) located at points , , , .

+ + + Equation for the


=
+ + + center of mass

Fig .- Center of mass of four points (b) Cubic Bzier Curve


Fig .- Bzier Curves in Terms of Center of Mass

Figure 2.3.b shows the Bezier curve that results when the point masses in Figure 2.3.a are taken as control points. This
curve is a cubic Bezier curve, cubic because the mass equations are degree three polynomials in .
The equation of a Bzier Curves
+ + + Equation for the
= center of mass
+ + +

Instead of considering as constant and fixed values, said masses will vary according to a parameter , as we shall
see below

= 1 =3 1 = 3 1 =

Now, for each value of t, the masses assume different weights and their center of mass changes continuously. As
varies between 0 and 1, a curve is swept out by the moving center of mass.
The equation of a Bzier Curves
= 1 =3 1 = 3 1 =

1 + 3 1 + 3 1 + = 1 + =1 1

and so we can write the equation of this Bezier curve as = + + + ()

When = 1, = 1
When = 0, = 1 and = = = 0,
and = = = 0. and the curve passes
This explains why the through point .
curve passes through
.

Fig .- Cubic Bzier blending functions

The mass functions are plotted in the graph in the Fig (). The variable masses () are usually called
Basis functions and, as noted before, the locations are known as control points.
The equation of a Bzier Curves
Bzier curves of any degree can be defined. Fig () shows simple curves of degree one through four. A degree
Bzier curve has + 1 control points whose blending functions (basis) are denoted (),

Fig .- Bzier curves of various degree


= 1 , = 0,1, ,

Basis function Formula
The equation of a Bzier Curves

= 1 , = 0,1, , Basis function

is the number of points to choose


Where:

!
, = = = = Binomial coefficient
! ! Combination Formula: Where order does not matter.
This is different from the permutations

Binomial theorem you are choosing from set

Binomial expansion
+ =

Bzier curve
= 1

The equation of a Bzier Curves

= 1 , = 0,1, , Basis function

For example:
In the degree three case,
=3

= 1, = 0,1,2,3

= + + +

= + + +
1 3 1 3 1

Bzier curve
= 1

Parameter interval
Bzier Curves over Arbitrary Parameter Intervals


= 1

Bzier curve

() For lines, affine equations mimic the parametric representations. Sin 2


points define a line, all we need to find two points are two values of .
This allow us to define = , = . For any arbitrary value of ,
() we can define the line as the following affine equation:

+ Affine Parametric
= Equation of a Line
()

Fig.- Polar labels for points on This equation holds for any value of . However, points inside the line
a B-spline curve segment bounded by and are bounded by .
Bzier Curves over Arbitrary Parameter Intervals
This equation gives the equation of a Bezier curve which
starts at = 0 and ends at = 1. It is useful, especially when
= 1
fitting together a string of Bezier curves, to allow an arbitrary
parameter interval: [ , ]
Bzier curve

Such that = and = . We will denote the Bzier curve defined over an arbitrary parameter
interval by , (). Its equation is a modification of the Bzier curves equation.


+
[ = =
= , ]

Affine Parametric
Equation of a Line

If no parameter interval is specified, it is assumed to be [0,1]. That is,

= , ()
Parametric equations of lines is a point on the line

A line can be written in parametric form as follows: is the directions


of the line
In vector form:
= + ; () +
= = = +
= + () +

In this equation, is a point on the line and is the directions of the line as in the Fig ()

Fig .- Line given by +


Revisar https://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/de-casteljau.html
Parametric equations of a curves

Degree 2

Where:
The de Casteljau Algorithm
The De Casteljau algorithm describes how to subdivide a Bzier curve , into two segments , and
, . To facilitate our description of the algorithm, we label the control points of a cubic Bzier curve ,
with , , and as illustrated in the Figure (). The algorithm involves computing the sequence of points.
Parametric equations of lines
Where:
= 1, , ;
= 1 + ; = +
= 0, ,
De Casteljau Algorithm Parametric equations of lines

Fig .- Subdividing a cubic Bzier curve


The de Casteljau Algorithm
Where = . Ratio that relates to all control points
Where: Therefore 0 1
= 1, , ;
= 1 + ; Then, the control points for () are , , , ,
= 0, , ,

and the control points for , () are , , , , .

Although our example is for cubic Bzier curve = 3 , the


algorithm works for any degree.

Fig .- Subdividing a cubic Bzier curve


Degree Elevation of a Bzier Curve
When we have or more Bzier curves, we require that all curves have the same degree since they have greater
flexibility for the design of shapes. So we need to increase the degree of a Bzier curve without changing the
shape. This process is called degree elevation. Suppose we have a Bzier curve of degree defined by + 1
control points , , , , and we want to increase the degree of this curve to + 1 without changing its
shape. Since a degree + 1 Bzier curve is defined by + 2 control points, we need to find such a new set of
control points. Obviously, and must be in the new set because the new curve also passes through them.
Therefore, what we need is only new control points.
Let the new set of control points be , , , , .
As mentioned above, = and = . The new control points are computed as follows:

= + 1 = 1 + ;
New ratio.

This one varying =
with the value of +1

New set

= + 1 of control
+1 +1 points
Degree Elevation of a Bzier Curve
EXAMPLE:

= 3, the new set control points are:
= + 1
+1 +1

=1 =3 =3
1 1 3 1
= + 1 = + 1
3+1
3+1 3+1 3+1

3
4

=2
2 1
= + 1
3+1
3+1 =

2
4
Degree Elevation of a Bzier Curve

1 3
= +
4 4

2 2
= +
4 4

3 1
= +
4 4

(a) Degree Elevation of a Cubic Bzier Curve



=
Fig .- Degree Elevation of a Bzier Curve
Degree Elevation of a Bzier Curve
https://www.khanacademy.org/partner-content/pixar/animate/parametric-curves/p/constructing-curves-using-repeated-linear-interpolation

The(a) Degree Elevation


algorithm of a Cubic
de Casteljau Bzier Curve
Algorithm (b) Repeated
provides a large stable degree
numerical elevation
system that allows programming the co
Since: = and the tangent vectorElevation
Fig .- Degree is .
ofa Bzier Curve
The figure (), shows that when a curve is repeatedly subdivided, the collection of control polygons converge to
repeatedly subdivided, the collection of control polygons converge to the curve. Thus, one way of plotting a c

If degree elevation is applied repeatedly, as shown in Figure 2.9.b, the control polygon converges
to the curve itself.
Derivatives
The parametric derivatives of a Bezier curve can be determined geometrically from its control points. For a
polynomial Bezier curve , () of degree with control points , the first parametric derivative can be
expressed as a polynomial Bezier curve of degree 1 with control points where

= ( )

For example, the Bzier curve in Figure () has a first derivate curve as shown. The first derivate vector () (that
is, the first derivative () evaluated at = ) is tangent to the curve () at the point (). This is illustrated in
Figure () for the point = 0.3 . In this example, = 0 and = 1.

Fig.- Hodograph
Rational Bzier Curves
A rational Bzier curve is one for which each control point is assigned a scalar weight. The equation of a
rational Bzier curve is:

()

The effect of changing a control point weight


is illustrated in Fig. 2.13. This type of curve is
known as a rational Bzier curve, because the
basis functions are rational polynomials, or the
ratio of two polynomials. Note that if all
weights are 1 (or if all weights are simply the
same), a rational Bzier curve reduces to a
polynomial Bzier curve. Rational Bzier
curves have several advantages over
polynomial Bzier curves. Clearly, rational
Bzier curves provide more control over the
shape of a curve than does a polynomial
Bzier curve.
Fig.- Rational Bzier curve
Rational Bzier Curves
( , , 1)

A rational Bzier curve can be interpreted as the


( , , 1)
perspective projection of a 3-D polynomial curve.
( , , 1) Fig. 2.14 shows two curves: a 3-D curve and a 2-D
curve. The 2-D curve lies on the plane = 1 and it is
defined as the projection of the 3-D curve onto the
( , , 1) plane = 1. One way to consider this is to imagine
a funny looking cone whose vertex is at the origin
and which contains the 3-D curve. In other words,
this cone is the collection of all lines which contain
the origin and a point on the curve. Then, the 2-D
rational Bzier curve is the intersection of the cone
with the plane = 1.


Fig.- Rational Bzier curve as the projections of a 3-D curve
Rational Bzier Curves
( , , 1) What we see here can be viewed as the geometric
interpretation of homogeneous coordinates discussed in
Section 7.1.1. The 3D Bzier control points , , 1 =
( , , 1)
( , , ) can be thought of as homogeneous
coordinates (, , ) that correspond to 2D Cartesian
( , , 1)
coordinates , . If the 2-D rational Bzier curve has
control points ( , ) with corresponding weights , then
( , , 1) the homogeneous (, , ) coordinates of the 3-D control
points are , , 1 = ( , , ). Denote points on
the 3-D curve using upper case variables ( , , ())
and on the 2-D curve using lower case variables
( , ()). Then, any point on the 2-D rational Bzier
curve can be computed by computing the
corresponding point on the 3-D curve, ( , , ()),
and projecting it to the plane = 1 by setting:

() ()
= =
() ()
Fig.- Rational Bzier curve as the projections of a 3-D curve
By Similar triangles, we have:
( , , 1) 1
=


Solving
for
However, it is not
( , , 1) complete, since it is
necessary to add the
( , , 1) = control points and expand
it to the degree of the
corresponding curve for
Recall the basis function: each point

( , , 1)

= 1 , = 0,1, ,

For each point


= 1

Basis
function
01
Known data: Expanding the equation with the basis functions for each
point as a function of the parameter , we have:

()
= = =
The basis function is not a ()
problem to calculate it
because it depends on
() the degree of the curve
The denominator of the radius is () and it does not
and the control points , need control points because we previously established
they are data that we will that in the plane it was constant, that is, = 1.
establish previously.
First Derivate at the Endpoint of a Rational Bzier Curve

() 1 + | 1 + 1 +
= = = ;=
() 1 + 1 + 1 +

() 1 + | 1 + 1 +
= = =
() 1 + 1 + 1 +


() =

the equation for the first derivative vector at = 0 must be found by evaluating the following
equations:
0 0 0 (0) 0 0 0 (0)
0 = 0 =
(0) (0)

And for the final end of the rational curve, that is, when = 1 we have:
1 1 1 (1) 1 1 1 (1)
1 = 1 =
(1) (1)
(See the process of differentiation of the equations of the rational curve in and in the PDF document)
First Derivate at the Endpoint of a Rational Bzier Curve
(See the process of differentiation of the equations of the rational curve in and in the PDF document)
Finally we have:

0 = ( ) 1 = ( )

The second derivate of a rational Bzier curve its endpoint is:


1 2
= ( )

An immediate consequence of above equations


is that has the hodograph property. A curve is
said to have hodograph property if, at all points
on the curve, the tangent (in the direction of the
increasing ) lies between the directions of the
control polygon segment . (Fig ). The
existence of the hodograph has many
implications. It means, that one can determine
whether the curve is open or closed, or whether
two curves can intersect tangentially (continuity). Fig. Every tangent to the curve lies between the control segments
Curvature at the Endpoint of a Rational Bzier Curve
The curvature (denoted by ) of a curve is a Imaginary circle
measure of how sharply is a curve. It is defined completing the
by the following formula: curve
1 Osculating
= Curve
circle

Obviously a straight line does not curve at all,


and its curvature is zero. For other curves, the
curvature is generally different at each point on
the curve. In differential geometry, the osculating
circle to a curve at a given point is a circle
whose center lies on the normal line (Thus forming
a right angle) to the curve and has the same Radius of
curvature as the curve given at that point. The curvature
Center of
center and radius of the osculating circle at a curvature
point of the curve are called center of curvature (imaginary)
and radius of curvature of the curve at that Right
point. angle
The osculating circle has with the other curve a
second contact at the point considered, ie the Tangent in common
first and second derivatives of both curves are
equal both having the same tangent in
Fig.- Osculating circle
common.
Curvature at an Endpoint of a Rational Bzier Curve
In Figure, the center of the circle, , is located along
the normal line a distance from the point of contact.
The equation for the curvature of a parametric curve is

=
+

where the dots denote differentiation with respect to


the parameter . If this equation is applied Fig. Osculating Circles
to an endpoint ( = ).
We obtain the following equation :

1
=

where is the degree of the curve and and are as


shown in Fig. () ( is the length of the first line of the
control polygon, and is the perpendicular distance
from to the first line of the control polygon).
Curvature is independent of [ ; ].

Fig. Endpoint curvature


Curvature at an Endpoint of a Rational Bzier Curve
While is mathematically possible to write an equation for the first derivative vector and
for the curvature of a rational Bezier curve as a function of , such equations would be extremely
complicated. The best way to find the curvature or first derivative vector at an arbitrary point
along a rational Bezier curve is to first perform the de Casteljau algorithm to make
the desired point an endpoint of the curve, and then apply the First derivative
or Curvature formula.


[ , ] = =

De Casteljau algorithm


= ( )

First derivative

1
=

Curvature
Continuity
As we had studied, two curve segments [ , ] and [ , ] are said to be continuous (or, to have order
parametric continuity) if:
= , = t ,, = ( )

Thus, means simply that the two adjacent curves share a common endpoint. means that the
two curves not only share the same endpoint, but also that they have the same tangent vector at
their shared endpoint, in magnitude as well as in direction. means that two curves are and
in addition that they have the same second order parametric derivatives at their shared endpoint,
both in magnitude and in direction. In the figure (), the two curves , () and , () are at least
because .

Fig. Bzier curve


Continuity
In the figure (), the two curves , () and , () are at least because .
Furthermore, they are if:

3 3
= ( )

They are if they are and
6 6
2 + = ( 2 )

Fig. Bzier curve


Continuity
A second method for describing the continuity of two curves, that is independent of their
parametrization, is called geometric continuity and is denoted Gk. The conditions for geometric
continuity (also known as visual continuity) are less strict than for parametric continuity. For G0
continuity, we simply require that the two curves have a common endpoint, but we do not require
that they have the same parameter value at that common point. For G1, we require that line segments
p2 p3 and q0 q1 are collinear, but they need not be of equal length. This means that
they have a common tangent line, though the magnitude of the tangent vector may be dierent. G2
(second order geometric continuity) means that the two neighboring curves have the same tangent
line and also the same center of curvature at their common boundary. A general denition of Gn is
that two curves that are Gn can be reparametrized (see Section 2.13) to make them be Cn. Two
curves which are Cn are also Gn, as long as (2.15) holds.
P(t1) = Q(t1); P0(t1) = Q0(t1) 6= 0; : : : ; P(k)(t1) = Q(k)(t1) 6= 0: (2.15)
Second order continuity (C2 or G2) is often desirable for both physical and aesthetic reasons.
One reason that cubic NURBS curves and surfaces are an industry standard in CAD is that they
are C2. Two surfaces that are G1 but not G2 do not have smooth reection lines. Thus, a car body
made up of G1 surfaces will not look smooth in a show room. Railroad cars will jerk where G1
curves meet.
References
Article title:
Website title:
URL:

https://es.wikipedia.org/wiki/Radio_de_curvatura
https://en.wikipedia.org/wiki/Radius_of_curvature
https://en.wikipedia.org/wiki/Osculating_circle
https://es.wikipedia.org/wiki/Circunferencia_osculatriz
https://es.wikipedia.org/wiki/Geometr%C3%ADa_diferencial_de_curvas

You might also like