Grasshopper

algorithmic modeling for Rhino

Can someone give me some guidance on how to produce something similar to the attached image? Basically connecting a bunch of circles with arcs without having to draw each one. Thanks

Views: 1240

Attachments:

Replies to This Discussion

This is a classic problem related with how we can visualize an adjacency matrix (AM). Google that in case that you are unfamiliar with similar things.

  • (A) The AM is a way to correlate things: in this case "nodes" representing locations (say: cities, countries, planets or whatever). Each "cell" in the matrix could mean yes/no (if there's a flight FROM <> TO) or could provide "frequency" information as well. Of course a suitable single dimension DataTree (of type: object) can cut the mustard acting as an AM.
  • (B) The big thingy is: by what means can you "interactively" build/manage that tree?
  • (C) Then ... given the topological arrangement of "nodes" you can make your graph either using straight lines or curves based on some "bending" rule (for visual purposes). Further elaborating on the "nodes" (i.e. size of, say, a circle) is obviously easy provided that you know, say, the size/importance of a given "node".

The whole thing is very easy with code (especially step 2).

I see, thanks for the response. I am just getting into rhino and grasshopper so I'm learning on the fly. Any good tutorials or steps or examples that can get me to that basic tree where I can manipulate from there? Thanks

New to the asylum eh?

Well ... I'll try to outline the critical step B as simply as possible:

Imagine something (components, script, whatever) that "feeds" a similar tree: say putting 0 or 1 indicating a flight or no flight. We have a slider that controls branches and another one that controls items (since we are talking about a single dimension tree: "emulating" an AM as explained above, that is).

Each time that a "change" occurs (in any of the 2 sliders) GH re-executes yielding a DataTree that contains the desired 1 or 0 in some List location (a DataTree is a very efficient  way to manage Lists; it's "internal" stuff for GH and NOT the "standard" way for doing this as found in some programming language). Let's name this re-execution: a "cycle".

Data on that Tree are volatile in the sense that each "cycle" yields a full tree with a single value change in some location (i.e. are this city and that city connected by a flight?). 

The problem is that we need to store our previous input(s) and ...er ... hmm ... thus "interactively" feed that tree. So ... for each "cycle" we need to store inputs as persistent data. If we depart from the 0/1 simplicity we need other freaky ways as well (control the equivalent slider based on what the previous accessed value is, blah, blah).

Why? well ... in real-life this AM stuff is provided "as it is" and our task is simply to visualize the relations via some WOW (or not) graph. But here (and for the scope of that as an exercise and/or as a test for the final graph) we need a way to "store" our input on a per "cycle" basis and have the opportunity to see what this means in the resulting graph (aesthetically speaking, for instance).

Since graphs are wild animals ... even if we had a real-life case ... this "interactive" way is a MUST for testing the overall graph "appearance" and the likes.

The good news: All the above are easily achieved via code.

The bad news: If I was you I wouldn't attempt to do that with any other way.

The ugly news: notify if you need a demo on all that freaky/geeky stuff ... but using something (C# code) that could be totally alien to you ... and thus, more or less, utterly useless.

PS: of course you can make a "static" tree with 0/1 and use this as the guideline for the graph connections (lines,curves, cats, dogs etc etc)  ... but it's like attempting to tune a Harley Davidson (avoid at any cost).

best

Thanks, that helps me gain an understanding of how things work. I'll search around to see if I can find anything similar. But yes, if  you have any demos, send them my way. I'd rather learn how everything functions rather that simply drawings lines.

OK, allow me some time to locate the simplest "demo" (out of ~ 500 give or take a few) on that "interactive" matter (the 99.99% of the whole issue) but ... don't tell to anyone ... it wouldn't enlighten you at all ...UNLESS you have serious plans to learn some programming language (a thing that I would highly recommend anyway). 

more soon

OK, here comes the pain:

1. This (obvious for a C# freak) is NOT obvious for a beginner and it would remain as such unless ... see above.

2. I've removed a critical "little" thingy (not apparent on first sight) in order to gradually introduce you into the core of the problem (aka: the rabbit hole).

3. On the left we have a freaky thing that does a "static" Matrix/Data Tree full of 1's. Matrix diagonal cells are 0. BTW: Who's David Rutten? (Google that). Who's the Lord (of Darkness) ? (don't Google that).

4. On the right we have some other stuff. Our goal is to modify "interactively" the values in the Matrix (or the "equivalent" values in a single dimension tree). Values are NOT 0/1 adding some "spice" in the forthcoming Parts that will do the desired graph .

5. So we have 2 sliders (that's obvious) and a 3rd one that controls the new value to be stored in a given Matrix accessed cell (or Item in the DataTree).

6. BUT ...er ... that value should take into consideration the already stored value in a given cell ... meaning that the slider should automatically "reset" itself  "around" the previous stored value in order to allow you to modify things starting ... hmm ... taking into account the previous stored value on that cell.

7. This "minor" (kinda) little thingy would be included in Part 2. The reason for the omission is to give you time to understand ... what this omission means in real life.

8. There's another "minor" thingy removed as well. It will appear again on Part 3.

Moral: freaky things, what else?

more soon.

Attachments:

BTW: Whilst all that may(?) be Nirvana for a C# freak and utterly annoying/confusing/useless for a normal person ... let's break for a moment from flight graphs, adjacency Matrices and other geeky stuff  and talk about another "more obvious" case: here's a visual example that may shed some light on that "interactive" BIG thingy.

1. We have a flat mesh. "Size" of mesh faces is due to a freaky thing known as MeshMachine. 

2. A Physics Engine (Kangaroo 1/2) is used in order to "inflate" upwards the mesh yielding a "vault" type of topology. Either via components (K1) or straight via C# code (K2).  Not a big deal at all: even a kid can do it.

3. "Inflation" without anchors ("fixed" mesh vertices == steady stuff) is kinda a 3rd marriage (avoid: better safe than sorry).

4. 1M Question: by what means can you explicitly define what vertices (on a per vertex basis) to use as anchors?

Answers to: The Lord, District 9, North Pole

Hi Casey,

been speed reading through this discussion, but I think you haven't answered the big question. How do you determine which of the circles ought to be connected together? Is it a random thing? A proximity thing? Do you already have a line diagram showing the connections? Do you want to specify it by hand? Do you have a textfile which describes these connections?

Once we know the what, we can help with the how.

David,

I think that Casey wants to do a classic curved p to p route mapping.

http://gis.stackexchange.com/questions/5204/curved-point-to-point-r...

I understand that, but how is his connectivity data currently stored?

Good question:

I assume in some excel/text file (or he wants a way to make "demo"/scenario(s) data "on-the-fly" for testing the graph appearance/"density"/aesthetics/whatever). 

Anyway in 99.99% of similar cases the whole purpose of similar graphs is rather some WOW aesthetics.

For instance the attached is a very kitsch/naive way to skin the cat.

Attachments:

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