Grasshopper

algorithmic modeling for Rhino

Hey guys,

I don't know if this has been posted before, but is there a way to sorta sub-branch a list based on custom attributes or laws (defined by the user)?

In my case I have a list of points (a 3D population; flattened) that I want to group based on vicinity. The result I want is a tree which has x branches each containing the points that are in a vicinity or say neighborhood (the points in each branch have a maximum defined distance from each other). My question might be novice but who said I was pro?

I'd be happy to get some help here. Thank you.
Sina

Views: 1204

Replies to This Discussion

It has been done in gh, usually via loops, scripts, or plug-ins. Essentially, it is what you are describing, clustered via iterative optimization. Check this article which explains it in a really quick way. 

https://luckytoilet.wordpress.com/2010/07/14/the-proggit-bacon-chal...

If I recall correctly anemone has a K-Means clustering example file.

I've read this too, and since then I'm trying to think of a scripting idea somehow. There's also a plug-in named "Ivy" that I haven't been able to use for working with points. It has K-Means but seemingly it's only designed for meshes.

Yes Ivy is for meshes. Check the Anemone example files. If not the logic is quite simple to make with anemone after a read of the logic from those articles, try reconstructing the logic of that loop. (I dont have time to use GH at the moment)

Thank you so much for your help and consideration Michael. I think (and certainly hope :D) that I can do this with Anemone.  I'll keep you updated if any kind of success is achieved.

Anemone's a good idea I think. Trying to optimize the seed values does not actually help. I've tried this before but since the Seed Values' result are totally random without any sort of coherence or order, the Evolutionary Algorithm fails to achieve an optimal result through gene production as the algorithm goes on.

K-Means is the answer I think but it needs high level scripting which I am certainly not able to do at this stage. There's a VB Script done by someone in this tread but it is in 2D like the definition of yours. My Points are a 3D population.

Thanks again for your reply Joseph.

Well, mine works in 3d, but it is not the clustering you are looking for, and I haven't tried that script. Making it work in 3d should not be hard as the bases is still distance.

Try using K-Means++

Awesome!

Not really, Proximity 3d finds the closest (x) amount of points to each point and gives you a topology map of connecting links. What you're trying to do has a name - K-Means clustering , look here & here 

I read this tread today alongside the Wikipedia content Michael. It was a really great piece of Information, thanks for that. As mentioned in my Case, the points are "3D Populated". This one's a 2D K-Means Clustering with Convex Hull, when I input my spatial points, the Convex Hull becomes somehow chaotic, would you mind take a look at it?

look here & here

Well, yeah!  Good answer, thanks Michael.

Joseph, take a look at this one too ;)

Hey Guys,

Just to inform you about K-Means, I want to mention that the algorithm starts the calculation based on a random start phase. So as you know the result is not always perfectly optimized but instead it's a relatively good one, also meaning that every time the algorithm restarts, it is more than possible that it returns a new (different) result.

P.S. Michael - I could not find the K-Means in Anemone Example files, there's only version 0.26 tutorial files on food4rhino. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service