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: 1176

Replies to This Discussion

Thanks for your fast reply Joseph, but the problem is, I can not go through Michael's way as in his strategy, there should be some defined points as collectors, now If I am going to define the collectors, and then if I change the distance so a point in a vicinity can be collected by two collectors, know what I'm sayin' ?

I'd rather define x (e.g. saying I want 5 colonies of points) and then get the best result based on this logic.

Uh, no, sorry, I don't understand what you're saying or the logic behind it.

In Michael's approach, there are some constant Points that the distance is calculated from (he calls them collectors). So he defines a number of collectors and then does the grouping based on the distance from those set points.

Now what I want to do is to define only a number (x = collectors' count) and a maximum distance, and as result I get those optimal x collectors and the grouped tree.

The reason I think this approach is a better one is that, there can be a situation in which a point has the same distance from two of these collectors for example and so it can attend in both branches.

In this case there will never be two in the same group. If there are two the same distance then it will just pick a group arbitrarily (at least I think, Have not used the definition is a long time). Regardless, what you are looking for is called K-Means clustering. You can find some examples on the forum about it here

Hi Michael,

Thanks for your reply. This is really a great concept I wasn't aware of. I read the Wikipedia content and figured out it is somehow related to the Voronoi theory, but in the Voronoi components we currently have access to in grasshopper, some base points (or collectors as you put it) need to be defined by the user. Do you think the Ivy Plug-in, or this script can help?

I don't want to define the collectors, instead I want to achieve the collectors as an optimal output.

Best,

Sina

I found a component I'd never used called 'VorGroup (Voronoi Groups)'.  Got some insight on how to use it from this thread: http://www.grasshopper3d.com/forum/topics/voronoi-group

And came up with this:

Attachments:

Minor cosmetic improvements. including "Group Stats", gradient color jitter; could easily add max length between points for each group:

Attachments:

Nice job really,

Ich bedanke mich bei dir :D

Hi Joseph,

This is so much appreciated, I hadn't seen it too. You know in this method we've moved forward a lot compared to Michael's "Distance Grouping" definition, but we're still defining collector points (in your gh definition there's a populate 2D with 24 points input that acts like collectors). Michael supposed that K-Means Algorithms can be the Key, but I haven't figured how to work with'em ever since.

Herzlichen Dank

I've found a component named "Proximity 3D". Do you think it is the perfect answer to my question?

'Proximity 3D' still requires a list of "collector points".  As usual, there are a variety of ways to think about the problem but getting the optimum solution is likely to require some trial and error (iteration with Anemone or Galapagos).  For example, using the code I posted (with additional metrics like maximum distance between points in any of the "groups" returned), you could try all the seed values between zero and 1000 and decide which one is optimum, by whatever criteria you believe is most important.

I haven't read the material on "k-means clustering".  Does it describe a method appropriate for GH modeling?

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