Grasshopper

algorithmic modeling for Rhino

Hello to everyone.

I am trying to create a simulation where:

_a number of points moves according to swarm rules. It is restricted by a bounding area, and it is attracted by a number of other points, being perceived as the basic volumes that receive an intensified amount of movements

_then I want to find out where those movements intensify. I have solved it by trying to find the closest points between all the curves that the initial swarm points generate.

_now the issue is that I want to connect those points were the movement is more intense in a way that they form some kind of nest corridors. I have already tried the mesh triangulation component but it does no good, because the number of connections is not stable. Meaning that if a point is close enough with 5 other points I want it to connect with all of them but if the distance threshold includes only one point then it will have to connect with only one point.BRANCHING%20POINTS.PNG

My goal is something like this https://www.youtube.com/watch?v=WOFJ4RAlbPY, but then again any suggestions, concerning workflow or components or optimization, are always more than welcome. I suppose that my result would be much more easy to achieve through scripting, but I would be more than grateful for some further indications.

Views: 2729

Attachments:

Replies to This Discussion

Hmm ... (are you familiar with C#?)

The "by the book" solution is to write down a recursive (fractal) code that does the "tree" that you are looking for. In fact I had exactly that type of stuff but due to the trad summer crash several similar fractal C# scripts (made just for fun) are lost.

A crude solution MAY be by making a graph (= something out of your nodes and connecting edges) and then applying Dijkstra classic shortest path routing. Pics attached demonstrate that (pts are random, connections are random and cost [i.e. values in a classic adjacency Matrix] is the distance from pt to connected pt.  BTW:node within the red circle is the target node for the shortest routing from all the rest):

Thanks for your quick reply, and I wish you a Happy New Year! I am familiar with C# in general but not familiar with the Rhino libraries it includes. The images you have attached are very close to what I am looking for and seem very interesting. Is there any tutorial available in order to start translating the shortest path algorithm in Rhino commands?

also is it possible that a plugin called SpiderWeb can be of any help?

Well Jo

1. I have no idea what SpiderWeb does.

2. By "tutorial" for translating some shortest path algorithm (classic Dijkstra or the newer ones that are considerably faster: in case that your graph nodes are quite a few, say some millions) you mean writing the C# code? If so ... I'm not aware of anything similar. But in general you can do it by using the Rhino/GH SDK for accessing mostly the "graphical" part of the equation. Obviously the most sensitive part is the adj Matrix "filling" policy.

Note: if you have plans to use the code outside the GH umbrella I would suggest to make it as GH "neutral" as possible.

Apologies for not publishing the code: it's classified strictly as internal.

best, Peter

Peter,

once again thank you for your quick replies. I understand that you can't publish the code. I want to try and implement it myself in C#,after all doing is the best way to learn. I tried to familiarize myself with the Dijkstra algorithm, and my basic question is how to introduce the points and edges of connection ( geometry) as nodes and graph (data). I hope that I will find my way out of it, unless nodes and graphs are some specific types of parameters that C# uses.

Well ... nodes are points and connections are lines. The only thing that you must do is fill the adj Matrix based on a connectivity data tree (pt to pt) whilst using some policy for the adjacency matrix (or double[,] or square tree) values ( say: pt to pt distance or some other ??).

Actually an orthodox Dijkstra algo uses double [,] instead of a matrix ... but a matrix is much more suitable for visualization in the GH environment. 

BTW: all that stuff IS NOT the best way to start learning C# ... but I have a feeling that you are a brave man > I like that more than anything > therefor I MUST give you a hand (or two, he he).

So finally some good news: ping me a friendship request in order to have my e-mail and then ... we can arrange a live Skype session for all these things (BTW: you can see other ultra freaky things as well ... be prepared, he he).

best

Nice script... it would be interesting to check it out.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service