Grasshopper

algorithmic modeling for Rhino

Hi all, 

I have a tree with branches(all the same size) and several branches have the same items(but in different order). Id like to know if there was a way to delete the repetitive branches.

Thank you

Views: 1741

Replies to This Discussion

Post your case. If no components based solution could been provided I'll post a simple C# that does that: it works like this simple example (for Trees: get a given branch as List and compare (Except) vs the other Lists - if diffLxLy.Count = 0 remove the branch tested etc etc).

On the other hand ... why not? It could be a good opportunity to lure people to the Dark Side (cookies gratis for everyone, he he).

The first C# is the above primitive example.

The second C# makes a tree by adding "half the times" (kinda) different items and "half the times" (ditto) the same collection of items ... reshuffled (randomly).

Then comes the cavalry ... and saves the Queen.

best

Attachments:

Thanks  a lot, 

your first code was good. 

Tree Sloth could help you with compare list and sort tree components

cheers

alex

Thanks for your help 

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