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.
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.
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 ?
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.
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 ?
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.