Grasshopper

algorithmic modeling for Rhino

Hello all,

I'm just getting started with using python in Grasshopper. What I'm trying to do is itarating through a list of 3dPoints. These points are devided onto four branches. Each branch has 5 points. I want to shift the points per branch. The amount of places the points should be shifted is linked to the branch they are on. So the 0'th branch shouldn't shift, the 1'th branch should shift one, the 2'nd branch should shift two, etc..

I solved my problem by using three GH components. But I would like to combine these in one python component. The script I expected to do the job is attached. But the outcome of the script has only the last of the branches that is shifted. Is this because with .branch(i) you only can call one branch? 

Any thoughts on how i can iterate through these branches?

Views: 3063

Attachments:

Replies to This Discussion

Hi Steven
You should ues the Datatree,Check the attached file

Attachments:

Thanks Naruto! I'm starting to understand how Datatrees are used in Python:)

If i may add, you can type GrasshopperGetSDKDocumentation in Rhino to get the GH Reference ( GH DataTree detailed ).

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service