Grasshopper

generative modeling for Rhino

Hi guys,

I am trying to separate a list of objects in order to edit them further on. I have use the dispatch but it seems that is failing to read the information. Anyone know how it could work.

There are 50 member in total where should be seperate in two groups:

a) Contain surface 0,2,4,6 etc

b) contain surfaces  1,3,5,7 etc

I have uploaded the definition.

Tags: dispatch

Views: 231

Attachments:

Reply to This

Replies to This Discussion

You are overcomplicating the use of the dispatch component. A simple True/False will suffice.

Otherwise you could use a Modulo 2 expression to get a 010101010101..... pattern.

But I'm afraid your reasoning behind using the equality component to test for even numbers is flawed because of the data matching used by gh. It is testing like this:

0==0 True

2==1 False

4==2 False

6==3 False

etc

.............

Where as a Modulo 2 would work like this

0%2 = 0

1%2 = 1

2%2 = 0

3%2 = 1

4%2 = 0

5%2 = 1

6%2 = 0

7%2 = 1

8%2 = 0

9%2 = 1

......

Also I notice you have some errors in your expressions producing Nulls.

If you want it to be twice the value then you should have 2*D in the Expression and 10*D in the other

....

I attach a working version.

Attachments:

Now I understand clearly. Many thanks Danny :)

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service