Modelling Armchair Carbon Nanotubes

Let’s model a carbon nanotube! This post is meant to be a supplemental explanation for the OpenSCAD code I published to parametrically model an armchair carbon nanotube.

While designing a shelf to store my 3D prints, I became fixated on the efficiency and stability of hexagons. I wanted to created another hexagonal structure to organize my desk and thought of a carbon nanotube inspired pen holder. Searching online, I saw several available models, but none that allowed me to parametrically generate the structure. That’s when I thought to create my own parametrically generated carbon nanotube.

First, I need to figure out if the geometry is printable using an FDM printer. In terms of geometry, a carbon nanotube is a wall of tessellated hexagons rolled into a cylinder. Let’s take a look at the regular hexagon to examine the overhangs it forms when printed vertically.

Hexagon Overhang Comparison

There are different angles one can use to roll a graphene sheet into a carbon nanotube. In the armchair configuration, the overhang section bends away from the z-axis at 30° before meeting at a bridge. Not ideal, but I know from my printer benchmarks that it can handle overhangs under 45° and bridges under small distances. In the zigzag configuration, there are no bridges, but the overhang bends away from the z-axis at a 60° angle. It might be possible to print this at a slow speed with active cooling, but to work within the known limits of my printer, I chose to go with the armchair configuration. There’s also a chiral configuration, but the covalent bond angles are much easier to reason with in the armchair configuration.

I wanted to be able to easily adjust my bridge lengths, so I examined the dimensions of a regular hexagon in terms of its edge lengths.

Hexagon Dimensions

This gives us the height and width we need to draw the honeycomb pattern formed by the graphene sheets. 

Hexagon Vertex Grid

We can actually fit the vertices into a grid where the the carbon atoms have uniform vertical spacing and are horizontally spaced alternating between whole and half edge lengths. Now, we need roll this sheet into a tube. I wanted my carbon nanotube to have an arbitrary number of faces so let’s take a look the properties of a regular polygon.

Regular Polygon Overhead View

If this was a zigzag configuration, using a regular polygon for overhead view dimensions would suffice because the vertices would be evenly distributed. However, this is the armchair configuration so we need to modify this regular polygon such that edge lengths alternate between whole and half lengths. If we cut off every vertex so that the cut faces form this alternating length pattern, then we will have the shape of the tube from an overhead view.

Regular Polygon Cuts

With these values, we can place the atoms and bonds in position. My initial OpenSCAD implementation threw all the geometry into the workspace and tried to compile them all at once. The preview was fast, but this initial design never finished rendering so I needed to structure my design in a more computationally efficient manner. Through some research, I learned that OpenSCAD allows users to cache geometry for future calls so I added aggressive caching throughout my code. The end result is a model that finishes rendering in under a minute for medium sized models. You can check out the model at Thingiverse.

Leave a comment