POV-Ray : Newsgroups : povray.off-topic : Splines : Re: Splines Server Time
3 Sep 2024 23:28:46 EDT (-0400)
  Re: Splines  
From: Invisible
Date: 12 Jul 2010 07:10:59
Message: <4c3af843@news.povray.org>
Invisible wrote:


> has a "knot vector" which controls how much of the curve is influenced 
> by a specific control point. A B-spline can be "uniform" (all knots 
> equally spaced) or "non-uniform" (knot spacing is unequal).
> 
> This much I understand. What I don't yet understand is the fine detail 
> of how B-splines actually work.

OK, so now I think I understand.

The knots control the mapping of the parameter space onto the spline 
(which would be important if you were using the spline to animate 
something), which also influences its shape. Essentially the value of a 
given knot determines the parameter value at which a given control point 
achieves its maximum "influence" over the spline.

Then there is a set of recursively-defined "basis functions". The spline 
itself is made by just multiplying each control point by a basis 
function and adding all the products together. So the number of basis 
functions controls the number of control points.

The number of 0th-order basis functions is one less than the number of 
knots. (E.g., if you have 10 knots, you have 9 of these functions.) The 
Nth such function is zero, except that it becomes one when T is between 
knots N and N+1.

Now, the recursive part: In the next order up, you have one fewer 
functions. And each function is a linear interpolation between two lower 
ones (scaled according to the knot values in a way that's slightly fiddly).

Have a look at the attachment. It's an Excel file that plots a simple 2D 
(non-uniform) B-spline. It should be possible to alter anything on the 
"control" sheet and have the various graphs update. (Don't try to put 
any knots outside the range 0<=t<=1 though.)


Post a reply to this message


Attachments:
Download 'b-spline v4.zip' (98 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.