CH NEO-ZÜRICH EDITION
WEATHER · OVERCAST 12°C
BLEND OF THE DAY · 07/ROGUE
EST. 2027
THE AEC CYBER MORNING NEWS

PAZ Kaffi

DESIGN · DEMOLITION · CAFFEINE · DISPATCH
EDITION 1117 · 17 November 2026
BROADCAST 04:42 CET
2,400 BROADSHEETS PRINTED
READ TIME · 47 MIN
How Many Panel Types Is Your Facade, Really? A 47-Line Grasshopper Component Counts Them
ACADEMY
FRAME · 06:55
17-11-2026

How Many Panel Types Is Your Facade, Really? A 47-Line Grasshopper Component Counts Them

A 47-line Rhino 8 Grasshopper Python 3 component fingerprints facade panels by corner distances and groups them into fabrication types by tolerance.

The fabricator’s first question about an irregular facade is never about the render. It is: how many panel types? Fabricators cut, bend, jig and crate by type, not by panel. That one number decides the moulds, the set-ups and the labels on the pallets. An office that has just pulled a regular grid towards a view, a tree line or a sun angle usually cannot answer it by looking. Two panels 0.2 mm apart look identical on screen. Two panels that look different may be the same piece turned over.

This tutorial builds the answer: one Python 3 Script component in Rhino 8 Grasshopper, 47 lines long. It gives every panel a type letter (A, B, C …), counts the panels in each type, and returns each panel’s centre so the letters can sit on the model. It is written for ordinary flat panels. By the end you should be able to read every line and change it on purpose.

The Tool: The Python 3 Script component that ships with Rhino 8, made by Robert McNeel & Associates. It sits on the Grasshopper canvas (Grasshopper began as David Rutten’s work inside McNeel) and gives you plain Python 3 plus RhinoCommon, the library through which Rhino exposes its geometry. As our PAZ-Rhino piece reported, office scripts can now live directly on the canvas, next to the geometry they read. This script’s output is a number the fabricator will price, which makes it worth an afternoon.

Rhino, Grasshopper, Archicad: who does what

Rhino holds the panel geometry. Grasshopper turns a question about that geometry into a repeatable rule, so the count reruns every time the facade moves. Archicad documents the agreed types as elements, schedules and plans. The type count belongs in the middle, because it changes whenever the design does.

The fingerprint

According to the McNeel forum thread “Identifying unique panels”, opened on 2 May 2023, the question is older than this tutorial but has not aged. User2662 wanted to know “how many unique elements I have on the façade, representing them visually with colour”. magicteddy answered with the whole idea in one line: “You have to extract a number that represents the entire geometry.”

Here that number is a list. Four corners give six distances: four sides and two diagonals. Sort them. A 1500 × 3000 mm rectangle gives 1500, 1500, 3000, 3000, 3354.1, 3354.1. Move it, rotate it 90° or turn it over, and the sorted list stays the same. For ordinary flat panels, the same list means the same shape.

The diagonals do real work. A parallelogram with 1500 and 3000 mm sides has exactly the rectangle’s four side lengths; only its diagonals differ. A fingerprint built from sides alone would call them one type, and the shop would find the difference at the jig. The jig is a very honest reviewer.

Tolerance, done right

No two panels in a real model match to the last decimal, so the comparison needs a tolerance. In the same thread, Toni_Osterlund grouped panels by a code of three rounded angles, noting that “the rounding allows for tolerance in grouping.” Toni_Osterlund reports the results openly: “Rounding with 1 decimal, we get 16 different ones … With maybe a bit too much variation within one group.” And: “Rounding with 2 decimals gets better results, but gives 116 different ones.” From 16 to 116 types with one decimal place: that pair of numbers is the most useful thing in the thread, because it shows how strongly the count depends on the tolerance you choose.

Rounding has one property worth knowing. Snap every value to a 5 mm grid, and two widths 0.2 mm apart, 1502.4 and 1502.6 mm, land on 1500 and 1505. Two types, from a difference no one on site could measure.

So the component compares instead of rounding. Each new panel is checked against the first panel of every type found so far. If every distance is within T of that reference, it joins the type; if not, it starts a new one. In the test below, seven panels gave 3 types by comparison and 4 by rounding to 5 mm, and the 1502.4 / 1502.6 pair is the whole difference. The cost is plain: a type is a radius around its first member, so two panels in one type can differ by up to 2 × T, and the input order decides which panel becomes the reference.

←TODAY: Rhino 8 puts Python 3 on the Grasshopper canvas, and the fabricator’s type count is 47 lines away.
→3012: Facades get repaired panel by panel, and the type letter is how a 25-year-old orders the right replacement.
Fulcrum: One letter is a fabrication fact today and a maintenance record for decades.

Setup: Open Rhino 8 and start Grasshopper. According to McNeel’s scripting guide, you “go to the Maths tab and Script panel and drop a Python 3 Script component onto the canvas.” It starts with inputs x and y and outputs out and a. The first line, #! python 3, is what the guide calls a “language specifier directive”. Double-click the component, paste this and run it:

#! python 3
import math
a = math.dist((0, 0, 0), (1500, 3000, 0))
print(a)   # about 3354.1: the diagonal of a 1500 x 3000 panel

math.dist needs Python 3.8 or later. If this line runs, the main script will too.

First steps:

  1. Rename x to P (check where your Rhino build puts the rename option). Right-click it and set Parameter Access to List Access, so that, in the guide’s words, “all data branches will be treated at the same time”. In the Type Hints submenu, choose Brep.
  2. Rename y to T, type hint float, and plug in a Number Slider at 5.0. In a millimetre model, that means 5 mm.
  3. Zoom in on the component to add outputs L, C, K and N; keep a. Outputs are just variable names the script assigns.
  4. Paste the full script, wire your panel surfaces into P, and read a: a line like “7 panels, 3 types at tolerance 5.0”.

The code, explained:

#! python 3
"""Panel types - Grasshopper (Rhino 8) Python 3 script component.
Inputs : P  panels (Brep, List Access)    T  tolerance, model units (float)
Outputs: L  type per panel   C  panel centres   K  type names
         N  panels per type  a  summary"""
import math
from itertools import combinations
import Rhino.Geometry as rg

def signature(pts):
    """Corner points -> sorted list of all corner-to-corner distances."""
    return sorted(math.dist(p, q) for p, q in combinations(pts, 2))

def same(s1, s2, tol):
    return len(s1) == len(s2) and all(abs(x - y) <= tol for x, y in zip(s1, s2))

def name(i):
    """0 -> A ... 25 -> Z, 26 -> AA"""
    s, i = "", i + 1
    while i:
        i, r = divmod(i - 1, 26)
        s = chr(65 + r) + s
    return s

tol = T if T else 5.0
refs, counts, L, C = [], [], [], []
for brep in P:
    if brep is None:
        L.append("-")
        C.append(None)
        continue
    pts = [(v.X, v.Y, v.Z) for v in brep.DuplicateVertices()]
    C.append(rg.Point3d(*[sum(c) / len(pts) for c in zip(*pts)]))
    sig = signature(pts)
    for i, ref in enumerate(refs):
        if same(sig, ref, tol):
            break
    else:
        refs.append(sig)
        counts.append(0)
        i = len(refs) - 1
    counts[i] += 1
    L.append(name(i))

K = [name(i) for i in range(len(refs))]
N = counts
a = "{} panels, {} types at tolerance {}".format(sum(counts), len(refs), tol)

Lines 1–8 — the contract: The directive selects Python 3. The docstring (the text in triple quotes) lists every input and output, so a colleague opening the component six months later knows what it expects. combinations hands out every pair of items exactly once.

Lines 10–12 — the fingerprint: A function is a named, reusable block of code. signature() measures every pair of corners with math.dist (six pairs for four corners) and sorts the result. The sort makes the list independent of which corner Rhino lists first, which is why rotated copies match.

Lines 14–15 — the comparison: same() first checks both lists have the same length, so a triangle never matches a quad, then that every pair of values is within tol. all() stops at the first failure.

Lines 17–23 — the names: name() counts like spreadsheet columns, so the 27th type is AA. The test printed Z AA AB for 25, 26 and 27.

Lines 25–43 — the loop: A loop repeats its block once per item, here once per panel. An empty input gets “-” and no centre, so every output stays aligned with the input. McNeel’s RhinoCommon reference documents DuplicateVertices() as returning Point3d[]; the corners become plain tuples so the same functions run outside Rhino for testing. The centre is the average of the corners. Then Python’s for … else: the else runs only when the loop finished without break, meaning no existing type matched. The beginner mistake is to indent that else under the if. The component then stops on the very first panel with a NameError: with no types found yet, the inner loop never runs, so i is never set.

Lines 45–47 — the outputs: K holds the type names, N the count per type, a the sentence you paste into an email.

An honest caveat: these results come from plain Python 3.10 with a stand-in for Rhino.Geometry, not from inside Rhino, so do one run on your own canvas before you trust it. The seven panels were a 1500 × 3000 rectangle, a moved copy, a copy rotated 90°, panels 1502.4 and 1502.6 wide, a 1200 × 3000 panel and a 1500 mm-wide parallelogram sheared 300 mm over a 3000 mm height, plus one empty input.

greedy, tol 5 mm : ['A', 'A', 'A', 'A', 'A', 'B', 'C'] -> 3 types
round to 5 mm    : ['A', 'A', 'A', 'A', 'B', 'C', 'D'] -> 4 types
1502.4 vs 1502.6 rounded widths: 1500 1505
name(25), name(26), name(27): Z AA AB

T = 5.0 | L = ['A', 'A', 'A', 'A', 'A', 'B', 'C', '-']
   K = ['A', 'B', 'C'] N = [5, 1, 1]
   7 panels, 3 types at tolerance 5.0
C = [(750,1500,0), (2750,1500,0), (1500,750,0), (751,1500,0),
     (751,1500,0), (600,1500,0), (900,1500,0), None]

The parallelogram is type C. In this test its shear also stretches the long sides to about 3015 mm; rebuilt with sides of exactly 1500 and 3000 mm, it still lands in type C on its diagonals alone.

What it does not see

It measures corners only, so curved or folded panels with the same corners look identical. Mirror images count as one type; if the panel has a front face (a coating, fixings on one side), split them by hand. Members of one type can differ by up to 2 × T, and input order picks the reference. T is in model units: T = 5 means 5 mm only in a millimetre model.

Atelier: For a 12-person studio in Zürich, the type count usually arrives as a surprise from the fabricator, after the facade has been loosened up for good reasons. Teams handing geometry work to scripts and AI assistants need the opposite habit: the office states the count and owns the tolerance behind it. Monday move: add this component to the facade definition and make “types at tolerance T” a fixed line in every panel export to the fabricator.

Hack: Tighten the tolerance until the near-identical widths separate, and predict the letters before you look. Move the slider into T from 5.0 down to 0.1. The 1502.4 and 1502.6 panels should leave type A and get letters of their own, while the moved and rotated copies stay A. The test printed:

# T slider: 5.0 -> 0.1
T = 0.1 | L = ['A', 'A', 'A', 'B', 'C', 'D', 'E', '-']
   K = ['A', 'B', 'C', 'D', 'E'] N = [3, 1, 1, 1, 1]
   7 panels, 5 types at tolerance 0.1

The rotated copy still matches at 0.1 mm: the fingerprint, not the tolerance, catches rotation. To see letters on the model, wire C and L into a native text-tag display component; wire K and N into a Panel to read the schedule.

Learn-it:

Run it on the facade on your screen today, and write the tolerance next to the count before anyone else asks for it.

FILED FROM
CO-SIGNERS
PAZ Academy
CONFIDENCE
HIGH
REPRINTS
© PAZ - PARAMETRIC ACADEMY ZURICH · ALL RIGHTS RESERVED

PAZ Kaffi · multidisciplinary editorial, led by PAZ Academy

⚑ REPORT AN ERROR · SUBMIT A CORRECTION
◂ BACK TO FRONT PAGE · PAZ KAFFI

© 2026 PAZ Academy.