QUIMICOMP

C and C++ libraries of Marching Cubes 33


This page contains information about the Marching Cubes 33 library in C language, developed in our laboratory, and its adaptation to C++ language.
The C library has been compiled with GCC in macOS and Linux, with MinGW / MinGW-w64 and Microsoft Visual C++ in Windows.
The MC33 and MC33++ libraries can be used and distributed under the terms of the MIT license, described in the "LICENSE.txt" file that is included in the compressed folder of the source code.

Download links

LibraryDescriptionRelease dateSource code
MC33++ v1.0First version of the Marching Cubes 33 library in C++ language, adapted from the library MC33 v final.
The Solution File to compile the library with Visual Studio community 2017, and an example that uses this library, are included.
This library still uses malloc and realloc for memory allocation of the isosurface and the 3D grid.
Aug-2019sourceforge.net
MC33 v finalFinal version of the Marching Cubes 33 library in C language.
The code of this library is more efficient and was obtained by slightly modifying the library code described in the paper:
A Fast and Memory-Saving Marching Cubes 33 Implementation with the correct interior test
This C library compiled with visual C++ did not behave correctly. Compiling it as a C++ code (/TP option) fixed the problem.
An example in C++ that uses this library was added.
Aug-2019sourceforge.net
MC33 paperVersion described in the paper mentioned aboveJun-2018jcgt.org
sourceforge.net
Old versionFirst version published on the Internet of the Marching Cubes 33 library in C language. This is an outdated version, with some bugs.Sep-2012facyt.uc.edu.ve
sourceforge.net

† The example also needs the FLTK library.


The following table compares the processing speed of the libraries, using 4 datasets. The tests were performed on a laptop with an Intel® Core™ i3-2350M CPU @ 2.30 GHz (4 GiB RAM). The test codes were compiled with g++ of GCC 9.1.0 from MinGW-w64 in Windows 7 64-bit operating system. Aggressive optimization compiler options -Ofast and -funroll-loops were used. The calculation time of the MC33 paper version was taken as a reference.

Performance comparison

DatasetSizeIsovalueLibraryRelative speed
bunny 512×512×3611500MC33++ v1.0
MC33 v final
MC33 paper
Old version
1.093
1.128
1.000
0.688
CThead 256×256×1131500MC33++ v1.0
MC33 v final
MC33 paper
Old version
1.058
1.087
1.000
0.634
stagbeetle 832×832×494500MC33++ v1.0
MC33 v final
MC33 paper
Old version
1.061
1.091
1.000
0.638
present 492×492×442500MC33++ v1.0
MC33 v final
MC33 paper
Old version
1.040
1.063
1.000
0.706

The comparison of the processing speed with other libraries not developed in our laboratory is found in the paper:

Vega, D., Abache, J., Coll, D., A Fast and Memory-Saving Marching Cubes 33 Implementation with the correct interior test, Journal of Computer Graphics Techniques (JCGT), vol. 8, no. 3, 1-18, 2019

The Solution File to compile the library with Visual Studio and the Makefile to compile with GCC (on Linux, macOS or msys2/MinGW) were included in the source code of the libraries MC33++ v1.0 and MC33 v final. A C++ example of the use of each library was also included. To compile this example, it is necessary install the FLTK library. The Makefiles are also included to compile the example with msys2/MinGW and Debian/GCC. Screen shots of the example compiled in Windows are shown below.

bonsai raw dataset engine raw dataset

If you find any error in the codes or have difficulty compiling the library and the example, please write to dvega@uc.edu.ve or dvega68@yahoo.com