Grasshopper

algorithmic modeling for Rhino

I'm trying to clean-up some files, and there are a few workarounds that I've developed that I suspect can replaced with cleaner arrangements. Perhaps the dumbest one is my method for preserving paths when retrieving items from trees.

The goal is to retrieve the Nth item from each branch, while leaving the paths intact. (The alternate way of looking at it is that I'm trying to strip away everything except for nth item.) Here's my set-up using a very simple example tree:

  1. This example tree has two items on each of four branches.
  2. The Tree Item component retrieves the [second] item from each branch.
  3. The List Length component creates a tree with the same branch configuration but only one item on each branch. (The content of those items is not relevant.)
  4. The Unflatten Tree component takes the flat, four-item list from Tree Item and maps it to the branch configuration generated by List Length.

Is there a smarter, cleaner way of generating the same result?

Views: 1016

Replies to This Discussion

Hi James, I think in your case the List Item component will suffice.

Thanks. I knew it had to be that simple. My workflow uses the Tree Branch component frequently and that component has a Maintain Paths option, so the asymmetry threw me.

:) I get that sometimes too, we got to take more breaks.

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