Technical Reference · User Object Distribution

Alexandria Library

A component toolkit for parametric design in Rhino 8 and Grasshopper


Abstract

Alexandria Library is a component library for Grasshopper, the visual scripting environment bundled with Rhino 8. It packages GhPython and C# components spanning multiple domains — document management, fabrication, folding and unfolding, geometry utilities, gridding, math and value remapping, pattern generation, signage, and general utility — distributed as Grasshopper User Objects that bridge to source scripts kept in this repository. This document indexes every component by domain, records the installation and script-bridge pipeline, and lists the conventions the library follows.

Introduction

Alexandria Library is a component library for Grasshopper, Rhino 8’s visual scripting environment. Each component is a self-contained GhPython or C# script that addresses one parametric-design problem — gridding a boundary, remapping values, folding a panel, exporting parameters to a CSV file. There is no compiled plugin: every component ships as a Grasshopper User Object, a single .ghuser file installed by dropping it into Grasshopper’s own User Object folder, with no plugin build or Yak package involved.

Each of those User Objects is a thin bridge. It carries only the component’s docstring and ghenv metadata; at solve time it locates this repository on disk and executes the matching scripts/<domain>/*.py file directly. An installed component therefore always runs whatever is currently in scripts/, which makes that folder the single source of truth for every component’s behaviour.

The library spans nine domains, summarised below. Individual component behaviour is documented by domain under Component Reference; the full source is public in the repository.

MetricValue
Components in scripts/44
Domains9
Packaged User Objects (.ghuser)42
Target platformRhino 8

Counted from scripts/ by tools/build.py whenever this page is rebuilt. The packaged count trails the component count because a User Object is written from a live Grasshopper canvas rather than by the build, so a component stays unpackaged until someone runs UserObjMkr against it.

Repository Structure

The repository is organised as follows; paths are given relative to the repository root.

PathContents
scripts/Source of truth — GhPython and C# script components, one file per component, organised by domain. Every installed component executes this code directly; there is nothing else to build.
ui_shells/Auto-generated bridge components, one per scripts/ script, produced by tools/build.py. Each carries a summary of its script’s header plus its ghenv metadata, then locates this repository on disk and executes the real scripts/<domain>/*.py file at solve time.
grasshopper/general/Demo and scratch canvases, plus the Rhino model they reference. Not part of the distribution.
grasshopper/userobjects/The packaged .ghuser User Object files — one per component — that get installed into Rhino’s own User Object folder.
tools/build.py, which regenerates ui_shells/, the component reference and this page’s generated sections from scripts/.
icons/One 24×24 SVG and PNG icon per component, mirroring the scripts/ folders.
documentation/Every written document, in three guides — architecture, user and development — plus the generated component reference, the changelog, and the CSV template the parameter-controller components read.
web/This reference document and its design standards.

Installation

The library is distributed as Grasshopper User Objects, not a compiled plugin, and is installed as follows. The order matters: step four is the one that is easy to miss and the one that produces the only common failure.

  1. Clone or download this repository to a local folder and keep it intact — the folder containing scripts/ and CLAUDE.md must remain in place, since every component locates it at solve time (see step four). Move it later and re-run RepoPath.
  2. Copy every .ghuser file from grasshopper/userobjects/ into Grasshopper’s own User Object folder. Find that folder from Grasshopper’s File > Special Folders > User Object Folder menu — its exact location is OS- and install-specific, so use the menu rather than a hardcoded path.
  3. Restart Rhino, or reload the Grasshopper ribbon. The components appear under the Alexandria tab, grouped into panels by domain: Document, Fabrication, Folding, Geometry, Grid, Math, Pattern, Signage, Utility. Within a panel they are further grouped into sections, separated by a rule.
  4. Drop the RepoPath component onto a canvas, give it the path to the folder cloned in step one, and press its button. It records that path once, for every component on every canvas — so a definition saved anywhere on disk can find the library. Components resolve the library in three ways, and the first that answers wins: the ALEXANDRIA_REPO_ROOT environment variable, the path recorded by RepoPath, then walking up from the open .gh file for a folder holding both scripts/ and CLAUDE.md. A canvas that satisfies none of the three fails at solve time saying so.

Component Reference

Every component follows the header contract recorded in documentation/development.md, and everything below is generated from those headers, so this section cannot drift from the code it documents. The nine domains map one-to-one to a scripts/<domain> folder and to a panel of the Alexandria ribbon; the names beside each domain are its ribbon sections.

Open a domain to see each of its components drawn as a schematic — input ports on the left, the component in the centre, output ports on the right, or a note in place of outputs where the component’s result is a side effect. Ports are listed in the order they must appear on the component, and each port’s type label states its data access: a plain type is item access, “List of” is list access, “Tree of” is tree access.

Document ShowHide

scripts/document7 componentsParameters · Rhino · Files

csv_file
String
update
Boolean
ParamCont1ParamController1
Sets Grasshopper parameters in bulk from a CSV file.
report
List of Strings
count
Integer
csv_file
String
section
String
update
Boolean
ParamCont2ParamController2
Sets Grasshopper parameters in bulk from one section of a CSV file.
report
List of Strings
count
Integer
csv_file
String
section
String
export
Boolean
ParamExpParamExporter
Exports a canvas’s top-level inputs to a CSV file.
report
String
count
Integer
geo
Tree of Geometry
layer_name
List of Strings
layer_colour
List of Colours
replace
Boolean
bake
Boolean
BakeGeoBakeGeometry
Bakes geometry onto a named Rhino layer.
report
List of Strings
count
Integer
layer_name
String
sublayers
Boolean
pull
Boolean
PullLayerGeoPullLayerGeometry
Pulls the geometry off a Rhino layer into Grasshopper.
geo
List of Geometry
name
List of Strings
colour
List of Colours
directory
String
extensions
List of Strings
recursive
Boolean
DirFileDirectoryFile
Lists the files in a folder.
file_name
List of Strings
file_path
List of Strings
folder_name
List of Strings
target_nick
String
obj_name
String
obj_desc
String
category
String
sub_category
String
section
String
icon_path
String
run
Boolean
GenUserObjGenerateUserObj
Packages one canvas component into a Grasshopper User Object.
report
String
path
String
Fabrication ShowHide

scripts/fabrication3 componentsTab Systems

boundary
Curve
fold_width
Number
tab_profile
Curve
tab_spacing
Number
plane
Plane
CustPanTabCustomPanelTabSystem
Builds the fold zones of a sheet metal panel and lines your own tab profile along them.
panel_face
Curve
folds
List of Curves
tabs
List of Curves
fold_lines
List of Curves
tab_count
Integer
boundary
Curve
tab_width
Number
tab_height
Number
tab_space_x
Number
tab_space_y
Number
plane
Plane
FrmTabFrameTabSystem
Cuts the slots a panel’s tabs hook into.
frame_face
Curve
tabs
List of Curves
tab_count
Integer
boundary
Curve
fold_width
Number
tab_width
Number
tab_height
Number
tab_spacing
Number
plane
Plane
PanTabPanelTabSystem
Builds the fold zones and fixing tabs of a sheet metal panel.
panel_face
Curve
folds
List of Curves
tabs
List of Curves
fold_lines
List of Curves
tab_count
Integer
Folding ShowHide

scripts/folding4 componentsFold · Unfold

grid_cells
List of Curves
fold_lines
Tree of Curves
fold_angle
List of Numbers
GridFPlanGridFoldPlanar
Folds flat grid cells up along their crease lines into faceted panels.
folded_cells
Tree of Breps
hinges
Tree of Curves
grid_cells
List of Curves
fold_lines
Tree of Curves
fold_angle
List of Numbers
solid
Boolean
GridFPyraGridFoldPyramid
Folds flat grid cells up into faceted panels, or raises a closed pyramid on each.
folded_cells
Tree of Breps
hinges
Tree of Curves
apex
List of Points
grid_cells
List of Curves
fold_lines
Tree of Curves
fold_angle
List of Numbers
solid
Boolean
GridFWedGridFoldWedge
Folds flat grid cells up along their crease lines, optionally as solid wedges.
folded_cells
Tree of Breps
hinges
Tree of Curves
folded_cells
List of Breps
spacing
Number
GridUnfGridUnfold
Flattens folded geometry into the cut and score lines it is made from.
cut_lines
Tree of Curves
fold_lines
Tree of Curves
bounds
List of Curves
Geometry ShowHide

scripts/geometry3 componentsBounds · Trimming

geo
List of Geometry
plane
Plane
GeoBnd2DGeometryBoundary2D
Measures geometry into a rectangle on a plane of your choosing.
bounds
Curve
center
Point3d
x
Number
y
Number
area
Number
geo
List of Geometry
plane
Plane
GeoBnd3DGeometryBoundary3D
Measures geometry into a box on a plane of your choosing.
bounds
Box
center
Point3d
x
Number
y
Number
z
Number
volume
Number
curves
List of Curves
region
Curve
BndTrimBoundTrim
Trims curves to a region, keeping closed curves closed.
inside
List of Curves
outside
List of Curves
Grid ShowHide

scripts/grid7 componentsCell Grids · Voronoi

boundary
Curve
size_x
Number
size_y
Number
row_shift
Number
plane
Plane
BndBrickGBoundBrickGrid
Fills a region with a running-bond grid of closed rectangular cells.
cells
List of Curves
centers
List of Points
bounds
Curve
cell_x
Number
cell_y
Number
boundary
Curve
size_x
Number
size_y
Number
plane
Plane
BndDiaGBoundDiaGrid
Fills a region with a grid of closed diamond cells.
cells
List of Curves
centers
List of Points
bounds
Curve
cell_x
Number
cell_y
Number
boundary
Curve
size_x
Number
size_y
Number
plane
Plane
BndHexGBoundHexGrid
Fills a region with a grid of closed hexagonal cells.
cells
List of Curves
centers
List of Points
bounds
Curve
cell_x
Number
cell_y
Number
boundary
Curve
size_x
Number
size_y
Number
plane
Plane
BndPanBoundPanel
Fills a region with rectangular panels that leave no offcut.
cells
List of Curves
centers
List of Points
bounds
Curve
count_x
Integer
count_y
Integer
boundary
Curve
size_x
Number
size_y
Number
plane
Plane
BndRectGBoundRectGrid
Fills a region with a grid of closed rectangular cells.
cells
List of Curves
centers
List of Points
bounds
Curve
cell_x
Number
cell_y
Number
boundary
Curve
size_x
Number
size_y
Number
plane
Plane
BndTriGBoundTriGrid
Fills a region with a grid of closed triangular cells.
cells
List of Curves
centers
List of Points
bounds
Curve
cell_x
Number
cell_y
Number
grid_cells
List of Geometry
boundary
Curve
min_eval
Number
max_eval
Number
seed
Integer
VoroGridVoronoiGrid
Scatters one point inside each grid cell and builds a Voronoi pattern from them.
cells
List of Curves
seed_points
List of Points
Math ShowHide

scripts/math8 componentsRemapping · Values

values
List of Numbers
target_a
Number
target_b
Number
source_a
Number
source_b
Number
ValRemapRemapValues
Remaps a list of numbers onto a new domain.
remapped_values
List of Numbers
source_domain
Interval
points
List of Points
curve
Curve
target_a
Number
target_b
Number
source_a
Number
source_b
Number
ValRemapCrvValueRemapCurve
Remaps how far each point sits from an attractor curve onto a new domain.
remapped_values
List of Numbers
distances
List of Numbers
pulled
List of Points
source_domain
Interval
points
List of Points
curves
List of Curves
target_a
Number
target_b
Number
source_a
Number
source_b
Number
ValRemapMultiCrvValueRemapMultipleCurves
Remaps how far each point sits from its nearest attractor curve onto a new domain.
remapped_values
List of Numbers
distances
List of Numbers
pulled
List of Points
closest
List of Integers
source_domain
Interval
points
List of Points
attractors
List of Points
target_a
Number
target_b
Number
source_a
Number
source_b
Number
ValRemapMultiPtValueRemapMultiplePoints
Remaps how far each point sits from its nearest attractor point onto a new domain.
remapped_values
List of Numbers
distances
List of Numbers
closest
List of Integers
source_domain
Interval
points
List of Points
attractor
Point3d
target_a
Number
target_b
Number
source_a
Number
source_b
Number
ValRemapPtValueRemapPoint
Remaps how far each point sits from an attractor point onto a new domain.
remapped_values
List of Numbers
distances
List of Numbers
source_domain
Interval
image_path
String
points
List of Points
frame
Curve
ImgHueImageHue
Reads an image at a set of points and returns brightness and colour.
values
List of Numbers
colours
List of Colours
count
Integer
min_val
Number
max_val
Number
integers
Boolean
seed
Integer
RandValGenRandomValueGenerator
Generates random numbers within a range.
values
List of Numbers
values
List of Numbers
step
Number
mode
Integer
StepRoundStepRounding
Rounds numbers to whole multiples of a step.
stepped_values
List of Numbers
deltas
List of Numbers
Pattern ShowHide

scripts/pattern6 componentsVoronoi · Lattice

grid_cells
List of Curves
inner_scale
Number
eval_outer
Number
eval_inner
Number
point_toggle
List of Booleans
VoroPattGenVoronoiPatternGenerator
Draws a Voronoi pattern inside every grid cell, from points you choose.
pattern_cells
Tree of Curves
seed_points
Tree of Points
inner_cells
List of Curves
index
Integer
VoroPattSelVoronoiPatternSelector
Sweeps every point-set combination VoroPattGen can be given, from one index.
point_toggle
List of Booleans
option_count
Integer
active
List of Strings
use_centroid
Boolean
use_outer_mid
Boolean
use_outer_vert
Boolean
use_outer_eval
Boolean
use_inner_mid
Boolean
use_inner_vert
Boolean
use_inner_eval
Boolean
VoroPattSelUtilVoronoiPatternSelectionUtility
Sets VoroPattGen’s seven point-set switches by hand.
point_toggle
List of Booleans
grid_cells
List of Curves
inner_scale
Number
chord_toggle
List of Booleans
make_regions
Boolean
LattPattGenLatticePatternGenerator
Draws a chord lattice inside every grid cell, from chord families you choose.
pattern_lines
Tree of Curves
pattern_cells
Tree of Curves
lattice_nodes
Tree of Points
index
Integer
LattPattSelLatticePatternSelector
Sweeps every chord family combination LattPattGen can be given, from one index.
chord_toggle
List of Booleans
option_count
Integer
active
List of Strings
use_outline
Boolean
use_fan
Boolean
use_mid_fan
Boolean
use_medial
Boolean
use_star2
Boolean
use_star3
Boolean
use_inner
Boolean
use_brace
Boolean
use_chevron
Boolean
use_pinwheel
Boolean
LattPattSelUtilLatticePatternSelectionUtility
Sets LattPattGen’s ten chord family switches by hand.
chord_toggle
List of Booleans
Signage ShowHide

scripts/signage1 componentChannel Letters

outlines
List of Geometry
sidewall_depth
Number
standoff_distance
Number
illumination
Integer
SignMkrSignMaker
Builds channel letters from flat letter outlines.
profiles
List of Curves
body
List of Breps
faces
List of Breps
Utility ShowHide

scripts/utility5 componentsData · Maintenance

data
Tree of Data
toggle
Boolean
DataGateDataGate
Passes a data stream through or blocks it completely.
out_data
Tree of Data
count
Integer
values
List of Strings
StrSortStringSort
Sorts strings the way a person reads them, so item2 comes before item10.
sorted_values
List of Strings
indices
List of Integers
cluster_name
String
new_password
String
run
Boolean
ClusterCrackClusterCrack (C#)
Unlocks a password-protected Grasshopper cluster so it can be opened again.
report
String
folder
String
set_path
Boolean
RepoPathAlexandriaRepoPath
Records where the Alexandria script library lives, once, for every component.
report
String
repo_root
String
nicknames
List of Strings
run
Boolean
UserObjMkrUserObjectMaker
Packages canvas components into Grasshopper User Objects.
report
List of Strings
count
Integer

Development Notes

scripts/<domain>/*.py is the source of truth, and it is also what actually runs: there is no compiled plugin to rebuild. Editing a script’s logic is live the next time its component solves.

Editing a script’s header, however, does not automatically update the installed User Object. The header is copied into ui_shells/ and baked into the packaged .ghuser, so a header change takes three further steps: re-run tools/build.py to regenerate the bridges and this page, paste the updated bridge onto a canvas, and re-package it with the UserObjMkr component, which reads every ribbon detail back out of the script itself.

Port names, types and tooltips come from the same header. Each script reads its own header at solve time and writes the description of every port it recognises by name, so a port’s tooltip in Grasshopper is the line that documents it here. Adding or renaming a port is still a manual step on the component itself — Grasshopper owns the parameter list, not the script.

Two components sit outside the bridge. ClusterCrack is C#, which the generator does not handle. RepoPath is the component that tells the others where the library is, so it cannot depend on finding it. Both carry their source inline in their own .ghuser and are packaged by pasting the script itself onto a canvas rather than a bridge.

The build enforces the contract rather than trusting it: a script with a malformed header, an unknown data type, an undescribed port, a duplicated name or a ribbon section that is not in the registry stops the build with the file named. There is no automated test suite beyond that; behaviour is verified by hand in Grasshopper. Conventions for AI coding tools working in this repository are recorded in CLAUDE.md.

Reference

Alexandria Library - Full source and component code at github.com/felipeharker/alexandria_script_library_master.