# What is the function of these combination: [x]+create set+member index

Hi All.
Could anyone help me to understand these combination shown in the image below

What is the methematical active behind it? It seems diagramatically there is no difference before and after this group of buttons running, and I only understand the purpose for this step is to find correct “index”, but not quite clear why here need this step.
Thanks in advance (24.0 KB)

Set operations are like the union, exception and intersection of elements based on their identity. If in one fruit basket you have an apple, a pear and a banana, and in another basket you have an orange, a pear and a banana, in the union you will not have all these elements together, but an apple, a pear, a banana and an orange, the identities in both collections. In the exception you will have an apple and an orange, the identities in the one collection but no in the other, and in the intersection a pear and a banana, the identities present in both collections. That is more or less the case, I am not sure if that is rigorous, but the idea is that it operates with identities, a value that identifies only one element. They are like arithmetic operations where the value does not matter but it uniqueness.

In that case, you haven’t uploaded the file properly so I’m not sure it makes sense to do that, but Create Set creates a new collection without duplicates, but that changes the amount of elements so the indexing is lost. To recover it, you can use Member Index to have for each element a reference to the position in the collection without duplicates.

1 Like

Hi, Dani.
Thanks for reply!
I will checkout and try to understand first.

20201125triangle pattern tower.gh (24.0 KB)

in simple words:

A -> finds the Point that is center of some given polygons
B -> takes only the Z value of those points
C -> rounds the Z value of those center points to the nearest integer value
D -> creates a set of those rounded Z values (unique values)
E -> creates a “relation” : each rounded Z value (in C) is related to its unique Z value (D)
F -> retrieves some geometries using the relation created at E

this way, with “list item” component at F, you get a “filter” that outputs the input geometries depending on the rounded Z value of their polygon center

looking at your definition, that step is used to find pair of surfaces A and B (that shares the same polygon center Z value) and join them together in brep C

3 Likes

Hi, Inno
Thanks for ur explaination in details!
I will try to understand tmr morning.
thanks a lot!

well explained thanks !

Lunchbox at sim line create different panels (divide them) and he need to merge them to recreate the same panel shape ( in this case triangle), if you search in the forum you find the same problem with different solutions

1 Like

Yes, I should do this, thanks!