LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drawing catenary lines on a picture

Solved!
Go to solution

Hi,

 

I currently draw straight lines between 2 selected controls on my FP, with 5 pixel width,and shadow.... so they look like wires.

 

I would prefer to join those points with a line that has some "droop"...a gravity like effect.

 

Are there any blocks for computing parabolic paths between 2 points ? Or has someone used a curve fitting type block to do that ?

 

Or better still, a catenary path (as in hyperbolic cosine)... so they have a true gravity-dependent path.

 

The points may be anywhere on the front panel...not just on the same axis.

 

Thanks for any suggestions.

===============================================================

Take a look at DATEx, FOTEx, HELEx & SIGEx add-in trainer boards for NI ELVIS 1,2 & 2+ and DXIQ, ESSB for NI ELVIS III and myDSP for myDAQ to learn Wireless Telecoms, Signals & Systems, Fiber Optics and Green Energy principles (www.emona-tims.com)
0 Kudos
Message 1 of 7
(2,987 Views)

How about using a formual node?  cosh is supported.

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 7
(2,975 Views)

Here is an example of fitting to a catenary, of course my point there was that the cables of a suspension bridge follow a parabolic curve and not a catenary, but the fit is there.

 

http://forums.ni.com/t5/LabVIEW/VI-of-the-Day-10-7-2009-Nonlinear-Curve-Fit-VI/m-p/998262

Message 3 of 7
(2,955 Views)

Thanks Darin,

 

This is a great example.

 

I need to try that curve fitting block out myself.

 

How are the fit parameters passed to the XY graph....Are they used to create a polynomial which is then graphed ?

 

Could you highlight how that happens ?

 

Regards,

 

carloman

===============================================================

Take a look at DATEx, FOTEx, HELEx & SIGEx add-in trainer boards for NI ELVIS 1,2 & 2+ and DXIQ, ESSB for NI ELVIS III and myDSP for myDAQ to learn Wireless Telecoms, Signals & Systems, Fiber Optics and Green Energy principles (www.emona-tims.com)
0 Kudos
Message 4 of 7
(2,935 Views)
Solution
Accepted by carloman

After the fit is performed, the parameters are passed to a Call By Reference Node which is connected to a reference of the VI which calculates the catenary curve (same one used for the fit).  The x points are generated by the Ramp VI with start and stop values determined by the max and min of the clicked points.  This way you get a smooth curve even with three data points.  This curve is then sent to the XY graph which is updated in the Timeout case of the event structure.

0 Kudos
Message 5 of 7
(2,930 Views)

Ah ha...so thats how it done.

Thanks, I get it. Very nice.

 

I will be able to adapt that for my own needs.

 

I would like my catenaries to hang more like a chain...not to have such a flat mid region.

 

Can you refer me to some info on what parameters to change to implement this ?

 

Regards.

===============================================================

Take a look at DATEx, FOTEx, HELEx & SIGEx add-in trainer boards for NI ELVIS 1,2 & 2+ and DXIQ, ESSB for NI ELVIS III and myDSP for myDAQ to learn Wireless Telecoms, Signals & Systems, Fiber Optics and Green Energy principles (www.emona-tims.com)
0 Kudos
Message 6 of 7
(2,920 Views)

c1 is related to curvature, c2 is the vertex location, c3 is a constant offset.  You can create a termination control or constant for the LM VI, set the max iterations to 1 and it will output the curve corresponding to the initial guess.  Change the initial guesses to find the shape you like.

0 Kudos
Message 7 of 7
(2,915 Views)