Random point select on a divided edge

Hello,

I’m quite new to grasshopper and i cannot understand what i’m missing in this simple need…
I’m looking to random select one point (from a divided lenght edge) on each edge. Each time i tried, i selected “same” point on all edge.
Is there possible to fix a command on the “last branch” or is it something to try with remapp domain ?
Thanks in advance for your help !

I don’t see any Random component here? Even if you had one, you might need a separate seed value for each branch to avoid repetition.

Thanks for your quick reply.
Yes, i erased it in my previous screenshot. Please find the result here

How can i specify a seed different for each banch ?

Thanks !

Post your GH code and geometry so we can show you rather than describe it.

If all the random numbers are in the same domain, you can generate many random numbers and graft the output.

Ok i think i got it ! Thanks, i randomized the seed with a domain

Hi !
I’m back, a random seed in random was not working, it gave me a pattern…
If you can check on those file what will be the right way to random select a point it will be really nice !
Thanks !
BaseTest.3dm (221.8 KB)
RandomPoint.gh (17.0 KB)

You might be surprised at how boring it is to explain data trees over and over and over… I’m tired of it.

The surface fragment edge you have chosen with List Item is divided by 3 (4 points) so your random numbers are all between 0 and 3. The end points are duplicated by the adjacent edges’ end points. So what are you trying to accomplish with these random points?

Because this would make more sense if you first partition the surface fragments into rows and columns (Flip Matrix will swap them). Then when you get all done you can use the random points to make interpolated curves.

Here is one possibility. Nurbs curves work better than Interpolate for this because they don’t overlap and intersect. Note that curves don’t reach one end because of the edge method, very similar to the problem I mentioned in the other thread.


RandomPoint_2022_Nov3a.gh (10.7 KB)

It takes a lot of time to answer questions like this, and there are many similar questions on this forum.

P.S. This version gets the curves to reach the “top” edge. The yellow group is a little nasty (or clumsy?).


RandomPoint_2022_Nov3b.gh (12.5 KB)


RandomPoint_2022_Nov3bb.gh (18.8 KB)

P.P.S. Is this yellow group more elegant? :man_shrugging:


RandomPoint_2022_Nov3c.gh (21.6 KB)

1 Like

Whaoo !! Thanks a lot for all explanations !
I will study your solution and will work on data trees understanding… i think i missing something on :wink:

Best regards,
Hugues

The reason interpolated curves overlap and intersect is because of the common end points on adjacent curve segments, as mentioned previously. Another way to avoid that is to skip the end points by narrowing the range (domain) of random numbers. Instead of ‘0 To N’, make it ‘1 To N-1’, like this:


RandomPoint_2022_Nov4a.gh (27.1 KB)

Note that this version uses CrvSrf (Curve On Surface) instead of Interpolate, which is very similar but not quite the same.

And if you want the divided surface you originally had, you can split the wavy surface fragments with the isocurves used earlier:

1 Like