Algorithmic mesh generation

Marching Cubes & Minimal Surfaces

A detailed Grasshopper and C# series on Marching Cubes, lookup tables, and periodic minimal surfaces.

Start collection10 lessons8 with files
Lessons in sequence01 - 10
  1. 01

    Introduction

    Welcome to the Marching Cubes and Periodic Minimal Surfaces tutorial. This video presents some ways to understand minimal surfaces (and triply periodic minimal surfaces - TPMS). It explores their geometry, where these mathematical structures pop up in nature, and what their value can be to architects and designers. This introduction also touches on the basics of the Marching Cubes algorithm and how this computational technique can be used to visualize periodic minimal surfaces. Back to Marching Cubes

    AdvancedBiomimicryC#
  2. 02

    Preparing Script for Base Meshes

    In this video we look more closely at the Marching Cubes algorithm and map out the steps we'll take to construct it. Then we set up our canvas in preparation for the first C# script. Back to Marching Cubes

    AdvancedBiomimicryC#
  3. 03

    Collecting Transformations

    In this video, we begin by creating the 14 base meshes that we’ll need for the Marching Cubes algorithm. Then, we rotate and mirror these meshes in different ways, collecting each sequence as a separate transformation to apply to our cube corners and the Boolean patterns associated with each base-case mesh. Back to Marching Cubes

    AdvancedBiomimicryC#
  4. 04

    Finishing Lookup Table

    In this video we finish the lookup table. This involves matching transformed meshes to transformed cube corners; then rearranging our original 14 Boolean patterns to match the cube corners transformations; then placing all of our meshes (we will have too many) into branches that are designated by their associated Boolean patterns; and finally, selecting the first mesh from each branch (since all meshes in each branch will be identical). This will give us a component that contains 256 branches—2 of which are null, 254 of which are the 254 possible meshes (ignoring ambiguous cases) for any combination of ‘inside’ or ‘outside’ cube corners. Back to Marching Cubes

    AdvancedBiomimicryC#
  5. 05

    A View of it Coming Together

    This video gives an overview of how the remaining 5 videos connect the pieces for the Marching Cubes algorithm. Please consider becoming a member to support the creation of these tutorials and everything else on this website. We appreciate your support more than you know. Back to Marching Cubes

    AdvancedBiomimicryC#
  6. 06

    Setting up Algorithm Inputs

    In this video we start writing the Marching Cubes algorithm—(now that we have a lookup table ready to go). We start by arraying points in space (at equal increments in all 3 directions) and plugging their coordinates into our periodic minimal surfaces equations to get one scalar value for every point. Then we get a visual preview of the surfaces with points and dots. Then we get a blank scripting component and plug in all of our inputs. Back to Marching Cubes

    AdvancedBiomimicryC#
  7. 07

    Organizing Iterations

    In this video we are going to organize our iterations—‘What does that mean?’ ... Now that we have a list of points and a list of values, we need to visit each pair, but, we need to visit them in sets of 8 ( we need to visit cubes ). So, this video walks through how to set up a for loop that collects the correct points and values at each step—i.e., a for loop that uses terms of i ( i , i + 1 , i + x_count + 1 , etc.), to match the points and values in our input lists to our original cube points. From there, we will have a clear path to the correct mesh for each cube. Back to Marching Cubes

    AdvancedBiomimicryC#
  8. 08

    Bringing in Meshes

    In this video we start by converting the Boolean pattern we created in the last video to a branch path: meshes.Branch(b_0, b_1, b_2, b_3, b_4, b_5, b_6, b_7)[0] . We use this path to get the correct mesh for each cube. Then we start writing the functions that will help us interpolate the mesh vertices to create a smoother mesh. Back to Marching Cubes

    AdvancedBiomimicryC#
  9. 09

    Finishing the Algorithm

    This is the final video for the Marching Cubes algorithm —(the video after this is refining and visualizing the mesh that comes out of our finished Marching Cubes component). After this video you will have a component that can visualize much more than just periodic minimal surfaces. This component can visualize data from 3-dimensional scalar fields so just imagine a way to create that scalar field and use this component to visualize surfaces within that field. Back to Marching Cubes

    AdvancedBiomimicryC#
  10. 10

    Fine-Tuning and Visualizing

    This is an extra video that goes through a couple ways to refine the mesh and a way to visualize the mesh . In this video we also make a few adjustments to the larger Grasshopper script. Back to Marching Cubes

    AdvancedBiomimicryC#