LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot a B-Spline defined by a set of knots and control-points?

Solved!
Go to solution

Greetings,

I've parsed a DXF file to obtain the parameters defining a "SPLINE" entity.  The main parameters are "Degree" (2), a 1D "Knots" array and a 1D array of "Control-Points" (where each element is an XYZ coordinate).  From these inputs it should be possible to plot a curve.

 

FYI: The maximum Knot value (24.5) is about half the approximated curve-length (60.1 - sum of chords).

 

Has anyone developed code to plot the curve defined by these parameters (Degree, Knots, Control-points)?

 

Note: LabVIEW's B-Spline fitting function is not applicable to this problem.

 

Thanks!

0 Kudos
Message 1 of 6
(4,247 Views)

If someone has written the B-Spline Plotting Program in LabVIEW in the form you require, I don't think they've posted it anywhere.  However, if you do a Web search for Plot B-Spline, you can find several tutorials and discussions of how to do this.  There is also a plotting function in Matlab which (if you have Matlab) you can examine and recode in LabVIEW (and I don't mean "call as a math script").

 

Bob Schor

0 Kudos
Message 2 of 6
(4,232 Views)

Hi Bob,

I've spent many hours looking into this.  Please let me know if you see a good example describing how to implement the "de Boors" algorithm in the XYZ context and using chord-length-generated Knots.  Of course I've looked at the B-Spline wiki, also Wolfram (it doesn't help that there is at least one discrepancy between the two descriptions (see "degree" index in basis function definition).

 

 Must the de Boor result be a scaler?  If so, how to convert that scaler back into the XYZ domain?

0 Kudos
Message 3 of 6
(4,217 Views)
Solution
Accepted by topic author 550nm

The MGI Spline toolkit has a VI which implements the de Boor's algorithm.

Message 4 of 6
(4,194 Views)
Solution
Accepted by topic author 550nm

@GregSands wrote:

The MGI Spline toolkit has a VI which implements the de Boor's algorithm.


While I had a little trouble finding this on the MGI Website, opening VIPM and looking under the MGI entries quickly located MGI Spline.

 

Bob Schor

Message 5 of 6
(4,156 Views)

Thank you Bob & Greg.

0 Kudos
Message 6 of 6
(4,148 Views)