GH
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
Grasshopper Definition Preview.
At a glance
| Original creator | David Rutten, Robert McNeel & Associates (Grasshopper) |
| First published | 2007 |
| Purpose | A Grasshopper definition: a visual program of components and wires that drives geometry in Rhinoceros, stored as a compressed binary archive. |
| Extensions | .gh |
| Poka parser | poka-gh |
| Viewer | poka-tree-viewer |
| Depth tier | Parser with a shared viewer (see Depth tiers) |
| Breadth tier | B2 Broad (see Breadth tiers) |
How much Poka reads
B2 Broad. The common content of the current and the common older versions is decoded. Some named features or versions are not, and are listed.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-16: parsers/poka-gh/src/lib.rs (raw-deflate GH_IO chunk reader, definition model, wires, tree), graph.rs (canvas SVG), detail.rs (flags, scripts, groups, scribbles, stored values), components.rs and builtin.rs tables, and tests/samples.rs over 3 small corpus .gh files (3 to 7 KB). The binary layout was worked out from those 3 files alone, and the item types they do not use are read at assumed widths. Cluster documents (embedded archives), groups, scribbles, panels, slider values and script source are decoded. The ribbon category comes from a table of 771 standard components.
What Poka does not read
- internalised geometry and other non-simple stored data (curves, surfaces, meshes) are listed but not decoded
- stored values are summarised only for numbers, integers, booleans, short strings, planes and points
- component-specific settings (for example expression text, slider rounding and domain, preview colours) appear only as raw Data items
- unknown item type codes stop the binary parse; the rest of the file is then lost
- the type codes bytearray, doublearray, decimal and the System.Drawing and Rhino structs are read at assumed widths, with no corpus file checking them
- plug-in components absent from the built-in table show no category and no real component name
- only 3 small binary files tested; older Grasshopper archive versions and very large definitions are unverified
- canvas display and solution settings are not shown
Background
Grasshopper is a visual programming environment inside Rhinoceros 3D, created by David Rutten at Robert McNeel & Associates and first available in September 2007. Wikipedia lists .gh as the binary form and .ghx as the text form. The file is a raw DEFLATE stream holding a tree of typed chunks (GH_IO). McNeel's writer is proprietary and no permissive description of the layout was found, so Poka's reader was worked out from the corpus, with the public type codes from McNeel's API documentation. Poka draws the canvas as a graph and shows the archive as a tree.
Versions
| Version | Identifier | Poka | Note |
|---|---|---|---|
| GH_IO binary archive | Partly read | The layout was worked out from three small corpus files; the type codes for byte arrays, double arrays and the System.Drawing and Rhino structs are read at assumed widths (parsers/poka-gh/src/lib.rs). |
Derived and related formats
- Grasshopper XML definition (
.ghx): Has its own page; poka-ghx reads it into poka-gh's model.
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- flate2 (used; MIT OR Apache-2.0; Rust; https://github.com/rust-lang/flate2-rs)
- bringfire/Rook knowledge/gh/sparse_index.json (reference; MIT; data) — GH component table (GUID to category), pinned at @bc19d4af
- jingcheng-chen/rhinomcp experiments/workflow/gh-reviewed-components.json (reference; MIT; data) — pinned at @70b63a2b; see scripts/gen-gh-components.py
Software that uses it
- McNeel Grasshopper (for Rhino)