Hi
I made random panel on the curved surface by using Random quad panels (Lunchbox).
My goal was to make the order of panel as shown below image.
In the sorting part, I refered HS_Kim’s script:
I am guessing that the data management of Partition list part is wrong but I couldn’t solve this issue.
Here is my script:
Random Quad Panel.gh (20.0 KB)
Could anyone give advise for this issue?
Thanks in advance.
Wiley
November 26, 2021, 11:48am
2
i would do it like this:
extract the rightmost edge
for each randomised quad, find its centroid and the distance to the rightmost edge
sort all panels in the list (maintain tree structure) using the distance as a key.
If it’s not clear, share your script file so i can show you.
Hi Wiley.
Oh. I forgot to upload my script.
I added my script to my initial post.
I did as your advice but I couldn’t solve it.
Wiley
November 26, 2021, 12:55pm
5
You made it too complicated. See the attached GH file.
There are a couple misconceptions about the tree structure in grasshopper after opening your script.
You don’t need to duplicate data here. if a single item and a list is put together in a cell function, the single item will be parsed every time automatically for each item in the list. same goes for tree. Because the item is a constant parameter.
just use the flatten in the script.
I almost never use the tree statistic and for a beginner I don’t recommend using it. Try to understand the tree structure instead.
Good luck scripting!
Random Quad Panel.gh (16.7 KB)
Hi Wiley,
I appreciate your help but The order of panel is not what I want.
Did I miss something?
Hi HS_Kim,
Thanks a lot.
It works very well. I will try to understand the logic of Create set and Member Index part.
Wiley
November 26, 2021, 1:39pm
8
I am sorry. I didn’t realize the squads are not arranged into trees according to their Z values.
Random Quad Panel.gh (20.7 KB)
Hi Wiley.
Thanks for your updating.
Yes it is working.
I am going to study your script.