Grasshopper

algorithmic modeling for Rhino

# Choose possible indexes

Hi Everyone

I'm trying to make an algorithm which gives out possible combination of indexes

for example we have

0

1

2

3

now I want to have these as groups

{0}

0

{1}

1

{2}

2

{3}

3

{4}

0,1

{5}

0,2

{6}

0,3

{7}

1,2

{8}

1,3

{9}

2,3

{10}

0,1,2

{11}

0,1,3

{12}

0,2,3

{13}

1,2,3

{14}

0,1,2,3

I want it to be parametric so I can have it for any set of indexes

I have tried to solve it with points and then removing duplicate points but it's not helping much

any help is truly appreciated

Views: 203

### Replies to This Discussion

I don't understand your image, but the algorithm you're looking for is a recursive algorithm to calculate the "Power Set". The Power Set is the set of all subsets of {0,1,2,3}.

https://en.wikipedia.org/wiki/Power_set

by jodyc111

• Add Photos
• View All

## Videos

• ### Modeling Kisefos Museum by BIG in Grasshopper

Added by Dusan Cvetkovic

• ### Modeling 79B and Park by BIG in Grasshopper

Added by Dusan Cvetkovic

• ### Lofting Geometry in Grasshopper

Added by Dusan Cvetkovic

• Add Videos
• View All

© 2019   Created by Scott Davidson.   Powered by