NURBS algorithm in Rhino

@dalelear

Dear Dale,

I have a question about the NURBS algorithm implemented in Rhino and @DavidRutten recommended me to ask you.

I tried to create a simple quarter circle in Grasshopper using the NurbsCurve module, but I didn’t succeed. This simple example can be found in many books (e.g. The NURBS Book written by Piegl&Tiller):

we have three control points:
{1,0,0}
{1,1,0}
{0,1,0}

three weights:
1
1/sqrt(2)
1

and the following knot vector:
{0,0,0,1,1,1}

Unfortunately I always get an error message from NurbsCurve, that it can’t calculate the curve.
Could you please tell me which NURBS algorithm is implemented in Rhino (e.g. deBoor) and how could I solve the problem?

I really appreciate any help you can provide.
Gabor

  1. What is the exact code you use?
  2. In rhino, so called superfluous knots are not needed, so in your case your knot vector would be {0,0,1,1} and the degree of the curve would be 2.

Dear All,

here is my Grasshopper code. I tried to reproduce a half circle, but the shape of the curve is quite strange, it’s not a half circle. I think the Knot Vector module gives a wrong result. The knot vector should be {0,0,1,1,2,2} and if you try with this one, the curve will be a half circle. Or did I do something wrong?

The NURBS book adds unused knot values I refer to as “superfluous” knot values in other Rhino NURBS documentation.

I looks like you are trying to make a degree 2 NURBS with 3 control points. Your knots should be {0,0,1,1}.

If you are making a continuous (no gaps) NURBS curve of degree D with N control points that has finite derivatives (the kind useful in computer aided modeling and the kind every modeling/CAD/illustration application on the planet expects), then

  • D >= 1
  • N >= D+1
  • knot count = (D+N-1)
  • The knots must be increasing: knot[i] <= knot[i+1] when 0 <= i < (D+N-1)
  • The first span must be strictly increasing: knot[D] < knot[D+1]
  • The last span must be strictly increasing: knot[N-1] < knot[N]
  • The maximum interior knot multiplicity is D: knot[i] < knot[i+D] when 0 <= i < (N-1)

The superfluous knots have their origin in a theoretical recursive definition of the NURBS basis functions that begins with degree zero basis functions. For NURBS used in modeling, the degree is always >= 1 and the superfluous knots are not needed. Because the people who added NURBS support to IGES, OpenGL, …, didn’t think too clearly, they included the superfluous knot values in the data definitions and these persists in subsequent public formats that copied the early ones and in most NURBS literature. If you examine the evaluation algorithm published in the NURBS book and most other literature, you will see the value of the first and last superfluous knots do not effect the value returned by the evaluation code.

The location of each NURBS span is completely determined by 2D knots values and (D+1) control point values. If “a” and “b” are the to two interior knot values in the span, then a < b and the domain of the span is [a,b].

5 Likes