Extracting the average or the middle element of a tree

Hello Everyone, I have a tree and I want to extract the middle element (which is a middle point in a coordinate system). From that tree, I used the average to find the average of each branch. I don’t have a specific number of branches so they might vary from one system to another. For simplicity, I have here three branches.

I tried to place a panel in the mask of the Split Tree component. I tried multiple masks and I also tried to use expression component to specify the middle element but it wasn’t successful. Could you please assist me with this? Can I place a variable in the mask? Thank you so much.

Hi,

You could use Tree Statistics and Tree Branch.

MiddleTree.gh (13.3 KB)

Hi magicteddy, thanks a lot! But I want to remove this element from the whole tree that’s why I am using split tree component. In a way this element will go to the positive part and the other elements will go to the negative part. Is there a way I can combine both?

simply connect the output of his list item into your split tree mask input :slight_smile:

1 Like

Thank you Antoine Maes! The problem is that when I place this path in the split tree component, I will retrieve more than one element since this path contains more than one element. I want to remove only this element which is the middle or average point and keep the others!

I don’t get it, could you detail the expected output ?

Just activated the mentalist skills, is this what you want ?
Will only work if the average is indeed part of the initial points tree.

MiddleTree.gh (15.6 KB)

Maybe the point nearest the average point? (minimum distance) But yeah, the definition is inadequate and with no GH / geometry provided so it’s a guessing game. :man_facepalming: