designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Dual Polyhedra Generator

August 3, 2017 | Algorithms
#dual #polyhedra #rhino-python

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 joining the neighboring centroids, it generates a dual polyhedron. However, it has some bugs and is not working in some cases. This task could be much better solved with polygon meshes because the main problem is to identify the neighborhoods of faces. Works pretty well with simple objects like boxes or Platonic Solids.

This Rhino Python code attempts to generate the dual polyhedron of any closed polysurface. The output of the code is generally a closed polysurface. So it is ready for 3D printing. I tested the code in Rhinoceros 5, 6, and 7 Iron Python but should also work well with Rhinoceros 8 Python 3. So, you don’t need extra add-ons. In Rhinoceros 7, you will type the EditPythonScript command and type and run the code by hitting F5. In Rhinoceros 8, you can access the new script editor by the ScriptEditor command.

import rhinoscriptsyntax as rs
solid = rs.GetObject("Select object")
result = rs.ExplodePolysurfaces(solid)
points = []
for surf in result:
	temp = rs.DuplicateSurfaceBorder(surf)
	points.extend(rs.PolylineVertices(temp))
unique = rs.CullDuplicatePoints(points)
for pp in unique:
	rs.AddPoint(pp)
	newface = []
	for surf in result:
		if rs.IsPointOnSurface(surf,pp):
			tempa = rs.SurfaceAreaCentroid(surf)
			newface.append(tempa[0])
	newface = rs.SortPointList(newface)
	if len(newface) == 3 or len(newface) == 4:
		rs.AddSrfPt(newface)
	if len(newface) > 4:
		newface.append(newface[0])
		temps = rs.AddPolyline(newface)
		rs.AddPlanarSrf(temps)
rs.DeleteObjects(result)
rs.DeleteObject(solid)
rs.DeleteObjects(temp)
Dual Polyhedra Generator animation
Dual Polyhedra Generator dual, polyhedra
Python file (PY)Download
Rhinoceros file (3DM)Download

Cite this post

Yazar, T. (2017, August 3). Dual Polyhedra Generator. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/dual-polyhedra-generator/

Related Posts

Dual Polyhedra in Grasshopper

October 7, 2025

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…

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….

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…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #tutorial
    • #rhinoceros
    • #grasshopper
    • #archimedean-solid
    • #unrolling
    • #platonic-solid
    • #dodecahedron
    • #design-object
    • #truncated
    • #folding
    • #icosahedron
    • #parametric-curve
    • #icosidodecahedron
    • #rhombicosidodecahedron
    • #stellated-solid
    • #tetrahedron
    • #design-education
    • #linear-algebra
    • #art
    • #image-sampler
  • 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