Recently I have been trying to understand lists and data trees. I was doing an exercise and I couldn’t understand something. In short, I wrote my name with curves than I got the bounding box of it, populated the bounding box and I wanted to fill my name with the points. Without grafting the curves (my names letters) it only fills the letter D. I couldn’t get the logic. Why it filled the D first or without grafting and after grafting what was the system of the definition so that it reacted differently. If someone can explain it I would appreciate, also if you know any video that can help me understand trees better I would appreciate.
Hi Arda,
This is not a data tree issue, if there is more than one curve you should use the “point in curves” component instead of the “point in curve” component.
A good way to understand how the component deals with data is to imagine yourself being inside that component and only seeing what data comes in.
Point in Curve has both its inputs as item, meaning : the component is meant to receieve ONE point and ONE curve.
But, as many times in GH, we override that behaviour by giving the component multiple items.
What the component does in this situation is take things step by step, one couple of items at a time.
So your component processes the first point with the first curve. Then the second point with the second curve. And so on until it reaches point #9 for which there is no curve #9. What the component does is to reuse the last curve for all of the remaining points. This is why it appears that only the letter D is processed. Actually, a few points are indeed tested against other letters, but happen to result in a False enclosion so you don’t see them after culling !
Long story short : the weakest data structure is repeated, as many times as necessary, to match the strongest structure.
It you graft the curve input, you implement a difference of structure strength. Component now recieves a tree, which is the strongest structure, and a list. What it does in that situation is the same thing as above : repeat the weakest structure (the list) as many times as necessary to match the strongest structure (the tree). So, each tree branch gets associated with the entire list of points.
Now, taking one step (one branch) at a time, the component is again faced with mismathching strengths : one list (points), and one item (one curve). So, you guessed it, the curve is repeated - and therefore associated to each point.
The result of that is a list of booleans (true/false), that is put in the corresponding branch.
Component does that for all branches which allows you to get, for each curve, the enclosion test for all points, and then cull them accordingly.
If you have a problem that you can state as is : “For each object x, I want to test it/associate it with ALL objects y”… It usually means you have to Graft x and Flatten y.
This reference might be useful.
As a side note here.
You could use Boundary Surfaces tobuild surfaces from the curves, then Populate Geometry to put points on the surfaces.