Grasshopper

algorithmic modeling for Rhino

Tried, tried and tried again... head melting. help.

Is there a way to shift and wrap paths (like the shift list behaviour)

e.g. where you have this data... {A;B;C}(i)

{0;0;0}N=3

{0;0;1}N=2

{0;0;2}N=5

{0;1;0}N=6

{0;1;1}N=6

{0;1;2}N=5

{0;2;0}N=7

{0;2;1}N=8

{0;2;2}N=9

Can you shift and wrap any of the paths A B or C?

Say if I wanted to shift and wrap B by 1 to get the following...

{0;0;0}N=7

{0;0;1}N=8

{0;0;2}N=9

{0;1;0}N=3

{0;1;1}N=2

{0;1;2}N=5

{0;2;0}N=6

{0;2;1}N=6

{0;2;2}N=5

Views: 5936

Replies to This Discussion

Oh you beauty... I can work with that thanks so much

I found that picture of the path mapper a bit hard to read (the % symbol)... still have no idea ... but % probably means wrap...

So the solution was path mapper  Source {A;B} to  {(path_index + 1) %path_count}

Thanks again

Danny once made quite a good post about the PathMapper. Personally I just don´t like to use it, because its so static. 

Note in the example I posted you would shift the paths by input integers to S of [ShiftList].

I agree too static.

EDIT I've just realised the PathMapper Option does not work even for this but I will leave it here anyway The correct Path Mapper Solution will follow this reply

I have an easy solution for this precise example but it wouldn't work for values of B greater than 2.

Path Mapper:

{A;B;C} --> {A;(B-2)*-1;C}

----------------------------

{0;0;0} --> {0;(0-2)*-1;0} = {0;2;0}

{0;0;1} --> {0;(0-2)*-1;1} = {0;2;1}

{0;0;2} --> {0;(0-2)*-1;2} = {0;2;2}

{0;1;0} --> {0;(1-2)*-1;0} = {0;1;0}

{0;1;1} --> {0;(1-2)*-1;1} = {0;1;1}

{0;1;2} --> {0;(1-2)*-1;2} = {0;1;2}

{0;2;0} --> {0;(2-2)*-1;0} = {0;0;0}

{0;2;1} --> {0;(2-2)*-1;1} = {0;0;1}

{0;2;2} --> {0;(2-2)*-1;2} = {0;0;2}

So the approach I would take is to select the Branches you want in the order you want with [Tree Branch] and then using [Replace Branches] to give them the correct Paths.

{A;B;C} --> {A;If(B<2,B+1,B+1-3);C}

----------------------------

{0;0;0} --> {0;TRUE(0+1);0} = {0;1;0}

{0;0;1} --> {0;TRUE(0+1);1} = {0;1;1}

{0;0;2} --> {0;TRUE(0+1);2} = {0;1;2}

{0;1;0} --> {0;TRUE(1+1);0} = {0;2;0}

{0;1;1} --> {0;TRUE(1+1);1} = {0;2;1}

{0;1;2} --> {0;TRUE(1+1);2} = {0;2;2}

{0;2;0} --> {0;FALSE(2+1-3);0} = {0;0;0}

{0;2;1} --> {0;FALSE(2+1-3);1} = {0;0;1}

{0;2;2} --> {0;FALSE(2+1-3);2} = {0;0;2}

This is what I've done to get what I wanted in the end... slight change in the path mapper to a -1 then needed to shift lists and ... sort of path cull with an explode and entwine missing the first exploded path... This gives me cross link lines between the points on one path level to the next... Thanks for clues

Attachments:

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