Splitting Bezier curve into two parts at some parameter t
is easy thanks to De Casteljau's algorithm.
Is there a similar algorithm for NURBS curves? How to split a NURBS curve?
Splitting Bezier curve into two parts at some parameter t
is easy thanks to De Casteljau's algorithm.
Is there a similar algorithm for NURBS curves? How to split a NURBS curve?
The way that NURBS curves are typically split at an arbitrary point is by knot insertion. You insert knots at the split point until it is at maximum multiplicity, at which point you can just read off the two split curves.
However, you may not want to split at an arbitrary point. If the ultimate goal is to draw the curves or something like that, then it's worth splitting the curve at the existing knot points (that is, performing knot insertion until all knots are at maximum multiplicity) rather than inserting new ones.
This process splits the NURBS into uniform rational B-splines. Once you have that, you can use de Boor's algorithm to split further.
The number of knots in the knot vector is:
numKnots = degreeOfCurve + numControlPoints + 1
or if you prefer:
numKnots = orderOfCurve + numControlPoints
Inserting a knot thus increases the number of control points by one.
As you travel along a NURBS curve, each knot represents a place where one control point "drops out" and another one "enters". If a knot value is repeated, this means that more than one control point is replaced at this place.
For a curve of degree greater than 1, the and last knots are repeated multiple times for one simple reason: you need to bring in more than one point to start and you need to eject more than one point to end.
Let's think about cubic curves for the moment, just to keep things simple.
A curve with the knot vector [0,0,1,1] is a uniform B-spline curve.
A curve with the knot vector [0,0,1,1,2,2] is non-uniform, but can be thought of as two uniform B-spline curves which connect at t=1, one corresponding to [0,0,1,1] and one corresponding to [1,1,2,2]. You can do this because the multiplicity of the knots is enough to "start" and "end" a cubic curve.
If you're faced with a curve with a knot vector like [0,0,1,2,2], you can insert a knot at 1 without changing the shape of the curve (this is the knot insertion procedure). This increases the number of control points by one; the knot insertion procedure adjusts the points around the new knot to accommodate it. But once you've done that, you have two uniform B-spline curves.
Knot insertion won't create overlapping control points unless you insert too many knots at the same place, and by "too many", I mean the degree of the curve. So for a non-uniform cubic curve, you'd insert knots so that every knot had multiplicity 2. That gives you a number of abutting uniform cubic curves, which you can then use de Boor's algorithm to split further.