Marching Cubes

Use vectorized marching cubes algorithm to compute triangulated mesh of an isosurface from 3D matrix
7,8K téléchargements
Mise à jour 23 juil. 2013

Afficher la licence

This function uses a vectorized version of the marching cubes algorithm to compute a triangulated mesh of the isosurface within a given 3D matrix of scalar values at a given isosurface value. The output is a triangulated mesh specified in terms of a face list and a vertex list. The orientation of the triangles is chosen such that the normals point from the higher values to the lower values. Optional arguments COLORS ans COLS can be used to produce interpolated mesh face colors.

This function was used to create a surface mesh from the CT scan dataset for the Stanford bunny, a 461 x 339 x 330 array of floats. See uploaded image. Elapsed time on an AMD Opteron 64-bit computer with 4 GB of RAM is 24.7 seconds. For comparison, a surface mesh was computed from the same dataset using Matlab's isosurface function, and the elapsed time was 98.6 seconds.

This function was adapted for Matlab by Peter Hammer in 2011 by making minor syntax changes to an Octave function written by Martin Helm <> in 2009 (

Revised 30 September, 2011 to add code by Oliver Woodford for removing
duplicate vertices.

Citation pour cette source

Peter Hammer (2024). Marching Cubes (, MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2011a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

A inspiré : BiofilmQ, resolution truncated with 10 digit'

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version

Changed description to include benchmarking results, and changed help section of mfile to more explicitly describe input arguments.

Revised 30 September, 2011 to add code by Oliver Woodford for removing duplicate vertices.

Added image of Stanford bunny meshed using this function. Added text describing this example to description.