Grasshopper

algorithmic modeling for Rhino

Hi,

could it be that it isn't possible to cull even or odd rows with the "normal" grasshopper components?

For example, I have this in one list:
{0;0;0;0;0}
{0;0;0;1;0}
{0;0;0;2;0} ...
{0;0;1;0;0}
{0;0;1;1;0}
{0;0;1;2;0} ...
{0;0;2;0;0}
{0;0;2;1;0}
{0;0;2;2;0} ...
{0;0;3;0;0}
{0;0;3;1;0}
{0;0;3;2;0} ...
...

and I would like to have this in two lists separated:

{0;0;0;0;0}
{0;0;0;1;0}
{0;0;0;2;0} ...
{0;0;2;0;0}
{0;0;2;1;0}
{0;0;2;2;0} ...
...


{0;0;1;0;0}
{0;0;1;1;0}
{0;0;1;2;0} ...
{0;0;3;0;0}
{0;0;3;1;0}
{0;0;3;2;0} ...
...

How can I do that?

Views: 5352

Replies to This Discussion

I couldn't quite duplicate you branching scheme but this might indicate a method.

 

Chris

Your definition works, but i'm using sqaregrid-component. so i don't get the rows.
Attachments:


the pattern is True False, the slider is an integer slider so 0 or 1 (you could use a boolean switch instead)

If you want the rows I think you just need to insert a flip matrix component after the point component.

 

Chris

Here's a method that will look at the required branch number and identify split accordingly.

The Split String component uses the semi-colon so the first and last items in this list will still have the { or } accodingly. If you need to get to these items then you will need to Replace String for { and then again for }.

So in the example above the branch to cull is the index 1 and then the %2 component gives a boolean pattern to dispatch the relevant branches into separate lists. The Cherries then Clean the Empty Branches out so that only the relevant items are in the correct list. With out this then there will be empty branches for the none required items. 

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