Grasshopper

algorithmic modeling for Rhino

Hi I am new to Grasshopper but have set myself a difficult challenge.

I have been trying to manipulate some solar data that comes in as azimuth (in degrees) and elevation (also in degrees). The data comes in as a tree branch for each day with a sub-branch for each hour. I want to extract the azimuth and elevation and convert it to points via the <Point Cylindrical> component (after converting to radians) and then place it back into the original tree structure. I think I need this original structure so that I can draw curves between each day's points and have a separate curve for each day.

I know that I can probably be helped in this task by using Ladybug but I didn't have Rhino 5 when I started and now I am a bit consumed by the challenge and interested in the more generic problem of what to do when you need to flatten a tree to manipulate the data but then need to put that manipulated data back into the original structure.

To that end, I put together a more generic... what do you call them... sketch. I just generate a grid of points, flatten it and then try to reconstitute the tree. As you will see the <Consecutive Domain> output feeding into a <sub List> component causes duplicate entries in my final tree because it it creates domains that are "0 to 6", "6 to 12", etc.

So finally my question, how do you flatten a tree, manipulate the data and then put it back into the original tree structure?

reconstitute.gh

Views: 4764

Attachments:

Replies to This Discussion

Charles, there is an Unflatten Tree component in the Tree menu. It uses the original tree as a guide.

huh, whats the difference between Unflatten and Match Tree? (never thought to use the former before)

I dunno, here it saves a step. In general though, Match doesn't make any assumptions about the structure of the guide tree.



So long as you're not changing the tree structure, just use <Match Tree>, graft all its inputs and then <Trim Tree> to arrive at the original tree structure.

An alternative method might be to use copious <Replace Items>, but that's more case-by-case.

ah, also, grasshopper definitions, sketches are processing :)

Attachments:

Thank you Ethan and Vongswat. And thank you to the developers of Grasshopper!

Neither <Match Tree> nor <Unflatten Tree> were in my antiquated Grasshopper 0.9.0014 that ran on Rhino 4. It did feel like something important was missing. So glad that I was able to upgrade yesterday!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service