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

Simple approach with anemone. It perfroms a simple while loop (while substraction result is positive). You can see the exact height in the panel.

I actually try to get through math behind the catenary curve and find the actual solution, meanwhile I thought that it'll be nice to do it with anemone.

I don't think that it is a straight forward case of Algebra. You have to do it with a solver

After reading some more I think that might be the case...there are so many variables.

You could also get the last two curves and do a weighted interpolation between them to get a very approximate solution.

Mateusz, in my version of anemone (I think it's the last public release) the final two loops output the same object (I had to use the index -3 to get the last but one curve).

That may be possible when you use the data recorder (I didn't test anemone with it), check the "Record Data" in loop end.

Thanks for pointing that out, I actually work now on anemone optimization... checking each step with vs debugger (that ain't easy as there are now 5 different options which gives 32 running modes).

Want to do some beta testing ?

Yes, that's how I originally had it hooked, I switched to Grasshopper data recorder to see if it didn't happen there but still happened.

That's something with your anemone version (0.2), the latest is (0.26) and it should work properly with it (I've done a test, but cant promise).

(I dont really know why I plugged length to d0 input).

I reinstalled it and now it works properly, I probably didn't replace the older version correctly.

You should make it possible to remove D0 in case you just need the counter and a break to terminate the loop.

Sure, I'd like to beta test.

When I try to teach the concept of recursion in the past I've used scripting components, but I'd prefer to use something simpler that people can download. I don't like so much hoopsnake since I find a bit awkward the way wires have to be connected back to the same component. I think people will understand better this idea of two components connected with a wire that brings the information back.

Are there any restrictions on using anemeone? can I use it to teach recursion in a university or academy?

So that's where I know this licence from :)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service