views:

467

answers:

1

I might need to visualize a B-Spline ( http://en.wikipedia.org/wiki/B-spline ) in .NET. I do not where to start. Is there any easy way or library to do it? I would prefer to do it in Silverlight but WPF and Win Forms is also fine. I imagine the software as a coordinate system with some control points that you can add, delete or move around causing the spline to be repainted. Note that I lack the mathematical background. I found some methods in GDI+ that seem to be intended for drawing splines but I am not sure if these are B-Splines.

Any advice would be appreciated. Libraries, code, links to guides or general suggestions are welcome.

+1  A: 

Hello Stilgar,

I've written a very quick program quite awhile ago for some scientific code that utilized splines. In particular, these splines are NURBS (non-uniform rational basis splines). This is the most generalized form of the spline. All other splines are special cases of this type. The knot vector is used to generate the spline, and the recursive Cox de Boor algorithm is used to calculate the value of a point. The C# code is very poor, it was something I threw together quickly to solve a problem and before I was a more polished developer. If you google Cox de Boor, you will find many pages that discuss the theoretical underpinning of splines. Beware, most of them have some sort of error (some of them in their discussion of the knot vector)

http://stochfit.svn.sourceforge.net/viewvc/stochfit/trunk/NURBs/

I don't recall all of the mathematical details, but will try to help if I know the answer. Good luck, this was very difficult knowledge to acquire on my part!

EDIT - I believe you get a B-spline from these methods if you set the weight for a given point to 1.

Steve
IT seems like this could be really helpful. I will check it in details tomorrow.
Stilgar