BIM World
A Professional BIM Learning Platform


BIM Q&A: Understanding Grasshopper's Data Operation Rules Explained

This article is from the official account: ACND STUDIO

Overview

This article explains the basic operational rules of Grasshopper by exploring how multiple data sets and their relationships work together.

Required Software: Grasshopper

Data Categories

BIM Q&A | Understanding Grasshopper's data operation rules

In general, data types can be divided into two categories: single data on the left side of the graph, and tree data on the right side. To the right of the dark-striped column at the top of the list, you’ll find a path for each data set, such as {0;0} or {0;0;0}. This path helps distinguish how many data groups exist in the list. Essentially, a list with only one data group is considered single data, while multiple groups form tree data. While these are just labels, understanding their meaning is key.

Calculations with Single Data Lists

BIM Q&A | Understanding Grasshopper's data operation rules

When two lists each contain a single data set and are operated on, there is a one-to-one correspondence between their items. For example, the item at index 0 in the upper list corresponds to the item at index 0 in the lower list, and so forth, resulting in the list shown on the right.

BIM Q&A | Understanding Grasshopper's data operation rules

When the two lists differ in length, the first items (indexes 0–4) still correspond one-to-one as usual. However, for indexes 5–9 in the longer list, the last item in the shorter list is repeated to complete the operation.

Calculations with Multiple Data Groups

BIM Q&A | Understanding Grasshopper's data operation rules

The calculation method for two data lists with multiple groups is similar. When both lists have the same number of groups, each group corresponds directly to the matching group in the other list for calculation.

BIM Q&A | Understanding Grasshopper's data operation rules

When the number of groups differs between two lists, the calculation follows the same logic as with single data lists. The groups in the longer list that exceed the shorter list’s count will be calculated using the last group of the shorter list.

Calculations Between Multiple Groups and Single Data

BIM Q&A | Understanding Grasshopper's data operation rules

If one list contains multiple groups and the other only a single group, each group in the multi-group list operates separately with the single group. Note that groups within the multi-group list do not influence each other.

BIM Q&A | Understanding Grasshopper's data operation rules

When each group contains multiple data items, the external operations between each group and the single data group remain the same. Internal operations within each group follow the previously mentioned rules, including handling any excess data in longer lists and using the last item in shorter lists.

Data Merging

BIM Q&A | Understanding Grasshopper's data operation rules

The most common way to merge two data sets is by using the merge operator (or shift-select). However, it’s crucial to consider how the merged data matches between the two sets. The sequence number of each array must be consistent for the data to be grouped together. As shown in the figure, the data from the upper and lower lists merge into one group because their list numbers match, arranged according to input terminals D1 and D2.

BIM Q&A | Understanding Grasshopper's data operation rules

If the group numbers differ between the two data lists, the merged result will only place the corresponding groups together in a larger list, without merging within those groups. The order is always determined by the shorter path appearing first. For example, even though the list {0;0} is connected to D2, it still appears at the front of the merged list.

BIM Q&A | Understanding Grasshopper's data operation rules

Of course, you can unify paths using simplify and flatten. However, you’ll notice that only data with matching path names merge on the right, while the rest remain unchanged.

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » BIM Q&A: Understanding Grasshopper's Data Operation Rules Explained

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up