Skip to main content

No project description provided

Project description

Description: # zmesh
[![PyPI version](](

Multi-Label Marching Cubes & Mesh Simplification

from zmesh import Mesher

labels = ... # some dense volumetric labeled image
mesher = Mesher( (4,4,40) ) # anisotropy of image
mesher.mesh(labels) # initial marching cubes pass

meshes = []
for obj_id in mesher.ids():
normals=False, # whether to calculate normals or not

# tries to reduce triangles by this factor
# 0 disables simplification

# Max tolerable error in physical distance
mesher.erase(obj_id) # delete high res mesh

mesher.clear() # clear memory retained by mesher

mesh = meshes[0]


# Extremely common obj format
with open('iconic_doge.obj', 'wb') as f:

# Common binary format
with open('iconic_doge.ply', 'wb') as f:

# Neuroglancer Precomputed format
with open('10001001:0', 'wb') as f:

## Installation

If binaries are available for your system:

pip install zmesh

*Requires a C++ compiler*

sudo apt-get install python3-dev libboost-all-dev
pip install zmesh --no-binary :all:

## Performance Tuning

- The mesher will consume about double memory in 64 bit mode if the size of the
object exceeds <511, 1023, 511> on the x, y, or z axes. This is due to a limitation
of the 32-bit format. It might be possible to get x to 1023 as well.

## Related Projects

- [zi_lib]( - zmesh makes heavy use of Aleks' C++ library.
- [Igneous]( - Visualization of connectomics data using cloud computing.

## Credits

Thanks to Aleks Zlateski for creating and sharing this beautiful mesher.

Later changes by Will Silversmith and Nico Kemnitz.

## References

1. W. Lorensen and H. Cline. "Marching Cubes: A High Resolution 3D Surface Construction Algorithm". pp 163-169. Computer Graphics, Volume 21, Number 4, July 1987.
2. TK Quadratic Edge Collapse Paper

Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Utilities
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for zmesh, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size zmesh-0.2.0-cp27-cp27m-manylinux1_x86_64.whl (763.8 kB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size zmesh-0.2.0-cp35-cp35m-manylinux1_x86_64.whl (786.4 kB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size zmesh-0.2.0-cp36-cp36m-manylinux1_x86_64.whl (794.3 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size zmesh-0.2.0-cp37-cp37m-manylinux1_x86_64.whl (793.2 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size zmesh-0.2.0.tar.gz (250.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page