Multiple selection of branches and indices

Hello,
I’m fairly new to grasshoper and I need help selecting elements of a tree.
let me explain.

I have a set of circles and each circle is populated with points.
I also have a list of packets of different random numbers.
I want the number of the number packet to correspond to the number of the selected circle and the numbers in the packets to correspond to the selected indices as in the example.

Now I want to do that for everyone, I can’t do it.

Up.load.your.code

II-3_pavillonaire.gh (21.8 KB)

1 Like

coud you help me ?

Is maintaining the main street number and roundabout exit number important to you, or should the exit zones simply be numbered ascendingly in your tree structure?

I am very confused. How is it that you have not yet already achieved what you set out to do? Or are you having problems creating the static set of points for each circle?

II-3_pavillonaire.gh (53.7 KB)

thank you very much for unblocking me!
as I said I’m a beginner that’s why

in fact I didn’t yet know about graft, simplify tree and round

No problem. I just wasn’t sure that I was understanding your question correctly.

You also need to be careful of this:

Since 51 or any number 5*n+1 will result in an ending branch with a list length of one, the Nurb Curve component will get upset because it cannot create a curve with just a point. The easiest solution is probably to multiply the slider by the number you divide by, and make sure that the curve degree is at least one less than the multiplication factor:

Yeah. All of these can be found with a right-click at most in-/outputs, although they do also exist as components themselves.

What I showed at the end is also is not the most straight-forward way of doing things.

As you probably know, you can use the list of rational numbers as indices. They will be rounded by an input that takes them. I was just showing what was happening explicitly. Also, culling and then finding set difference was to show you the data trees of selected and unselected points. You can use the List Item component to get the selected points. Probably better, since I am not sure if the Populate Geometry component create unique values.

If you simplify and graft your tree structure–here at its earliest creation point at “Sorties Rond Point”:

your branch hierarchy reflects: {major street #; roundabout #; roundabout exit#}

You can use this data structure as a guide for the Match Tree component with the selected points list to reestablish order:

For this component, the content of the lists, both in value type and the list length, are irrelevant. Simply the number of lists (or the number of tree branches) must be the same.

You can then use this snippet:

to address a specific point, which simplified as a cluster:

looks much cleaner.

II-3_pavillonaire.gh (40.6 KB)

thank you very much, thanks to you I learn a lot of things! I will think about your techniques for the rest! Jeanne

jI still have a question about this step,
Does it work well like this:
for the points of the first output zone, selection of the elements whose index is in the first branch, for the points of the second zone, selection of the points whose index is in the second branch,… ?
![Capture d’écran 2024-06-04 080829|567x500]


merci encore !

(upload://tv5WRASh8rxY0hBGYbFoNn6NRAA.png)

I don’t understand your question. However, I feel as though you don’t understand how components match tree structures across their inputs.

Here is an example of the List Item component attempting to match a List tree against an Indices tree of different branch number:

You do not have to concern yourself with the list creation grouped to the left.

We have a List tree (A) with 2 branches and an Indices tree (B) with 3 branches. The List Item component will try to match the branches of the List tree (A) with the branches of the Indices tree (B) sequentially. So from A, {0;0;0} will be matched against {0;0} from B. Then {0;0;1} from A will be matched against {0;1} from B… When the List Item component tries to find a 3rd branch in A to match against {0;2} in B, it will realize there is none. So what does it do? It repeats the last branch of A {0;0;1} to have something to match against B {0;2}.

This is how it always works. Notice that the exact branch hierarchy is of no interest to components when attempting to match tree structures across their inputs. That {0;0;0} of A has a branch depth one greater than {0;0} of B doesn’t matter. It also doesn’t matter that A was the tree with less branches. If B had less branches, it would have been extended to match A.

This explains then, how a list is matched against a tree of indices.

It’s not that the List Item component always uses a tree of indices to create a set of results from a single list provided to the List input. What is actually happening, is that the List Item component is trying to find matching branches for the indices {0;0}, {0;1}, {0;2} of the indices input (B) in A, and failing to do so is repeating the {0;0} from A over and over.

C’est adorable, merci bien je comprends mieux !!!
Jeanne

Glad I could help.