Grasshopper

algorithmic modeling for Rhino

Hi all, I can not understand what the component replace branches  does in this case , in particular  the string that I highlighted in image.

Views: 1120

Replies to This Discussion

D = Data to Replace Branches of

S = Branches to Search For

R = Replace found Branches with this

S(0) = *;0

R(0) = 0 

* is a wildcard therefore Find any branches with 0 as the last branch eg {0;0} {1;0} {2;0} {3;0} etc and make them all {0}

S(1) = *;1

R(1) = 1

* is a wildcard therefore Find any branches with 1 as the last branch eg {0;1} {1;1} {2;1} {3;1} etc and make them all {1}

etc etc

thanks now I realized I could also use pathmapper thus: {a, b}> {b}?

Yes you could for this specific case. However, this approach is more dynamic as it doesn't limit itself to 2 levels of branches. It would work just as well for {A;B;C}-->{C} as it does {A;B}-->{B}

An astrix * is a multiple character wildcard it would also find 0;0;0;0;0;0. if you used a question mark ? it would be limited to just that level i.e. {?;0} would only look for {0;0} {1;0} and {?;?;0} would only look for three levels

You could also use shift paths =-1 for this situation instead of the path mapper and replace branches.

so if I understand correctly if I use one Astrix so {*, 0} works well both with 2 levels of branches {a, b} that 3 levels of branches {a, b, c}?

in any case thanks danny, you have clarified many things to me.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service