<p>B-Splines and Beziers are parallel inventions of more or less the same thing. Where Beziers try to start from the idea of fitting tangents. B-Splines start with the idea of basis functions. NURB Splines (or the rational part in fact) are just generalizations of B-Splines so you can describe accurate conic sections*, as they are of special interest in engineering.</p>

<p>First let us start with a simple NURB Spline terminology. The rationale of these curves is a bit different than for Beziers. First there is the concept of a span. A span would roughly be equivalent to a whole Bezier spline except in nurbs you can have any number of spans. </p>

<p><img src="https://i.sstatic.net/mHFPu.png" alt="enter image description here"></p>

<p><strong>Image 1</strong>: One cubic NURBS span. This is a bit atypical in formulation</p>

<p>Each span is formed by the curve degree + 1  control points**. Each curve can consist of any number of points. Each consecutive span reuses the points form previous span by dropping one point and taking one point more in the list. So making more complex curves is as easy as just appending more points to the curve.</p>

<p><strong>NOTE</strong>: The images curves are a bit atypically parametrized, ill explain what this means in the next section. When i take the concept of knots up. This is just a easier way to explain how the curves glue together.</p>

<p><img src="https://i.sstatic.net/PzKKi.png" alt="enter image description here"></p>

<p><strong>Image 2</strong>: 2 cubic spans after each other, each span uses 4 points. together they form one curve. They share most points with each other.</p>

<p>By now we have probably answered the 2 question about adding complexity. But I would like to add that this scheme ensures better continuity than a bezier curve. Additionally you can make the point array that forms the hull cyclic. Forming a closed curve.</p>

<p><img src="https://i.sstatic.net/rolEZ.png" alt="enter image description here"></p>

<p><strong>Image 3</strong>: A closed cubic NURBS surface has as many spans as it has points. Each color is one span.</p>

<h3>Parametrization</h3>

<p>Up until this point one could just say that the stringing together the spans is a trick just as "sewing" the Bezier curves. But there is a difference. The curve is parametrisized along its length. So the curves are not separate they do not interpolate form 0 to 1 on each span like Beziers do. Instead the underlying curve has a cusomizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary increasing value in the sequence. So you can parametrize the entire curves u range to 0 - 1 or 0 to 12. The parametrization also does not have to be uniform.</p>

<p>This parametrization changes how the curve is shaped. Why would this be useful? Well you can adjust the tension along the curve for one. Or you could encode the length of the curve into to the U parameter. One peculiar use is to make the NURBS curve act like a Bezier curve either fully or just partially (bezier like in the ends but not in the middle for example).</p>

<p><img src="https://i.sstatic.net/w7sHM.png" alt="enter image description here"></p>

<p><strong>Image 4</strong>: Same points different knot sequences. The green NURBS curve corresponds to a Bezier curve that has a parameter range of 0-2 instead of 0-1</p>

<p><strong>Ok so what are the knots?</strong> They are simply the ranges of the basis functions. Since the cubic b-spline with 4 points has 4 interpolating functions it needs 8 knots. Only areas where 3 functions overlap and sum up to 1.0 can a line be drawn.</p>

<p><img src="https://i.sstatic.net/GnJeM.gif" alt="enter image description here"></p>

<p><strong>Image 5</strong>: 2 different basis functions, a bezier like and a uniform segment parametrisation, spread to 0-1 range. </p>

<p>And now we have mostly described the answer to question 1. The range is not defined you can stretch the basis functions as you see fit. And finally the knot vector simply produces the parameter ranges for the basis functions. Theres still one more thing that governs the shape of the curve and that is the weight vector. But that another story to be told elsewhere.</p>

<hr>

<p>* This rational in this case means that a NURBS curve does not have to be a polynomial, as you cant describe a circle with polynomials. </p>

<p>** One can define other types of points.</p>

CC BY-SA 3.0
2015-08-26T14:04:49.080Z
regarding (*), Bezier curves have the same problem.  The issue there is that the curves (in both cases) are defined as x = f(t), y = f(t). However, you can also define a univariate / explicit / 1 dimensional curve (again, in both cases) as y = f(x), using x in place of t.  In the case of rational curves, instead of being able to represent conic sections, you can represent sine and cosine (and more of course).  NURBS / b-splines aren't special in that regard.
Alan Wolfe
CC BY-SA 3.0
2015-08-26T14:16:36.920Z
I think your statement about length is wrong (only works with linear functions?), and not sure how length calculations is supposed to fit in your explanation (good info you gave, just sayin'!)
Alan Wolfe
CC BY-SA 3.0
2015-08-26T14:21:08.100Z
@AlanWolfe deleted anyway
joojaa
CC BY-SA 3.0
2015-08-26T21:31:50.683Z
Typo perhaps? "Instead the underlying surface has a customizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary value that is bigger than the next." -> "Instead the underlying **curve** has a customizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary value that is bigger than the **previous**." Btw., could you please clarify what you mean by "UV range"? "UV" implies 2D..?
Ecir Hana
CC BY-SA 3.0
2015-08-27T11:05:22.887Z
@EcirHana Done do you need the multiplicity explanation here
joojaa
CC BY-SA 3.0
2015-08-27T11:20:51.860Z
@joojaa Thanks! Yes, I've just posted another [question](http://computergraphics.stackexchange.com/questions/358/)
Ecir Hana
CC BY-SA 3.0
2015-10-05T07:49:30.763Z
@joojaa Hi, May I ask you a question about `interpolate` a set of points with `closed B-spline curve`. Please see [here](http://scicomp.stackexchange.com/questions/20921/how-to-interpolate-a-set-of-points-with-a-continuous-closed-b-spline-curve)
xyz
CC BY-SA 3.0
2015-10-05T17:35:38.827Z
@ShutaoTANG [image 1-2 postscript file](http://pastebin.com/Ncz4KxAC) as per request.
joojaa
CC BY-SA 4.0
2015-08-25T16:12:23.277Z
2019-01-08T09:08:00.950Z
2019-01-08T09:08:00.950Z
joojaa
<p>I'm trying to understand NURBS curves (surfaces later!) but I have some trouble understanding the very basics of its inner workings. Could someone please explain a few things to me? As I come from Bezier curves, a comparison between these two would be especially useful.</p>

<ol>
<li><p>The <a href="https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline#Technical_specifications">"rational basis function"</a> looks a tiny bit like Bernstein polynomial of (rational) Bezier curve. Does the parameter <code>u</code> also go from 0 to 1?</p></li>
<li><p>How to "add detail" to a curve? I mean, with Beziers if I needed to describe a more complicated shape I would simply "stitch" several Beziers together. Or less often, increase the degree. I understand I can increase the degree of NURBS as well and put several NURBS curves side-by-side, but is this how it should be done?</p></li>
<li><p>The Wikipedia article, at least to me, seems not very clear about this "knot vector". What is it anyway?</p></li>
</ol>

CC BY-SA 3.0
2015-08-25T13:42:10.423Z
This is a bit too much stuff for one question. I can essentially boil down my introductory lecture on the subject in a few hours. Bit going into detail of use of De casteljanu and the de boor's algorithm would take me too much time.
joojaa
CC BY-SA 3.0
2015-08-25T13:51:16.213Z
So i would like to see questions 3, 5 and possibly 6 split off as separate questions to make answering and understanding more meal sized.
joojaa
CC BY-SA 3.0
2015-08-25T14:03:19.830Z
@joojaa Sure, I can split the question, just a sec...
Ecir Hana
CC BY-SA 3.0
2015-08-25T14:11:09.837Z
So the question [3](http://computergraphics.stackexchange.com/questions/338), [5](http://computergraphics.stackexchange.com/questions/339/nurbs-curve-drawing) and [6](http://computergraphics.stackexchange.com/questions/340/splitting-of-nurbs-curves) were split off to separate questions.
Ecir Hana
<nurbs>
Non-uniform rational B-spline (NURBS) Basics
Ecir Hana
# Non-uniform rational B-spline (NURBS) Basics

(Asked by: username_0 on 2015-08-25)

I'm trying to understand NURBS curves (surfaces later!) but I have some trouble understanding the very basics of its inner workings. Could someone please explain a few things to me? As I come from Bezier curves, a comparison between these two would be especially useful.

1. The ["rational basis function"](https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline#Technical_specifications) looks a tiny bit like Bernstein polynomial of (rational) Bezier curve. Does the parameter `u` also go from 0 to 1?
2. How to "add detail" to a curve? I mean, with Beziers if I needed to describe a more complicated shape I would simply "stitch" several Beziers together. Or less often, increase the degree. I understand I can increase the degree of NURBS as well and put several NURBS curves side-by-side, but is this how it should be done?
3. The Wikipedia article, at least to me, seems not very clear about this "knot vector". What is it anyway?

**Tags:** nurbs

> **Comments:**
> **username_1**: This is a bit too much stuff for one question. I can essentially boil down my introductory lecture on the subject in a few hours. Bit going into detail of use of De casteljanu and the de boor's algorithm would take me too much time.  
> **username_1**: So i would like to see questions 3, 5 and possibly 6 split off as separate questions to make answering and understanding more meal sized.  
> **username_0**: @username_1 Sure, I can split the question, just a sec...  
> **username_0**: So the question [3](http://computergraphics.stackexchange.com/questions/338), [5](http://computergraphics.stackexchange.com/questions/339/nurbs-curve-drawing) and [6](http://computergraphics.stackexchange.com/questions/340/splitting-of-nurbs-curves) were split off to separate questions.  

---

## 1 answers

### Answer by username_1 on 2015-08-25. Score: 8 | Accepted answer

B-Splines and Beziers are parallel inventions of more or less the same thing. Where Beziers try to start from the idea of fitting tangents. B-Splines start with the idea of basis functions. NURB Splines (or the rational part in fact) are just generalizations of B-Splines so you can describe accurate conic sections\*, as they are of special interest in engineering.

First let us start with a simple NURB Spline terminology. The rationale of these curves is a bit different than for Beziers. First there is the concept of a span. A span would roughly be equivalent to a whole Bezier spline except in nurbs you can have any number of spans.

![enter image description here](https://i.sstatic.net/mHFPu.png)

**Image 1**: One cubic NURBS span. This is a bit atypical in formulation

Each span is formed by the curve degree + 1 control points\*\*. Each curve can consist of any number of points. Each consecutive span reuses the points form previous span by dropping one point and taking one point more in the list. So making more complex curves is as easy as just appending more points to the curve.

**NOTE**: The images curves are a bit atypically parametrized, ill explain what this means in the next section. When i take the concept of knots up. This is just a easier way to explain how the curves glue together.

![enter image description here](https://i.sstatic.net/PzKKi.png)

**Image 2**: 2 cubic spans after each other, each span uses 4 points. together they form one curve. They share most points with each other.

By now we have probably answered the 2 question about adding complexity. But I would like to add that this scheme ensures better continuity than a bezier curve. Additionally you can make the point array that forms the hull cyclic. Forming a closed curve.

![enter image description here](https://i.sstatic.net/rolEZ.png)

**Image 3**: A closed cubic NURBS surface has as many spans as it has points. Each color is one span.

### Parametrization

Up until this point one could just say that the stringing together the spans is a trick just as "sewing" the Bezier curves. But there is a difference. The curve is parametrisized along its length. So the curves are not separate they do not interpolate form 0 to 1 on each span like Beziers do. Instead the underlying curve has a cusomizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary increasing value in the sequence. So you can parametrize the entire curves u range to 0 - 1 or 0 to 12. The parametrization also does not have to be uniform.

This parametrization changes how the curve is shaped. Why would this be useful? Well you can adjust the tension along the curve for one. Or you could encode the length of the curve into to the U parameter. One peculiar use is to make the NURBS curve act like a Bezier curve either fully or just partially (bezier like in the ends but not in the middle for example).

![enter image description here](https://i.sstatic.net/w7sHM.png)

**Image 4**: Same points different knot sequences. The green NURBS curve corresponds to a Bezier curve that has a parameter range of 0-2 instead of 0-1

**Ok so what are the knots?** They are simply the ranges of the basis functions. Since the cubic b-spline with 4 points has 4 interpolating functions it needs 8 knots. Only areas where 3 functions overlap and sum up to 1.0 can a line be drawn.

![enter image description here](https://i.sstatic.net/GnJeM.gif)

**Image 5**: 2 different basis functions, a bezier like and a uniform segment parametrisation, spread to 0-1 range.

And now we have mostly described the answer to question 1. The range is not defined you can stretch the basis functions as you see fit. And finally the knot vector simply produces the parameter ranges for the basis functions. Theres still one more thing that governs the shape of the curve and that is the weight vector. But that another story to be told elsewhere.

---

\* This rational in this case means that a NURBS curve does not have to be a polynomial, as you cant describe a circle with polynomials.

\*\* One can define other types of points.

> **Comments:**
> **username_2**: regarding (*), Bezier curves have the same problem.  The issue there is that the curves (in both cases) are defined as x = f(t), y = f(t). However, you can also define a univariate / explicit / 1 dimensional curve (again, in both cases) as y = f(x), using x in place of t.  In the case of rational curves, instead of being able to represent conic sections, you can represent sine and cosine (and more of course).  NURBS / b-splines aren't special in that regard.  
> **username_2**: I think your statement about length is wrong (only works with linear functions?), and not sure how length calculations is supposed to fit in your explanation (good info you gave, just sayin'!)  
> **username_1**: @username_2 deleted anyway  
> **username_0**: Typo perhaps? "Instead the underlying surface has a customizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary value that is bigger than the next." -> "Instead the underlying **curve** has a customizable parameter range. The parameter is stored in something called a knot, and each knot can have a arbitrary value that is bigger than the **previous**." Btw., could you please clarify what you mean by "UV range"? "UV" implies 2D..?  
> **username_1**: @username_0 Done do you need the multiplicity explanation here  
> **username_0**: @username_1 Thanks! Yes, I've just posted another [question](http://computergraphics.stackexchange.com/questions/358/)  
> **username_3**: @username_1 Hi, May I ask you a question about `interpolate` a set of points with `closed B-spline curve`. Please see [here](http://scicomp.stackexchange.com/questions/20921/how-to-interpolate-a-set-of-points-with-a-continuous-closed-b-spline-curve)  
> **username_1**: @ShutaoTANG [image 1-2 postscript file](http://pastebin.com/Ncz4KxAC) as per request.  

---

