Grasshopper

algorithmic modeling for Rhino

Hi all,

After searching through the forum and finding these three discussions on catenary curves, I still have not found something workable for what I am trying to do. Like Michael, I am trying to make a catenary curve based on the sag height of the chain (or height of the arch) as opposed to the chain length that Grasshopper already provides. While the scripts made by Daniel (here) and Lukas (here) were impressive and helpful, I need to be able to input start & end points that aren't necessarily at the same height and still be able to specify the overall maximum height (from the higher point) of the catenary. I couldn't get either of their scripts to work for that. I tried modifying their code (after converting Daniel's C# to VB), but didn't get very far due to not knowing the Rhino SDK very well. Basically, I would like to make a component like one I laid out in the image below.

Inputs: Point A, Point B (not necessarily at the same height), Height (or sag), a Point the specified height is relative to, Direction of gravity (so Height is measured in this direction), and possibly the Number of control points desired for building the curve.

Outputs: the interpolated Curve, maybe the Control Points used to build the Curve, and it might be handy to output the Length of the Curve (chain/arch) as well as the mysterious "a" value in the standard catenary formula since we'll need to calculate those anyway.

Alternatively, a second option (the 2nd VB component with fewer parameters in the image) is much simpler and could potentially replace/upgrade the catenary component already in Grasshopper. "Type" would be the type of parameter we're inputting to get the desired curve: either max height, chain length (which the current component already does), or the "a" value, useful for making an extended curve with a pre-determined "a" value (maybe?). And the "Val" would obviously be that value (length, height, or a). "Grav" is gravity direction/vector. As for the output, the curve is obviously necessary, but maybe outputting the "a" value or the length might be helpful. Seems like this addition to the existing component would be pretty useful, especially for architecture.

I've included the ghx file with the scripts in progress...the first one is a straight conversion of Daniel's. The second, my trying to modify it with the new parameters (which is where I got stuck...seems to be hard-coded to the XZ plane). And the third, just a visual representation of the simplest (and most ideal?) form.

Thanks for any help you can provide!

Cheers,

Will

Views: 6745

Attachments:

Replies to This Discussion

I analyzed parts of it with WolframAlpha and it was promising.

Please see the attached documents. It might help. I unfortunately did'nt have the time yet to completly realize it in Grasshopper.- And one more, unfortunately in German. But I think you will be able to read the formulas. Good Luck!

Sorry! The first one is the same as before. See also: http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/Projekte/Ketten...

(catenary = Kettenlinie)

Attachments:

Thanks for your help so far. I wasn't able to get Mateusz's script to work for all points though, so I kept working on my version.

I made excellent progress adapting the code found here to work for this project. Attached is my latest script. It seems to work for all points & directions of gravity except when the points are at equal height (in the reference plane the script creates, not in the world space). In other words, when the vector from A to B is perpendicular to the gravity vector, it doesn't work. It's totally due to the formulas used to solve for distance (see script), but I haven't found a way to fix it to make it work. Kudos to anyone that can help me figure it out!

Other notes: Required input: Point A, Point B, Gravity vector, and desired Height and/or desired chain/arch Length. Cool trick:  when inputting both Height and Length, it recalculates the end point (point B) with those desired parameters, and the end point lies along the AB vector. Also, the "x" output shows either the found height, length, or distance (when both height & length are input), and "newPl" just shows the reference plane used to make calculations easier.

Cheers

Attachments:

Edit: fixed the prior issue of the script not working when points are at equal height, but there are still some glitches at the extreme cases (like when chain length is close to distance between A and B) as well as when both height and length are input (end point doesn't lie along AB vector)

Attachments:

Please take a look again at my .gha script posted in the milkbox. It's actually the same one I posted here, but I managed to resolve most problems (its hundreds time faster in some cases), also it'll work with cases you're talkign about.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service