Excel B-spline Calculator

Excel B-spline Calculator

leeminardi
Mentor Mentor
3,591 Views
1 Reply
Message 1 of 2

Excel B-spline Calculator

leeminardi
Mentor
Mentor

The AutoCAD spline command uses NURBS (Non-uniform Rational B-splines) as the mathematical definition of a smooth curve.  If you create a spline using the CV (Control Vertex) method you will get a 3rd degree B-spline. Using the splinedit command you can edit the spline and get the more complex NURBS spline.

I wanted to improve my understanding of the math behind B-splines and eventually NURBS.  With that goal in mind I created an Excel custom function to create a B-spline for a series of CVs.  The function can be used to create 3rd degree or other degree B-splines.

 

The attached Excel macro enabled file contains a custom BSpline function that will reproduce the initial spline you get in AutoCAD when you specify a series of CVs.  The function is:

      BSpline(u,degree,CVs)

where u is the independent variable of the spline with a range of 0 to (degree + number of CVs + 1) and CVs is an array of the x, or y, or z coordinates of the control points.

Here’s an example Excel worksheet that uses the function to obtain points on the spline.

image.png

... and the corresponding spline in AutoCAD.

image.png

If you are new to parametric spline math and would like to know more I think a good place to start is with Bezier splines. The attached document provides an introduction to Bezier splines that is light (I think) on the math.

I hope you find this of interest.

Lee

lee.minardi
3,592 Views
1 Reply
Reply (1)
Message 2 of 2

TheCADnoob
Mentor
Mentor

Thats awesome, thanks for sharing!

CADnoob

EESignature

0 Likes