algorithmic modeling for Rhino
I am trying to create a perforation pattern of circles (2"x2" offset grid) on a surface using image sampler to vary the radius of each circle based on the image. On top of that, I am trying to organize the circles so that I only have 4 different radii sizes (1", 3/4", 1/2", 1/4"). This part has been the real challenge for me. I am still pretty new to Grasshopper and am still trying to understand data trees and how they work. Currently, I have the list of radii and have figured out how to test the items in the list using the Include component. If an item falls within a domain, it is true and then I would like to assign a specific radii to that. For example, if I have an item that is .184, it would 'round up' to .25. But once I know it is true, then what? Any help or suggestions are appreciated.
I have attached the .3dm file, .GH file and the image used in the image sampler for evaluation.
Thanks
Tags:
Can not understand this : Bit conflicting here please clear.
using image sampler to vary the radius of each circle
≠ (Not equal to)
I only have 4 different radii sizes (1", 3/4", 1/2", 1/4").
Hi Eric,
this is how I would do it:
In order to avoid multiple components I had to flatten your grid tree and rearrange the points in a new tree based on the radius values (there could possibly be a more lengthy way which would keep the original tree structure but I don't know if there is a need for something like that).
I am not sure I understood the desired values for the radius, so I just used the higher value from each domain. you can easily provide different ones.
cheers,
nikos
ps. the first multiplication component in your definition had lost the B input (I guessed it was 2 and redefined it).
Nikos,
This is perfect. It performed exactly what I needed.
I don't really understand why you simplified and flattened the components, but hopefully I can understand by playing around with it.
One quick question - if I didn't want to Cull any of the five radii (see circled component) and let all five list items be used to generate the circles, what component would I use instead? I tried taking the multiplication results and just inserting them into an Insert Items list component, but that didn't work. Any clarification is icing on the cake for me.
Thanks so much for the help.
Hi Eric,
the 5 numbers on the panel create 4 domains, so afterwards you divide your points into 4 groups. That's why I only kept 4 radius values. If you want 5 different radii then you would need 6 numbers on the panel in order to create 5 groups of points (and would still have to cull one of the radii).
but the [Cull i] component also does one more thing: it grafts and simplifies the output before sending it to the circles' radius input. This is done so that the two inputs of the circle component have the same data structure (and so the first list of points gets the first radius and so on...). So if you want to bypass it you should, at some point, graft and simplify your list. (Seeing this now, I realize it would be better to apply these on the circle input instead.)
Hope I cleared some things and not confuse you more.
nikos
nikos is spot-on, but since I wanted to work through the tree structure for my own sake, I thought I'd share what I did in case it also helps you or others.
1. flattening the tree structure of the points just makes everything more simple. You only care about the location of each point, not that they are arranged in rows and columns or something else.
2. Grafting the Consecutive Domains allows you to check all the values passed to the Includes component against domain. Otherwise, it would test the first three values against the first three domains, then the rest of the values against the fourth domain.
3. Grafting the out put of Cull Item matches the data tree structure of the list of points.
It was a good exercise for me going through this. I hope this additional explanation beyond what nikos already supplied is helpful.
Hi Damon,
thanks for explaining things in a more comprehensive way.
I seem to have one problem with which you might be able to help: when trying to reopen the above file the image sampler is missing and i get this message:
"Missing object chunk in archive. An object could not be found in the document,it will be missing once the file is loaded."
Do you have any idea why this is happening?
or maybe I should start a new topic?
thanks,
nikos
Sorry, it happened to me, too and I don't know why.
i seem to be having the same issue when i open a image stencil file with a image sampler, the same error.
"Missing object chunk in archive. An object could not be found in the document,it will be missing once the file is loaded."
does anyone know why this happens and why the image sampler disappears when the file opens.
yes, it seems to be a known bug: http://www.grasshopper3d.com/forum/topics/image-sampler-disappearin...
Damon,
Thanks for sharing your insights. This is all very helpful. I can't say I understand ALL of this in full, but it will definitely help me expand my GH fluency, and hopefully help others as well.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by