designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Dual Polyhedra in Grasshopper

October 7, 2025 | Algorithms
#dual #grasshopper #polyhedra #rhino-python

Exploring dual polyhedra in Grasshopper is an interesting topic. In this post, I try to generate the dual of any polyhedron using Rhino Python and possibly Grasshopper. I developed this code for Rhino Python earlier here, and now I have converted it into a Grasshopper-Python component for better usability. I start the process by breaking the polyhedron into individual faces and gathering the corner points of each face. These points become the vertices of the dual polyhedron. Then, for each vertex, I connect the centroids of the surrounding faces to create polygons, which form the structure of the dual shape. After forming the polygons, I generate planar surfaces from each one and combine all the resulting faces. Finally, I use Rhino’s Brep tools to join the planar surfaces into a single solid, creating a clean and fully manipulable dual polyhedron.

Dual Polyhedra in Grasshopper animation

I developed this definition in the Grasshopper version of Rhino 8 (Python 3). This means it will NOT work in Rhino 7. Just place a Python 3 component in Grasshopper, and change the x and y inputs by erasing one of them. B will be the only input of this component. Then, right-click on the B input and choose “List Access” and “Brep” as the type, and turn on “Required”. It accepts lists, so you can process many solids at once. dualBrep is the only output that returns the calculated dual polyhedron (a closed polysurface). Feed the component with a Box (fingers crossed); it should give you an Octahedron. The output is ready for 3d printing. Below is the Python code you need to paste inside a Python 3 component in Grasshopper:

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
dualPoints=[]
dualFaces=[]
dualBrep=None
if B:
	result=rs.ExplodePolysurfaces(B)
	points=[]
	for surf in result:
		for poly in rs.DuplicateSurfaceBorder(surf):
			pts=rs.PolylineVertices(poly)
			if pts: points.extend(pts)
	dualPoints=rs.CullDuplicatePoints(points)
	for pp in dualPoints:
		newface=[rs.SurfaceAreaCentroid(surf)[0] for surf in result if rs.IsPointOnSurface(surf,pp)]
		newface=rs.SortPointList(newface)
		if len(newface)>=3:
			if newface[0]!=newface[-1]: newface.append(newface[0])
			pline=rg.Polyline(newface)
			if not pline.IsClosed: pline.Add(pline[0])
			crv=pline.ToNurbsCurve()
			breps=rg.Brep.CreatePlanarBreps([crv])
			if breps: dualFaces.extend(breps)
	if dualFaces:
		joined=rg.Brep.JoinBreps(dualFaces,1e-6)
		if joined: dualBrep=joined[0]
Dual Polyhedra in Grasshopper dual, grasshopper
Python file (PY)Download
Grasshopper definition (GH)Download

Cite this post

Yazar, T. (2025, October 7). Dual Polyhedra in Grasshopper. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/dual-polyhedra-in-grasshopper/

Related Posts

Dual Polyhedra Generator

August 3, 2017

According to Wolfram, By the duality principle, for every polyhedron, another polyhedron exists in which faces and polyhedron vertices occupy complementary locations. This polyhedron is known as the dual, or reciprocal”. We can use this method to generate new polyhedra from known ones. I tried to develop a Dual Polyhedra Generator in this Rhino Python script. First, the script asks a user to select a closed polysurface object. Then, it attempts to identify the area centroids of the faces. By…

Cairo Pentagonal Tiling

October 22, 2012

This is a late update for my 2012 study on Cairo Pentagonal Tiling (or Cairo Tessellation). Originally, it was an exercise of dual tessellations. Because this tiling is the dual of the famous semi-regular tessellation of Snub Square. After coding the Snub Square tiling, I attempted to generate the dual of it. However, that created an inefficient result. This latest version generates the original Snub Square and Cario Pentagonal Tilings. Moreover, it is possible to play with the inputs to…

Snub Square Tiling

October 22, 2012

Here is the step-by-step generation of the old Snub Square Tiling. Frankly, this is the first step in the generation of Cairo Pentagonal Tiling I generated with Grasshopper earlier. Because Cairo pentagonal is the dual of a snub square. The first step was easy. Just dispatch cells of a square grid, then evaluate them according to the ratio of 0.366 approx. which is derived from the bisector of an equilateral triangle. Now, we have a snub square tiling, composed of…

Goldberg Polyhedra

April 11, 2025

Although it appears simple, Goldberg Polyhedra in Grasshopper became a tough challenge, which I like a lot. I spent about 24 hours attempting to generate these polyhedra. I started with Goldberg’s original method. This creates an equilateral triangle using coordinates denoted as m and n on a hexagonal grid. Then, we place this triangle onto the faces of an icosahedron. Finally, we project them onto a concentric sphere. We can create many polyhedra by changing the values of m and…

Modeling Dual of Dodecahedron

December 14, 2024

A dual polyhedron is a concept in geometry where two polyhedra are related in such a way that the vertices of one polyhedron correspond to the faces of the other, and the faces of the first polyhedron correspond to the vertices of the second. The process of creating a dual polyhedron is called duality, and it applies to many regular, semi-regular, and some irregular polyhedra. In the case of Platonic solids, the cube and octahedron are duals of each other….

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #tutorial
    • #rhinoceros
    • #archimedean-solid
    • #unrolling
    • #platonic-solid
    • #parametric-surface
    • #kuka-prc
    • #robot
    • #tessellation
    • #dodecahedron
    • #truncated
    • #folding
    • #icosahedron
    • #linear-algebra
    • #terrain
    • #sandblasting
    • #stone
    • #parametric-curve
    • #animation
    • #icosidodecahedron
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement