BSpline Knot Placement Best Practice

I am parsing STEP format files and I am unsure where to position spline knots in space. I have read a wiki and the rhino doc page about B-Spline geometry, and I have read the disclaimer that it is common to mistakenly associate knots with control points. There is no designation for type of BSpline Curve or type of knots ( they are described as unspecified in the text file) exported from Pro/E.

I have a knot vector of length #controlpoints + degree + 1, my current strategy is to set the first knot to the first control point, the last knot to the last control point; and then to evenly distribute the rest. Is there a more correct way to do this with the amount of information available?

In openNURBS, the formula for a knot vector is:

knot_count = cv_count + order − 2

The order of a NURBS curve is equal to (degree + 1). Consequently, the degree is equal to (order ‑ 1). Thus, the above can b rewritten like this:

knot_count = cv_count + degree - 1

Note, openNURBS’s knot vector differs from that of other software packages, as openNURBS does not store superfluous knots.

@chuck, doesn’t a STEP file include knots?

– Dale

NURBS in STEP files usually have knots, but I believe it is possible to have an implied knot vector, in which case the knots would probably be assumed to be 0, 1, 2, … if “uniform” is part of the entity name. “Unspecified” would lead me to expect a knot vector to be present in the file.

Knots and CVs are stored independently. There is no notion of assigning a knot to a CV. Just stick the knots in m_knot (after dealing with the superfluous issue), and the CVs in m_CV.

Also, if you want to know the answer, just import the file into Rhino…

They were superfluous dale, thanks for the input