Grasshopper

algorithmic modeling for Rhino

Hey guys,..

        I was trying to achieve a range of numbers in a custom graph,.. Is it possible to input a custom curve into a graph,..??
For example,.. I need two hundred integers inbetween 0 to 20,.. but I have a graph in mind about how i want to numbers,..First 100 numbers have to only range between 0-5, then 100-140 number have to gradually increase from 0 - 20 and back 20 - 0, and then 140 - 200 numbers have to again only range from 0-5,..
So basically the graph looks like almost a straight line from 0 - 100, then the graph has to gradually raise till 20 and falls down to 0 inbetween 100-140, and then again it will be a straight line from 140 - 200,..
So is there a way that i can achieve such custom graph in the graphmapper component,..??? I want to achieve movements only in particular regions in the graph, how can i get that,..?

Thanks

Views: 575

Replies to This Discussion

Here's a hack way to go about it that involves actually drawing the curve in the XY plane in Rhino. I am not sure I got the graph exactly as you wanted it but this should give you an idea.

Attachments:
WOW man,... thanks a lot,. this is exactly what I wanted,..
But I have one more Question,.. Is there a way to save this curve or graph in the graphmapper component,.. So that one grasshopper file can be used as a stand alone definition,..I mean in this case, I always need to save this 3dm file also along with GHX file for it to work,..If we can some how feed this curve into the GHX file or customize the graphmapper component, then we don't need to use the 3dm file all the time,..
Is it possible atall,..or is it a dumb question,..!!
Well, it's not possible to do with the Graph Mapper component itself, but it is possible with the setup I posted. It's a little more work if you want to maintain the nice curvature of the line as it's drawn in rhino, but if you don't mind approximating it with all straight segments a simple approach would be to fill in a panel with the coordinates of the curve vertices like this:
0,0,0
100,5,0
120,20,0
140,0,0
200,5,0

and then connect the output of the panel to the vertices input of a polyline. Be sure to uncheck "multiline data" in the panel.

If you really want that soft curvature you could break it up, define the vertices of the straight line segments separately, and then use a bezier span or an interpolate curve for the middle part and join them all together, using the method described above to hard-code the points.

Alternately, you could take the drawn curve, divide it finely, connect the division points to a panel, and then use "stream contents" to output the points to a text file somewhere, which you can read in later in any definition with the read file component to reload the points and feed them to a curve component.

Hope this answers your question!
Cool,.. Thanks a lot,..I will try and see,..

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service