Grasshopper

algorithmic modeling for Rhino

Hi, : )

 

I'm trying to divide the items from one single list into branches 

and I attempt to do it with path mapper 

so i have 630 items in single list.

and i want to divide them into different branches and each branch has 21 items.

so that there'll be 30 branches.

 

referring back to this discussion.

http://www.grasshopper3d.com/forum/topics/dividing-a-list-into-groups

 

the problem is 

when i put this into a path mapper 

first branch has 11 items

and the last branch has 10 items.

and make 31 branches rather than 30 branches

seems to me it's behaving oddly.. 

 

how can i make this list into

30 branches 

21 items each?

Views: 1366

Attachments:

Replies to This Discussion

I just happen to solve the problem but I don't know how.. 

Could anyone please explain why this happened?

I'm still new at path mapper ... so i'm struggling.. 

Attachments:
{A;B}(i)......... {floor(i/ceiling(item_count/30))}

: ) thanks.. 

could you possibly explain me how come

{A;B}(i) --> {i/21} 

works differently?

/ is divide.

Therefore:

{0;0}(0) --> {0/21} = {0}

{0;0}(1) --> {1/21} = {0.048} = {0}

{0;0}(2) --> {2/21} = {0.095} = {0}

...

{0;0}(10) --> {10/21} = {0.476} = {0}

{0;0}(11) --> {11/21} = {0.524} = {1}

{0;0}(12) --> {12/21} = {0.571} = {1}

...

{0;0}(20) --> {20/21} = {0.952} = {1}

{0;0}(21) --> {21/21} = {1.0} = {1}

{0;0}(22) --> {22/21} = {1.0476} = {1}

...

{0;0}(628) --> {628/21} = {29.905} = {30}

{0;0}(629) --> {629/21} = {29.952} = {30}

 

Where as \ is integer divide. (Which is similar to Floor())

Therefore:

{0;0}(0) --> {0\21} = {0}

{0;0}(1) --> {1\21} = {0}

{0;0}(2) --> {2\21} = {0}

...

{0;0}(10) --> {10\21} = {0}

{0;0}(11) --> {11\21} = {0}

{0;0}(12) --> {12\21} = {0}

...

{0;0}(20) --> {20\21} = {0}

{0;0}(21) --> {21\21} = {1}

{0;0}(22) --> {22\21} = {1}

...

{0;0}(628) --> {628\21} = {29}

{0;0}(629) --> {629\21} = {29}

 

oh!! thanks!!

Now I understand!! :) 

thank you!! :D

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service