grasshopper code

. a collection of codes & grammars for Grasshopper.

Hitomezashi Pattern

The definition creates a specific Hitomezashi pattern.
Outputs are available in Nurbs and a Mesh format.

Mesh Color by sudo-Curvature

The definition applies a vertex color based on the average or upper value of the angles between adjacent faces.

3D Hilbert curve

This definition generates a 3D Hilbert curve (a continuous fractal space-filling curve).

nGon mesh tessellation

Builds a nGon mesh tessellation on a closed surface.

Curves Sorter

Sorts a list of curves by closest curve and (eventually flipping their direction) to optimize toolpath length.


Groups indexes of connected points into separate clusters. Sandbox & Anemone plugins required.


This definition simulates a spirograph tool.

3D Differential mesh relaxation

This definition explores the 3D relaxation of a mesh affected by an image gradient.

2.5D Differential mesh relaxation

This definition explores the 2.5D relaxation of a mesh by a system of attractor points forces.

2D Differential mesh relaxation

This definition explores the 2D relaxation of a mesh by a system of attractor points forces.


This definition creates a mesh model of all the connections between the centers of the 3D Voronoi cells and the adjacent cells.

3D Hexagonal Weaving

This definition explores the weaving of a hexagonal grid generating 3 different interwoven frames.

Vectors field over HexaMesh

This definition explores vector field-driven deformations and colouring over a hexagonal grid, generating a mesh.

Vectors field over

Erwin Hauer’s Box Morph

This definition explores the Box Morph technique to get Erwin Hauer’s continuous screens using meshes.

Erwin Hauer’s Box Morph_Co-de-iT_0.9.0066

Math surfaces

This definition provides several math surfaces (nurbs and mesh) based on k3surf formulas.



A series of Clusters/Components in order to export and visualize directly a SVG file.

you can download the file from the gitHub repo.

ASCII art generator

This definition uses any image to create an ASCII art picture.


Gradient Descent Algorithm

Gradient Descent algorithm on a surface (generated by an image sampler logic) in two variants normal and rotated. Original VBnet code by Woo Jae Sung.

Gradient Descent Algorithm.rar

GH to Maya

GH definition that preserves mesh vertices colors and renders them in Mental Ray in Maya. Included are: GH def (v 0.9.0014), Rhino file, .fbx mesh sample, .mb file with finished result.

GH to Maya package

GH to Blender

GH definition that preserves mesh vertices colors and renders them in Blender with Cycles. Included are: GH def (v 0.9.0014), Rhino file, VRML mesh sample, .blend file with finished result.

GH to Blender package


A definition that voxelizes a surface or polysurface.

Ribs Structure

This definition creates a Ribs structure from a given Nurbs surface, unrolling all pieces.


Strip Morphologies

Fabrication of single-curvature striped surfaces. Based on the Strip Morphologies technique originally developed by MODELAB

Strip morphologies_Co-de-iT_GH080066

Seamless Pattern

A simple GH definition that mimics the Escher patterns process.


DiY Architectural Dialogue Machine

Inspired by this post – the GH def sorts random strings from several lists of data and works as an architectural dialogue machine.

DiY Arch


Import a Blender3D geometry in GH using the .PLY file format. Package includes: .blend file, .PLY file, GH def, pdf tutorial.


Random hexagonal based pattern generator.

Pie chart

Draws a pie chart from a list of values.



A Sudo-Phyllotaxis 2D pattern, using the formula: x= cos(i), y=sin(i)


Sudo-taxis growth

Sudo-Phyllotaxis variation using the formula: x= cos(i), y=sin(i), z=i.

sudo-phyllotaxis growth_Co-de-iT_GH06057.rar

Attractors vector deformation

Attractor points-based deformation (shrink-expand) on a hexagonal grid.

attractors vector deformation_Co-de-iT_GH0657.rar

Hexagonal Grid Field

Magnetic field applied to a hexagonal grid ruled by 4 points that can be switched (attractors or repulsors).


Image Field

Image-based geometric parameter control example.

IMAGE FIELD_Co-de-iT_GH06057.rar

Curvature analysis pattern

Subdivides a surface into quadrangular panels, with curvature-dependent holes.

curvature analysis pattern_Co-de-iT_GH06057.rar

Uneven Subdivision

Uneven subdivision of a NURBS surface, controlled by random intervals.


Complete Diagrid

Diagrid definition covering the whole surface, up to the edges.



Tessellate a surface and smoothly transform the tessellation from a quadrangular to a diagrid pattern.

Quad 2


This definition allows you to tessellate a surface going smoothly from tatami tessellation to diagrid through Cairo tessellation.