Grasshopper

algorithmic modeling for Rhino

How do I generate all 6 possible configuration orders of three different geometries?

Hi there,

I made four geometries in Rhino that could be described as a tower with three cantilevering volumes attached. I want to generate all possible configurations of the three volumes in different orders from bottom to top. There are three pre-set heights: 20,000 / 50,000 / 80,000 (or 20, 50, 80 meters, I'm working in mm).

So if the three cantilevering volumes would be numbered 0,1 and 2, then I'm looking for a way to let Grasshopper generate the following:

A = 20m-position

B = 50m-position

C = 80m-position

(A,B,C):

0,1,2

0,2,1

1,0,2

1,2,0

2,0,1

2,1,0

Attached is wat I have so far, I have only managed to make simple translations per geometry.

Views: 628

Attachments:

Replies to This Discussion

What you're looking for is permutations, for which there is no component directly available. The [Sequence] component generates permutations based on textual characters, but it will create all possible strings, including shorter ones and ones containing the same character more than once.

There is a way to do it in Grasshopper, but it doesn't scale well to larger amounts of elements, as the number of possible permutations quickly gets too large.

What you do is you create a list of three values, say 'a', 'b', and 'c'. You can replace them afterwards with whatever data you want. You jitter this set using a lot of different random seeds. Basically, you need to supply enough different seeds so that all possible permutations occur at least once. I'd say the number of permutations * 5 at the minimum.

Once you have all these permutations you need to remove the ones that are identical. You merge your list of characters into individual text data, use the Create Set component to remove duplicates, Sort the result, and then you can extract the characters again...

As you can see it's quite an involved solution, it might pay to put it in C# code if this is something you need a lot.

Attachments:

Thank you, this brings me closer to what I'm trying to do!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service