# Understanding B-Splines

#### Danh860

Hi,

I am working on a a project that involves the use of B-splines. Using the information from this informative http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve-prop.html" [Broken] I have managed to write up a simple script in VBA that allows me to construct the basis functions for a given sequence of knots and then apply this to a set of control points.

Whilst the code works and I can generate splines, I still don't have a full understanding as to how the knots influence the curve - Ultimately, I need the curve to pass through a specific control point (e.g P[k]) and be influenced by a couple of control points before and after P[k]. Additionally, the curve needs to be at least C[1] continuous at this particular control point.

Can anyone suggest the knot sequence and degree of curve that I should be using?

Many thanks,
Dan

Last edited by a moderator:

#### mathman

In most applications cubic polynomials are used.

#### AlephZero

Homework Helper
You would be better using a sequence of spline segments, not one high-order spline.

The end points of each segment lie on the curve. The second and second-to-last control points of each segment define the tangent direction at the end of the curve, so you can get continuity slope by constraining those control points to lie on a straight line (i.e. the tangent line to the curve), and you can control the continuity of curvature by constraining the distance of those control points from the end points.

For many applications cubic spline segments (constraining the slopes but not worrying about the curvature) is a practical method, but you can use higher order segments, and/or different orders in different segments, if you want to.

#### chiro

Like mathman said, you're better of using cubic polynomials.

What you can do is use cubic polynomials and maintain the correct continuity for joining splines. From memory you automatically have C0 continuity, but you want to maintain higher continuity between splines: to do this you want the tangent between points 2 and 3 (point 0 being the first point) and 3 and 4 have the same value. That is tangent(2,3) = tangent(3,4).

Its been a while since i've looked at NURBS though, so i'm not confident I can help you there.

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving