Applying creation of inner surfaces to/inside multiple shapes

I am new to grasshopper.

I am able to create surfaces inside of a deconstructed mesh like so:

Here’s the grasshopper file for that: (5.0 KB)

However, I’m having a problem applying the same technique to multiple meshes.

For some reason, when I use the slider, those pots all get different surfaces inside them and its correct; however, when I use a series component, most of the quads just end up in one pot. I’m trying to create about 50 quads inside each pot.

I know that I’m missing something simple, but I don’t know what it is… It has to do with the idea of applying this jitter to each pot, but I don’t know if there’s a “for each” component, or I don’t know the right way to do that in grasshopper.

I’ve attached my grasshopper file here: (19.3 KB)

Then you don’t know if it’s simple or not. Data trees are rarely simple. They can’t be ignored.

If I understand correctly, you’d like to use a different random seed to jitter the points within each container, and it looks like you’re trying to use a series to supply a different seed to each one.

As Joseph suggests somewhat unhelpfully, Data Trees can introduce quite a bit of complexity to a definition. If you aren’t familiar with them, they are basically Grasshopper’s way of managing Lists of Lists. I can see you have “fancy wires” turned on, so you get some help there in visualizing which data in your definition is a single object (single curve), a simple list (double curve), or a data tree (dotted double curve). You have data trees all over the place.

In a data tree, each list is called a “branch” that is labeled with a “path”. The path structure of data trees is probably the trickiest thing to get your head around (it looks quite a bit like a Dictionary with mutable keys). It gets generated automatically based on how any given component transforms data within…it’s always predictable if you know what to look for, but if I tried to go too deep into it, this would be a long post indeed. Luckily, in most cases, having a corresponding number of “branches” going into different inputs results in the alignment of these. But you do have to make sure that your branch count is the same.

In your case, you can just use you initial element generator count (the value was 48 in your definition), and feed that value into your series component. From there, you should “graft” the output of your series component. The “graft” operation converts any simple list into a data tree with a number of branches equal to the list count, and each list having exactly one item in it.

Again, as Joseph says, data trees can be tough to wrap your head around and if you plan on getting into more complex data management in grasshopper, it’s worth hunting down a proper tutorial to engage with them.

1 Like

Hi Dave,

Thanks for the in-depth response.

I’ve actually done a data tree tutorial already. I should probably just do it again because it was a lot to take in. I grafted the jitter, not the series; so, it shows you I know a little, but a little knowledge is a dangerous thing. :stuck_out_tongue:

“If I understand correctly, you’d like to use a different random seed to jitter the points within each container, and it looks like you’re trying to use a series to supply a different seed to each one.” ← well, I’m trying to get like 50 unique surfaces in each pot, like in the image of the cube (that’s my overall goal; imagine 50 of those cubes each with different interior structures).

Again, when I use a slider on that jitter (instead of the series), I see grasshopper creating a completely different surface inside the pot, so I’m just trying to create some kind of command that says spawn 50 different sliders with 50 different values, and I thought that was series.

Am I correct in thinking that I have to get 50 different random numbers somehow in each array in this list (I’m a programmer, so I’m thinking of arrays of arrays here, but not sure how to do that in grasshopper). e.g., shouldn’t it read: 0: 1 7 8 9 etc. then 0: 1 9 3 3, etc.

Right now, there’s only one surface in each pot.

Ah, I see what you’re trying to do

Looks like the main thing you need to tackle is how you’re creating the mesh primitives from each collection of points. In your definition, you have your face definition hard-coded in:

This is only ever going to create a single Quad mesh each time. You’ll have to fix this first. The way I would do it using native components would probably be like this:

Still lots of list and data tree stuff happening, but targeting a different part of the script.

1 Like

I’m going to look into this, but can’t you just run that “make mesh” component 50 times with different vertices? That’s what I did for the cube with the quads inside. (I will study this tonight when I’m off work, the diagram above!).

You could for sure. It’s GH, and there invariably a very wide range of ways to solve any given problem. I think the data tree management would probably be more challenging, and you’d be duplicating a lot of geometry data (all those repeats of each mesh’s vertices just to extract the first four of each).