No project description provided
Project description
LICENSE
Description: # zmesh
[![PyPI version](https://badge.fury.io/py/zmesh.svg)](https://badge.fury.io/py/zmesh)
Multi-Label Marching Cubes & Mesh Simplification
```python
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():
meshes.append(
mesher.get_mesh(
obj_id,
normals=False, # whether to calculate normals or not
# tries to reduce triangles by this factor
# 0 disables simplification
simplification_factor=100,
# Max tolerable error in physical distance
max_simplification_error=8
)
)
mesher.erase(obj_id) # delete high res mesh
mesher.clear() # clear memory retained by mesher
mesh = meshes[0]
mesh.vertices
mesh.faces
mesh.normals
# Extremely common obj format
with open('iconic_doge.obj', 'wb') as f:
f,write(mesh.to_obj())
# Common binary format
with open('iconic_doge.ply', 'wb') as f:
f,write(mesh.to_ply())
# Neuroglancer Precomputed format
with open('10001001:0', 'wb') as f:
f.write(mesh.to_precomputed())
```
## Installation
If binaries are available for your system:
```bash
pip install zmesh
```
*Requires a C++ compiler*
```bash
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](https://github.com/zlateski/zi_lib) - zmesh makes heavy use of Aleks' C++ library.
- [Igneous](https://github.com/seung-lab/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
Description: # zmesh
[![PyPI version](https://badge.fury.io/py/zmesh.svg)](https://badge.fury.io/py/zmesh)
Multi-Label Marching Cubes & Mesh Simplification
```python
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():
meshes.append(
mesher.get_mesh(
obj_id,
normals=False, # whether to calculate normals or not
# tries to reduce triangles by this factor
# 0 disables simplification
simplification_factor=100,
# Max tolerable error in physical distance
max_simplification_error=8
)
)
mesher.erase(obj_id) # delete high res mesh
mesher.clear() # clear memory retained by mesher
mesh = meshes[0]
mesh.vertices
mesh.faces
mesh.normals
# Extremely common obj format
with open('iconic_doge.obj', 'wb') as f:
f,write(mesh.to_obj())
# Common binary format
with open('iconic_doge.ply', 'wb') as f:
f,write(mesh.to_ply())
# Neuroglancer Precomputed format
with open('10001001:0', 'wb') as f:
f.write(mesh.to_precomputed())
```
## Installation
If binaries are available for your system:
```bash
pip install zmesh
```
*Requires a C++ compiler*
```bash
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](https://github.com/zlateski/zi_lib) - zmesh makes heavy use of Aleks' C++ library.
- [Igneous](https://github.com/seung-lab/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zmesh-0.2.0.tar.gz
(250.2 kB
view hashes)
Built Distributions
Close
Hashes for zmesh-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a00f9dafb11dfcd96a5e9f96d559bdee2b74f5b3ab3b567c30e7c66f8892c6a |
|
MD5 | c504182ab705c1b240b357489477d738 |
|
BLAKE2b-256 | 76111230973143d2f45481a978e772606299ebe96bcaaf314001d09314f94048 |
Close
Hashes for zmesh-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2880054a978d00f892a1477eb8e2fb826e233959cd76184c6dcde6b1f3cb0e9e |
|
MD5 | a45fc34aba8bf4dc4dc8a0e5adc8253c |
|
BLAKE2b-256 | 5890d24bb12e03dc37107b20d0795fb81a39d8201381f25b5c9b0a605f4be2c9 |
Close
Hashes for zmesh-0.2.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbbbba8307af3855e2de68d7c1232a2dd97a7421f55fa74612f5ab6538c4f00 |
|
MD5 | 30f00ebf6e03643a18f94f8a582b198f |
|
BLAKE2b-256 | fe3e6f9298e3b664b6bf55ed20a2a7f920de040b3d171bbdbe6ed2f27280bf86 |
Close
Hashes for zmesh-0.2.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87dd7aa6f1c73f1518e3c45e0fc64251e9796040d6116ed2573136502730297 |
|
MD5 | 17ea54fb77880fad2092a0ac045be7e7 |
|
BLAKE2b-256 | 642c2f89af13748aedfeb95ef24d2d70c94672392dfea28cedb3158b71787a29 |