Lesson 3.2Lesson 3.2 · Data Trees & List Management
Data Trees Explained
Why one list isn't enough - and how branches and paths keep grouped data organised
The data tree is the single most confusing idea in Grasshopper for a week - and the most liberating one forever after.
Draw a grid of points and you hit it immediately: you have rows and columns, but a flat list can only say 'here are 100 points in a row'. It has lost the one thing you cared about - which points share a row.
The data tree is Grasshopper's answer. It keeps many lists side by side, each on its own labelled branch, so structure survives. Everyone finds it baffling at first because it is genuinely a new idea. Everyone who pushes through finds it is the thing that makes real definitions possible.
Tree = filing cabinet. Drawer = branch (a list). Label on the drawer = path {0;1}. Open the Param Viewer.
The moment one list runs out of room
Here is the exact scene where flat lists fail. You want a grid: 5 columns by 4 rows of points. You could generate 20 points, but the instant they arrive as one list of 20, you have lost the grouping. Which four form a column? Which five form a row? The list can only recite them in a single sequence - it has no way to say 'these belong together, and those belong together'.
You meet the same wall everywhere: divide ten curves and you get points for each, but a flat list of all of them muddles which points came from which curve. Split a floor plate into rooms and you want each room's data kept apart. The problem is always the same shape - you have groups of lists, and a single list is one-dimensional, so it can't hold groups without smearing them together.
You could imagine a 'list of lists', and that is exactly the right instinct. Grasshopper's data tree is that idea made rigorous and, crucially, made addressable - every sub-list gets a name so components can find it, match it, and keep it separate from its neighbours.
Flat list of 20 points can't say 'these 5 are a row'. That loss is the whole reason trees exist.
Branches and paths: the tree, made precise
A data tree is a collection of lists called branches, and every branch has an address called a path. The path is written in curly braces with semicolons: {0}, {1}, or for nested groups {0;1}, {2;0;3}. Each number is one level of grouping - read it like a folder inside a folder inside a folder, with the actual items (the points, curves, numbers) living as a plain list at the end of that path.
So the full address of any single item has two parts: the path names its branch, and an index names its position within that branch's list. The point at path {0;1}, index 2 is 'the third item on the branch grouped under 0 then 1'. Path plus index is the complete coordinate of a piece of data - and once you can say it out loud, trees stop being mysterious.
Think of it as a filing cabinet. The cabinet is the tree. Each drawer is a branch, labelled with its path. Inside each drawer is an ordinary ordered list - the same list you mastered in the last lesson. Nothing new happens inside a branch; a tree is just many of last lesson's lists, filed under names. That is the whole idea, and it really is that simple once the picture lands.
How components grow trees (often without asking)
You rarely build a tree by hand - components create them as a natural by-product of working on many things at once. This is the part that surprises people: the tree appears whether or not you intended it.
The classic case: wire a list of ten curves into Divide Curve. Grasshopper runs the division once per curve, and to keep each curve's points separate it puts them on their own branch - you get a tree with ten branches {0} through {9}, each holding that curve's points. It preserved the grouping for you, automatically. That is the tree doing its job.
Many components deliberately output trees: LunchBox panelling tools hand back a branch per panel row; a surface divided into a UV grid comes back as a tree organised by rows. And some components add a level of nesting whenever they process a list of lists, which is why paths sometimes grow longer than you expected - each pass through a many-in-many-out component can push another number onto the path.
The lesson is not to fear this but to expect it: whenever a component acts once per item of an incoming list, ask yourself whether its output just became a tree. Nine times out of ten it did, and knowing that turns 'why is my data weird?' into 'ah, of course - it branched'.
There's a reassuring corollary. Because branching happens for a reason - to keep separate things separate - the structure a component gives you is usually the structure you'd have wanted anyway. The ten branches from ten curves aren't clutter; they're the software refusing to lose track of which point belongs to which curve. So rather than fighting the tree the instant it appears, read it first and ask whether its grouping already matches your intent. Very often it does, and you can simply carry on.
10 curves -> Divide -> 10 branches. The component branched the data to keep each curve's points apart.
Reading the Param Viewer without fear
You cannot manage what you cannot see, so the most important skill in this whole module is reading a tree - and the tool for it is the Param Viewer. Wire any output into it and it draws the tree two ways: a text list of every path with the item count on each branch, and a little diagram of the branching structure. It is the X-ray that turns invisible structure visible.
Learn to read three things off it. First, how many branches - is it one branch (really just a list) or many? Second, the path pattern - do the paths read {0}, {1}, {2} (one level) or {0;0}, {0;1} (nested), and does that match the grouping you intended? Third, the item count per branch - the Param Viewer (in text mode) shows N beside each path, and a stream of, say, four branches of three items each is a very different animal from one branch of twelve.
Pair it with a plain Panel, which shows the actual values grouped by path, and you have full visibility: the Param Viewer tells you the shape of the data, the Panel tells you the contents. When a definition misbehaves - and it will - your first move is never to rewire in a panic. It is to drop a Param Viewer on the suspect wire and simply look. Almost every tree problem announces itself plainly the moment you read the structure.
The mental model to keep forever
Before you move on, lock in the picture, because the people who stay comfortable with trees are the ones who carry one clear analogy and refuse to overcomplicate it.
The analogy: a tree is a filing cabinet, a branch is a drawer labelled with its path, and inside each drawer is an ordinary list - the same indexed list from the last lesson, nothing more exotic. Everything you can do to a list, you can do inside a branch; the tree just holds many of them side by side, each addressable by name. When a component 'works on a tree', it usually opens each drawer, does its job on that drawer's list, and puts the results back on a matching branch. Once you believe that, trees stop being a separate mysterious topic and become 'lists, but organised'.
Two working habits make the model pay off. First, always know your data's shape - a single number, a list, or a tree - because most confusion comes from thinking you have one when you have another. A quick Param Viewer answers it instantly. Second, respect the grouping: if the branches mean something (each floor, each room, each curve), keep them until you're truly done with that meaning. Beginners reflexively Flatten everything to 'make it simple', and in doing so throw away the exact structure that was keeping their design organised - then wonder why the next step scrambles floors together.
The emotional truth of this lesson is that trees feel hard for about a week and then feel obvious forever. Almost everyone who gives up on Grasshopper gives up right here; almost everyone who pushes through says the same thing afterwards - oh, that's all it was. Keep the filing-cabinet picture, keep the Param Viewer open, and let it click.
Data tree
A collection of lists (branches), each with a path address
Grasshopper's way of holding grouped data. A tree is just many lists filed under names - nothing new happens inside a branch.
Branch
One list living at a specific path in the tree
Inside a branch it's an ordinary indexed list. A tree with one branch behaves exactly like a plain list.
Path
The address of a branch, written like {0;1}
Each number is a level of grouping. Path names the branch; an index names the item within it. Together they fully address any datum.
Param Viewer
Component that visualises a tree's structure
Shows paths, branch counts and item counts as text or a diagram. Your primary tool for seeing invisible data structure.
Divide Curve (on many curves)
A component that naturally outputs a tree
Fed several curves, it puts each curve's points on its own branch. A clear example of components growing trees automatically.
Workshop — make a tree appear, then read it
The fastest way to understand trees is to _cause_ one and watch it form in the Param Viewer. You'll turn a flat list into a grouped tree and learn to read its shape at a glance.
Rhino + Grasshopper. A Param Viewer and a Panel. A few curves in Rhino to divide.
Goal: create a data tree on purpose and read its structure Inputs: Rhino + Grasshopper; three or more curves drawn in Rhino Time: ~35 minutes
- 1Draw 3 to 5 curves in Rhino. In Grasshopper add a Curve parameter and set it to reference all of them - it now holds a list of curves.
- 2Wire the curves into Divide Curve (count 6) and send the point output into a Param Viewer. Read it: you should see one branch per curve, e.g. {0}, {1}, {2}, each holding 7 points. You just watched a component grow a tree.
- 3Add a Panel on the same output. Confirm the values are grouped by path - each curve's points sit together under their own path header.
- 4Now build a grid deliberately: use a Series for X and another for Y, cross them (you'll formalise this next lesson) into a grid of points, and Param-View the result. Note whether the grouping matches rows or columns.
- 5Write down, for one of your trees: the number of branches, the path of the second branch, and how many items each branch holds. Then predict what the address (path + index) of one specific corner point would be, and verify it with List Item.
You’ll walk away with
A screenshot or sketch of your Param Viewer plus a three-line reading: how many branches, the path notation used, and the full address (path + index) of one point you can identify. Being able to state a datum's address is the proof you can read trees.
Three altitudes on the same idea
Read the band that fits you — or all three.
Trees are how a building keeps its organisation as it computes. Floors as branches, bays within each floor, panels within each bay - the tree lets a single definition operate on a whole tower while never confusing one floor's data for another's. Reading the Param Viewer is how you stay in control of a large model instead of being surprised by it.
Rooms, walls, and repeating modules are naturally grouped data. A tree lets you treat each room, or each run of joinery, as its own branch - patterned or panelled independently, yet driven by one shared logic. When your screen or tiling suddenly produces the wrong grouping, the Param Viewer shows you exactly how the data is filed so you can set it right.
This is the lesson that separates people who bail on Grasshopper from people who go deep. It is confusing for everyone at first - so if it feels hard, you are exactly where you should be. Push through by always visualising the filing-cabinet picture and always opening the Param Viewer. Once trees click, nothing in this course is out of reach.
“Data trees are an advanced, optional feature - I can build real things with plain lists and avoid them.”
Do it yourself
Say the structure out loud before you check.
- 1In your own words, why can't a single flat list describe a grid of rows and columns?
- 2Read this path aloud: {2;0}. What does each number mean?
- 3What two things together give the complete address of one item in a tree?
- 4You divide 8 curves at once. How many branches do you expect, and what holds each one?
- 5Which component do you reach for first when a definition's data 'looks wrong', and what does it show you?
The one line to carry out
Peer-reviewed journals & authoritative standards
- 01Rhino Developer — Grasshopper Data Trees — Robert McNeel & Associates, 2026.
- 02Mode Lab — The Grasshopper Primer (Third Edition) — grasshopperprimer.com (free online edition), 2020.
- 03Grasshopper — Algorithmic modeling for Rhino (official) — Robert McNeel & Associates, 2026.
- 04Rutten, D. — The Guide to Grasshopper (community) — grasshopper3d.com, 2026.
Now you can see the tree. Next comes the day-to-day craft of _changing_ its shape: Graft to split, Flatten to merge, Simplify to tidy - and the data-matching rules that explain the classic 'why did I get 400 lines instead of 20?' surprise. That is Tree Matching & Grafting.
The author
Amogh N P
Architect, interior designer, and creative polymath. Studio Matrx began in his notebooks — his vision of design made honest, useful, and open to everyone. Its Academy is written and taught in his memory, and free, forever.
More about Amogh →