Grasshopper

algorithmic modeling for Rhino

Data Tree question - simplify tree so that every branch has a distinct path {A}

Ok, I've never asked a question on these forums before so any advice or help would be very much appreciated.

What I'm wondering is how can you simplify a tree structure such that every branch is renumbered by the following logic:

{0;0}  >  {0}

{1:0}  >  {1}

{1:1}  >  {2}

{1:2}  >  {3}

{2:0}  >  {4}

Any help would be great.

Thanks,

James

Views: 887

Replies to This Discussion

Hi James,

You can use the Path Mapper to achieve this. If you have Grasshopper 0.9.0062 or newer you can use the presets in the menu to automatically create this mapping:

The mapping for this is always {?????} -> {path_index}

Where the question marks represent what you actually have. If your input is {0;0}, {0;1}, {0;2}, {1:0}, {1:1} etc. then ????? will be {A;B}

--

David Rutten

david@mcneel.com

David,

Thank you very much for your quick response.  That was exactly what I was after.

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