algorithmic modeling for Rhino
Hello, just looking for hopefully some list management help.
I have a list of curves such that a panel reads...
...and I'd like to rearrange the order in which the curve are listed, to something like this:
I hope this makes sense.
Thank in advance for any advice,
is there any logic to the new order? Or is it an arbitrary order?
If the latter, you can use sort to modify the list, you'll need to create a list of number that -when sorted- would result in the desired order.
0 = 0
1 = 1
2 = 6
3 = 7
4 = 8
5 = 9
6 = 12
7 = 13
8 = 2
9 = 3
10 = 4
11 = 5
12 = 10
13 = 11
Where the first number is the index and the second number is the actual sorting key. Then you sort these keys while sorting your curves in parallel using the A input of the Sort component.
Brilliant, thank you so much.
With the list item you have to provide exact integers. Sorting works with floating point numbers as well as integer lists with gaps or even duplicate values. It's just a generally more flexible method, but yes, List Item would work just as well in this case.
And what if I want to do the first option? Because need to loft two groups of curves by pairs but the lists are all mixed up, and what i need is them to recognize that one curve that they intersect
with (if i extrude them) in the Z axe and make a loft between them.
These are the lines and their lists.
And this happens whenever i try to loft and how they tend to connect if i graft it:
How can i re-organize the list like that?
i solved it! Something was wrong with that list, i guess i messed up the code cause i found an older one with the right order so i used it and I grafted the list so the loft could run.
Thank you !