1 MINUTE VEX I
U Attribute On Complex Curves
In this example, we use the 'surfacedist' function to find a point's distance from a target group. For our purposes, "end_pts" represents the group of points at the tip of our tree's branches.
By iterating surfacedist() over each point, we can build a range of distances to this target group, beginning at the furthest edge, and always ending at 0. We can then use a handy trick promoting these values as min/max to detail.
Finally, we use a second wrangle to fit the min/max distances to a 0-1 range; As the u attribute on a series of complex interconnected curves.