Dispatch list from pattern with null items question

I would like to dispatch a list of points (yellow panel 1)
to match with another list with null items (green panel 2)
my try is in yellow panel 3, and it doesn’t work good…I tried to simplify/graft but it’s still not good…

Actually I want to do that to avoid duplicating all the actions (between panels 1 and 2) and try to clean up a bit my model because it’s starting to be very slow…
I guess there is a way to clean that no ?

I’m a beginner on GH… sorry for this crazy messy file… :grimacing:
Thanks in advance for your help

There is no file or image in your post.

treedom7.gh (46.5 KB)

oups sorry!..

I don’t see any text panels labeled “3”?

SDiff expects both inputs to be “Closed Breps” (solid).


I don’t see any sense in using line segments as the ‘P’ (Pattern) input to Dispatch:

Other than matching patterns in a text panel, I don’t understand what you are trying to do?

treedom8.gh (48.7 KB)
Hi Joseph,
Sorry for this, I uploaded an image on my first post but it seems to be invisible…?
Here is an updated GH file with the named panels (with numbers&colors)
Actually, I want to match patterns in text panels yes :P… but it is to avoid to complexify too much the file because it’s starting to be heavy on my computer. (when I move the parameters as angles or lengths of the branches for example…)
tell me if I’m not clear… :grimacing:

As I already said:

Other than matching patterns in a text panel, I don’t understand what you are trying to do?

I have no interest in just matching patterns without a clear statement of your objective.

Your latest code doesn’t address the other two issues I mentioned either.

Have you used the Profiler to see where the bottleneck is in your code? I see that SDiff takes 10.4 seconds, which is most of it. Disable that until you have the rest of the code sorted out.

Hi Joseph,
thanks and sorry again :slight_smile: what I want to do is a kind of forest with poles and branches on them
with random directions for the branches, (1 by face on each pole, so 4 by pole)
the result should look like that but more dense and contained in a semi sphere volume:

here is my new code trying to adress the other issues you mentionned earlier:

removing the sdiff helps a lot! thanks!
I’m still wondering if I can simplify the code because I will still have to repeat these actions in order to get 4 branches by pole, with other heights, lengths and directions…
also, I didn’t know the “profiler”, how do you use it?
treedom9.gh (49.6 KB)

I’m sorry, I just don’t have the patience to wade through such complex code. So I wrote something much simpler (white group) to replace most of it.

It may well miss some of the details important to you…? But you can change it! :sunglasses:

treedom9_2021May7a.gh (25.9 KB)

You can enable the Profiler using ‘Display | Canvas Widgets | Profiler’.

Two additions:

  1. replaced text panel constant of ‘4’ branches per pole with an integer slider (‘branches’, 2 to 10).
  2. made ‘max_BL’ (max branch length) proportional to pole height (length).

treedom9_2021May7b.gh (26.9 KB)

1 Like

wow! thanks!
I need to look at it in detail during the weekend

This might be amusing? Added SUnion to join each pole to its branches and a ‘Color By’ switch using either ‘Height’ or ‘Volume’ of the solids (Value List, teal group). Note the Profiler benchmark of ~3 seconds for SUnion, so I disabled it and enabled Preview for both Cap Holes components.

treedom9_2021May7c.gh (44.4 KB)

Thanks a lot. It’s impressive how simpler it is the way you wrote it.
I’m still trying to familiarize with the logic of lists and powerful tools like random or evaluate…
now the model is very fluent on my computer :smiley:

I’ve just added two “negative” in order to have branch lengths inversely proportional to their heights

Actually the color is interesting but for now I only need 1 material so it’s already good!
Again thanks a lot for your help :pray: :pray: :pray:

I can’t tell much from a screen shot of your code… Using a negative angle looks harmless but I don’t see any reason for using a negative on the domain component? Negative branch lengths? Maybe that explains why you need the negative rotation angle? It doesn’t look correct to me.

P.S. It would never occur to me to apply Negative to a domain. Did you examine the effect? It reverses the two values and makes them both negative. Definitely NOT the correct way to achieve branch lengths inversely proportional to their heights.


The colors are useful as a data/geometry visualization tool, they are not intended as materials.

Ok… :grin:
I don’t know; I did it and it works so that was ok for me.
I put the first negative component “domain” and the branches were towards the ground like in your screenshot, so I put a negative on the angle and the result looks good…
what would be the good way to make branch lengths inversely proportional to their heigths?
here is the code:
treedom10.gh (24.3 KB)

No, it definitely does not work.