1
$\begingroup$

Is there an algorithm/process for converting a sequence of bezier curves into a b-spline? I've found much discussion of the reverse, but nothing for this.

I'm attempting to make a spline editor in javascript which can export to DXF, and there is much better support for working with bezier curves in javascript than b-splines...

$\endgroup$
1

1 Answer 1

2
$\begingroup$

Say you have $n$ beziers with degree $d$. Being continuous means the last control point of one bezier must be the same as the first of the succeeding bezier.

Hence the $(d+1)n$ control points has the form:

$\quad c_{1,0},c_{1,1},\ldots,c_{1,d}$
$\quad c_{1,d},c_{2,1},\ldots,c_{2,d}$
$\quad \vdots\quad\vdots\quad\vdots\quad\vdots\quad\vdots\quad\vdots$
$\quad c_{n-1,d},c_{n,1},\ldots,c_{n,d}$

For a B-spline with degree $d$ to coincide with the composite bezier curve, the knot sequence must have $n+1$ distinct knots and the multiplicity of the first and the last must be $d+1$ while the multiplicity $d$ suffice for the interior knots. As always the knots must be increasing, but their values doesn't matter in this case.

The control-points needed for the B-spline doesn't depend upon which values are chosen for the knots. There are $(d+1)n-n+1\ $ B-spline basis functions and the control points for these are exactly the same as those of the bezier curves except for the fact that the control-points that are duplicated by the continuity constraint of your composite bezier curve must be included only once.

That is, the algorithm you need is to simply delete the first control-point of all but the first bezier (or equivalently the last control-point of all but the last bezier).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .