Grasshopper

algorithmic modeling for Rhino

Hi Family,

I know the forum is filled with info on this subject (which I am still searching through) however I have not been able to figure this organizational issue out just yet.

Basically I would like to manipulate a part of a group of branches and then merge that back in place into the original Set/List. For example, say I have branches of control points of cells of a grid and I would like to do something with the ones that are inside a circle and then place those edited points back into the original list (replacing its previous values). As you can see in the example some branches aren't affected and thus should preserve its original values while ones that are manipulated vary in the number of items in the branch that are changed. Any help?

HELP.jpg

Views: 1255

Replies to This Discussion

The best and easiest way to perform conditional logic on only some data, is to use the [Sift Pattern] and [Combine Data] components. There two work great together, and you can increase the number of streams by zooming in. Data tree structure is kept intact, as is item order.

Attachments:

The "Sift Pattern" and "Combine Data" are meant for exactly this type of action. Sift splits your list (or in your case, each list in your data tree) into multiple lists according to an index pattern (so in your def replace Dispatch with Sift Pattern). The trick is that it keeps the list order intact by putting null values as placeholders. Then, you perform your operations on the portion of the list you want (say, in your case, those points in the circle). Then just plug both streams back into Combine Data, and it eliminates the nulls and puts your data tree back in the same order it started.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service