03-22-2011 07:11 AM
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.
Solved! Go to Solution.
03-22-2011 08:11 AM
How about using a formual node? cosh is supported.
03-22-2011 11:08 AM
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
03-22-2011 06:36 PM
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
03-22-2011 06:45 PM
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.
03-22-2011 08:38 PM
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.
03-22-2011 09:29 PM
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.