Interpolate Curve data

I am slooowly getting to grips with grasshopper - I have run into an issue that I kind of think I know what the issue is, but don’t know quite how to describe it to search for a solution

I am trying to create a pattern of curves from an input of a series of lines - array the lines, rebuild them, move the control points then interpolate those points into curves.

3 lines, offset 10 times with 8 control points is 240, and I have 240 movement vectors - it seems to be grouping them correctly into groups of 8, and 10 sets for each of the arrayed curves, but it seems to be only using the same points for each of the line groups, so from lines A, B & C, A1, B1 & C1 are the same, A10, B10 & C10 are the same - it’s only using the first 80 vectors

So I need to do something to the data so it uses the other 160 vectors but I am not sure what exactly that something is.

If anyone could help, or point me in the right direction that would be fantastic.
Thanks, Peter
Array (12.1 KB)

I think it all comes down to the seed values: the amount of points generated is correct, but for each branch you are using the very same 10 seed values (0 to 9) so the rersult of the random values is the same, just repeated

I would use something like this (another Random set to integers only) to generate random seeds to be plugged to the next Random that creates the XY values for the vectors

Array (17.1 KB)

Thank you so much, I had a feeling it was something to do with that data but didn’t quite know what or how to fix it.

Your idea to give it random seeds is quite a neat solution!

Just out of interest - is there a way of getting it to use all the original data instead of just repeating the same sets for each group, or what that would specifically be termed as to search for more information?

what do you mean? :slight_smile:
with the above definition the seeds are not being repeated for each group, they are randomized by the first Random component
you can see the reflection on the curve of a particular seed like this:

for instance seed at branch {x:i} like {0:0} = 7711 generates curve at {0:0} rightmost column → first from the bottom on the top view

or for instance {1:4} would be the following:

how they are sorted depends on the order the initial curves are picked when referencing them to GH (in this case I guess you went right-to-left longest to shorter) and then how you array them (in this case bottom-up with a Y vector of 125 units)

[edit: one important thing depends on the variety of your seeds: I have set the range to 0-to-10000, and I think there’s pretty low probability of having the very same seed picked twice or more with 30 of them… but you can always meke it bigger by adding a 0 to the range]

I think I didn’t understand what you mean :slight_smile:

Sorry for the confusion, I see that your version is generating a seed for each point, I was referring to my original code where it is generating 240 vectors, but repeating the same first 80 for each branch.

My question was with my original - is there a way of structuring it so branch 0 uses 0-79, branch 2 uses 80-159 etc?

I don’t understand what I mean most of the time, so I apologise :smiley:

Thank you so much for taking the time to respond,

1 Like

got it :+1:

yes, consider that A generates a flat list with 30 values and B just partitions a given list into branches with 10 values each:

so you can replace A with whatever you want, also a Serie component as you did initially, with the only “drawback” that to refresh to all new seeds you’ll need to change the Start Serie value to a number that was not already part of the previous serie

this all depends on the amount of Random values that the component is asked to generate: in this case it is set to 8, which means that for each Seed value provided, the Random component is generating a new branch with 8 values in the Range (1 seed → 8 values)

you can get 1 seed → 1 value with Serie using something like this

Array (18.8 KB)

as said before, the only difference you get by using Serie component to generate the seed is that to “entirely refresh” the seeds (in this case 240 values, 0-239) you’ll need to make the Serie Start value C to jump 240 values, otherwise you’ll just be “scrolling”

1 Like

Thank you so much for the detailed response - my approach to learning grasshopper is a bit haphazard as I don’t really need to use it very often, and especially a lot of the data management stuff doesn’t seem to stick, but that’s a really good explanation and seems to make sense!

1 Like