Grasshopper

algorithmic modeling for Rhino

Hi,

Now, I'm in the face of the matter to rearrange the order of the list of some rectangles I put below.

These rectangle which is red and green one is currently arranged in the order of blue, and I want to change the order of them into red number...

If you know how to rearrange them, would you teach me it.

Best regards,

Best regards,

Views: 7937

Replies to This Discussion

Hi Naoki! Use list item to extract 2 and 3 from original list. Cull item 2 and 3 from original list and then list insert (insert your list item in 4 and 5 indexes). Hope helps. Bests.

Thank you so much for your reply, lucas!

Your way is to replace items one by one, right?

That's good, but do you know how to rearrange items arranged in blue into clockwise from 0 o 7.

I have to operate many similar but little different tasks in the same program after this, that's why I ask you.

So, if you know how to rearrange items into clockwise, teach me again.

Best regards,

If the order of the original rectangles is not known, or if it varies, you can sort the rectangles along a circle generated by their center points:

 

Hi, Jonah! Thank you for your reply and friend request!

I tried to sort rectangles in your way, but something is wrong...

I guess, SortAlongCrv component doesn't work. 8 rectangles are duplicated on a rectangle 0.

Do you know what's wrong? What should I change?

Best

You will need to arrange the rectangles before this definition. This only orders the rectangles in a list. It does not set their positions (nor rotations).

I understood what to do. The problem is almost solved!

I appreciate your helps!

Best thanks

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service