Grasshopper

algorithmic modeling for Rhino

Hi,

I'm relativily new when it comes to working with Grasshopper. I hope you guys can help me with at problem i'm having with my project.

It might be a simpel solution, but i can't figure out how to make a random selection of panels i made with LunchBox.

I already got a random pattern from the imagesampler. The orange is a non-transparent, the colors between orange and white is simi-transparent and white is transparent. So i need to divide the colors into groups, so that i can work on the different types of panels seperately.

Maybe there is an easier way of doing this. I've looked into different ways of doing it. Cull patterns, random, boolean lists, but i can't find a way that works to make my selections.

Best Regards.

Hasse Bové

ps. My file hoogs a lot of memory, so it's a bit hard to work with.

Views: 5929

Attachments:

Replies to This Discussion

Hello

towards the end of your definition you are producing way more panels than needed, because of wrong data matching. have you internalized all the referenced data from rhino viewport? because i am getting nulls when i open the grasshopper file. anyway after creating a curve just to see what you have done,  i get to the point where you definition has 2464 meshed panels. then you input them to area, image sampler and mesh color etc leading to dispatch component that outputs 1.5 million panels, which means you are having wrong data matching. that's why you cant work with the file.

now to the random and color sorting question you can try the following

after you have colored your panels with the use of image sampler you sort the panels according to the color they have and then you partition the list with all the panels with the size according to the colors your image has, in this case ten colors giving a 10 partition size. the loft a had created to show this had 100 panels, that is why the output is 10 lists of panels.

hope that helps

cheers

alex

Hi Alex, 

Thank you very much for the help.

The random selection you made is exactly what i wanted. Is it possible to take the output and randomise this selection. In this way i can have the item selection to be semi-transparent and the new randomized selection of the item to be transparent glass. 

Also if i were to go with the image sampler setup, i have a few problem i the definition you made. when i create a set from the image it returns 2934 different colors. and it only gives an output from the explode tree of 2. 

furthermore, how do i output the different colors to surface selections. In this case i need 3 selection types. 

thanks.

Attachments:

you can try the following

you can see that i added create set after the random creation. this ensures that you don't have same indexes, after the round of numbers which resulted in two or more same numbers, so item listing panels twice or more.the set difference outputs the rest numbers to select the remaining panels.

the colors are not 2934, the panels are. to see how many the colors there are check create set component output. with this image they are ten. to have all items with explode tree you have to right click it and select match outputs. this gives branches of the tree, which means list of panels and not single panels. these outputs are already organized panels by color, since we have sorted the panels synchronously with the colors. so in output 0;0 you have the panels of the first color, in output 0;1 of another colo etc. so you can already select them by color.

cheers

alex

hi Alex,

i can't get my imagesampler to work like the example you made earlier. 

as you can see in the panel by the create set component i get a lot more RGB values than you do. my setup is similar to yours. Also when i press match output it is only the 2 outputs on the image i get.

that depends on what you are sampling and how many center points are being sampled. the size of the partitions is big resulting in two lists only. maybe partition list was not the best approach.

your definition comes with nulls (internalized data bug) so i cant open it to see whats wrong with it.

dumb question, but how do i add a new GH file to this thread? i dont see the insert file buttom. i have link, image,media and text. 

there seems to be an issue with the usual forum functions like replying as a thread instead of this new one each time and also there is no upload. I have reported this to scott

ok, thanks Danny.

Hi alex,

In lack of better options, as i can't upload files right now.

I thought that based on you knowledge, you could see problems just by looking at an image of the definition.

Also when i try to internalise my base curve, it still says one locally defined value.

thanks

 

that would require magic powers, because just from an image of a definition i cant hover my mouse and see data outputs, their structure etc.

when the forum permits file uploading please upload definition and rhino file.

meanwhile you will greatly benefit from studying data matching and data structure, lists and trees, in grasshopper tutorials. its the core of grasshopper and once you get familiar with them you will work easily.

cheers

alex

Hi Alex,

now the forum seems to work again. I have disabled the bitmat, because it makes my file a bit hard to work on. 

Thanks

Attachments:

Hello

like i mentioned in earlier post, you are sampling 5152 mesh centroids and the image sampler outputs 2943 unique colors (number found through create set component). there is nothing wrong with the definition.

so with so many colors it does not make sense to set up color based selection sets. if you still want to work with that bitmap it needs to be processed in a photo editing software, so that the white stripes are completely white and the orange ones completely orange, so that when the the panels are sampled through image sampler you get an output of two colors distributed to the panels. if you want more colors then edit your image accordingly but have in mind that you are after manageable number of colors, that will give you selection sets.

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