# Rhino.Geometry.NurbsCurve() constructor bug

Hello all,

I may be using it wrong but I am finding that:

Rhino.Geometry.NurbsCurve(dimension, rational, degree, point count) creates a Nurbs Curve object with one less Knot than Rhino.Geometry.NurbsCurve(degree, point count);

Hi,

The constructor initializes the curve, but does not add mutable properties like the knot vector and the actual control points. With a given degree, you can create a default knot vector sequence. But usually for a NurbsCurve the knot vector is the important property. It determines the parameterization, the subdivision of the BĂ©zier segments and the continuity in between these segments. If itâ€™s periodic or not, etc. Without specifying, you canâ€™t really control the curve itself.
Unless you want to do this manually, you should use one out of the static factory methods:

NurbsCurve.Create()
NurbsCurve.CreateFromLine()
â€¦

You can also create another curve type and apply the .ToNurbsCurve() method.

Hi Tom,

Thank you so much for your answer. I understand all this as I am negotiating rhino against a custom Nurbs implementation. I am saying that the Knot Vector that is outputted from that constructor is the wrong size and that it may be a bug. Unless that constructor produces a knot vector one size too small by design and I am missing something.

Matthew.

Ok, I guess the post was a bit off to your question. Iâ€™m just trying to say that it shouldnâ€™t matter what the knot-vector is after calling the constructor, because if you create a curve from scratch, then you need to define the knot-vector anyway. In other words, even if there is a mismatch on different ctor overrides, the knot-vector is at that point just a placeholder.

Btw: I noticed the following:
public NurbsCurve(
int dimension,
bool rational,
int order,
int pointCount
)

The ctor with more arguments does memory allocate. In order to do that, it needs to know the amount of future cps equal to the length of the knot vector.

The order is not the degree of a curve. The order is usually the degree+1.

1 Like

That describes my problem! Yeah, you are right I forgot that as the other describe degree instead of order. Bizarre that one calls order and the other calls degreeâ€¦nevertheless, thanks, Iâ€™ll be more careful on the future.