generative modeling for Rhino
Hello everyone , I have been trying to sort this out for quite a long time ( since I am a beginner .. and only know the really basic stuff..)
The problem is that I have many points on a surface that I want to group in pairs , but in a way that the selection of the points in each pair happens in a random way , and with the restriction that the distance of the points that belong to the same pair is not bigger than the one I give. If anyone has an idea how this can happen please HELP, because I have tried so many things but haven't been able to come to a result.
And also, it would help me a lot if I could define the number of random points in each group ( lets say instead of making pairs, if I could make triads of points ) with the same restrictions mentioned above !
beers on me, for the people who help me out !!! thnx
Tags:
Permalink Reply by Hannes Löschke on February 29, 2012 at 5:09am I tried to get my head around this but got stuck on the part where you need to ensure that each point is used only once.
While this is pretty easy for an iterative script, it seems pretty much impossible to do with native GH logic. (at least without a complex definition)
Permalink Reply by David Stasiuk on February 29, 2012 at 6:28am I agree with Hannes that you're pretty much going to have to script this. You're introducing feedback loops that are dependent on distance restriction and points only being used once. If you eliminate either of those constraints, it's pretty easy to do. But with them, you need to iteratively exclude points, and to do that, you'll want to run a loop.
That said, even with a script, you're going to have to trick it into getting it so that every single point is assigned into a group. When your loop gets to the end, for example, and all but two (or three or four or whatever) points have been assigned, there's a good chance that the leftovers will fail the maximum distance constraint...in which case, you'll either have to live with a few points not having partners, or you'll have to optimize it so that your points swap assignments. This gets complex, too.
Permalink Reply by Systemiq on February 29, 2012 at 8:01am You could probably adapt this.
That wont solve the problem with leftovers though.
Permalink Reply by DIMITRIS VENIZELOS on March 2, 2012 at 1:16pm Hello again , leftovers are not a problem , since there is no need for a fixed number of points , thus if some of them are excluded from the grouping, it doesn't really matter . I didn't understand your suggestion though .. your link contains something more than the pictures? i guess i cant see it . if you have the patience to explain a bit , I would really appreciate it ... thnx in advance
Permalink Reply by Systemiq on March 2, 2012 at 3:34pm Look in the comments below the image.
This definition was done to connect any number of points, with a specified max number of connections and connecting the closest points first.
Permalink Reply by DIMITRIS VENIZELOS on March 3, 2012 at 4:09am thank you sooo much !
Permalink Reply by DIMITRIS VENIZELOS on March 6, 2012 at 10:39am hey , I am going to bother you again , sorry for that.. My grasshopper is more recent than the edition you have used to build your suggestion , and when i try to open it with my grasshopper, some definitions disappear and some connections fail .. is there any chance that you can printscreen it for me so that i can fix mine?
Permalink Reply by DIMITRIS VENIZELOS on March 6, 2012 at 5:08pm But i am pretty sure that I have installed hoopsnake
I am uploading a printscreen , to explain the problem .. if you have a couple of minutes please take a look .. thnx
Permalink Reply by Systemiq on March 6, 2012 at 5:39pm Ahh I see, the component missing is RemoveDuplicatePoints, from Kangaroo.
It is not really needed, just plug the output of Point XYZ to the input of Point.
Set the Slider to 1 to get a list of lines, your pairs are simply then end points of these lines. To get triads etc, the def needs to be modified to draw polylines. I think its the simplest way.
In this screenshot you can see the leftovers effect:
Permalink Reply by DIMITRIS VENIZELOS on March 6, 2012 at 7:21pm you are awsome ! thnx
have a good night
Added by David Stasiuk 8 Comments 22 Likes
Added by stefano 5 Comments 7 Likes
© 2013 Created by Scott Davidson.
Powered by