Remeshing using Marching Cubes in Blender

A computer graphics beginner practical
by Robin-Marcel Hanne

The Marching Cubes modifier applied to a cube.

Introduction and motivation

Personally, I am very interested in computer graphics, most notably Visual Effects (VFX), and computer animation.
As a result I decided to partake in this practical.
The goal was to create something that be used outside of uni as well; instead of being a one-time creation that gets discarded after the project is finished.
As a result, I decided on developing an addon for Blender.

The Marching Cubes Algorithm

Other use cases

Video Games

Very commonly used in video games as the go-to meshing algorithm for procedual terrain sampled out of a noise function.

Modelling using Metaballs

Metaballs are organic looking isosurfaces, that fuse together when in close proximity into a single, contiguous object. Metaballs are similiar to Z-Brush's Z-Spheres, which are commonly used to approximate shape and volume for organic models before sculpting.

Medical Visualisations

The Marching Cubes algorithm has and still is often used for visualising CT or MRI scans. Sampled density values are used to represent the scalar field values and a user-defined threshold can be used to traverse through the scan.

How does it work?

The Marching Cubes algorithm works by iterating over a scalar field and takes in a threshold [t], also called surface level or "isolevel".


The algorithm operates by traversing 8 corner points at a time. For each point we check whether the value of said point exceeds the threshold. If the value exceeds the threshold it is considered 'inside of the shape'.
As a result, there are 256 different configurations, out of which 15 are unique. The other configurations are mere symmetries of those 15 base cases. The 15 base cases can be seen below.

Whilst the original algorithm as published in the SIGGRAPH paper caused back-culling in OpenGL, newer variations used for video games change the triangulation table slightly so this issue no longer occurs. Another, more sophisticated implementation of this algorithm uses shared vertices. Instead of creating 8 new vertices for each iterated cube, vertices which share the same position are merged together. Another addition that can be made would shift the position of a generated vertex along its corresponding edge to linearly interpolate the values between the sampled points and create a smoother, less blocky result.
Since this algorithm can be broken down into cubes, it is easily computed in parallel due to each cube being traversed independently of each other. As a result, it can be implemented on a GPU using a compute shader, NVidias Cuda cores or similiar technology.

The bases cases of possible cube configurations

State of the Art: Alternatives

Due to the Marching Cubes algorithm being a relatively new invention, and patented at first; multiple alternatives for generating a mesh out of a scalar field have surfaced over recent years. In the following we briefly look over three of the most well-known and sophisticated alternatives for the still widely-used Marching Cubes algorithm that exist today:

To avoid legal intervention due to the Marching Cubes algorithm's patents, the Marching Tetrahedra algorithm offered a good alternative to create manifold meshes out of scalar fields. However, in comparison to the Marching Cubes algorithm, it produces larger meshes which can lead to slower render times in real-time rendering pipelines, such as those used in video games.

The (Naive) Surface nets are a dual method, which creates non-manifold vertices and generates incredibly small meshes. The resulting meshes are extremely fast to render. However, in order to create more high-quality meshes additional hermite data is required in order for dual contouring to be possible.

The VESTA (Volume Enclosing Surface Extraction) algorithm is a cycle-based mesh computation algorithm that creates non-degenerate, fully enclosing, non-self-intersecting meshes at a similar speed to the Marching Cubes algorithm. Whilst it produces much smoother results, it is a very new algorithm, hence; not very popular, and is harder to understand, learn and implement as there are only scientific papers about it at the time of this practical.

About me

My name's Robin-Marcel Hanne and I am a computer scientist student at the Karls-Ruprecht University in Heidelberg. As an aspiring 3D artist and game developer, I spend a lot of time using various 3D packages including (but not limited to) Maya, zBrush and Blender, and I have developed a passion for computer graphics.
This project was made as a computer graphics beginners practical supervised by Susanne Krömker.