A B-Spline may be used by CAD software to represent a curve. With B-Spline, a curve is encoded by a set of
"Control-points", a set of "Knots" and the "Degree" of the spline. This method is currently
employed within .DXF files to represent a "SPLINE" "entity". Using given Degree, Knots and Control-points, The
"De Boor's algorithm" converts a scaler value (within the range of Knots) to a point on the curve.
At the heart of this example is a reentrant VI which implememnts the (recursive) De Boor's algorithm
- "Util.Math.BSpline.deBoors.Recursive.vi". It can be used to translate any scaler/target (within
Knot domain) into a point on the curve.
Util.Math.BSpline.deBoors.vi calls the recursive VI multiple times - once for each element in an
array of targets - generating an array of points.
The top-level VI is actually a sub-VI from a larger application, but it can be run independently and
will plot a curve using the default input values.
LabVIEW 2013 or later.
1. Open top-level VI and click run-arrow.
This VI is a sub-VI from a larger application designed to convert several types of DXF entities into "polylines" (for another process).
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Hi 550nm,
Thank you for taking the time to share this example code with the community! I've reviewed it and have some recommendations for it, so that it can meet the Community Example style guidelines. Most of these are minor stylistic changes that we ask for in order to keep the user experience consistent for Community Examples, and to ensure that the code can be implemented seamlessly into larger applications.
Once the following changes have been made, I'll go ahead and push the example live for all users of the community:
Best regards,