No project description provided
Project description
LICENSE
Description: # zmesh
[](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
[](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 details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zmesh-0.2.0.tar.gz.
File metadata
- Download URL: zmesh-0.2.0.tar.gz
- Upload date:
- Size: 250.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e75472e570238bd7e6f6f89e2af11e98034f4f0938aec91c70f018fcd1d40e53
|
|
| MD5 |
ae9ce315b0671ce8c41f06b7b0609c70
|
|
| BLAKE2b-256 |
95dfd3be155edc35dc4cf1085e72534b357574a08f0135a91b28e2eb848fd4e5
|
File details
Details for the file zmesh-0.2.0-cp37-cp37m-manylinux1_x86_64.whl.
File metadata
- Download URL: zmesh-0.2.0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 793.2 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a00f9dafb11dfcd96a5e9f96d559bdee2b74f5b3ab3b567c30e7c66f8892c6a
|
|
| MD5 |
c504182ab705c1b240b357489477d738
|
|
| BLAKE2b-256 |
76111230973143d2f45481a978e772606299ebe96bcaaf314001d09314f94048
|
File details
Details for the file zmesh-0.2.0-cp36-cp36m-manylinux1_x86_64.whl.
File metadata
- Download URL: zmesh-0.2.0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 794.3 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2880054a978d00f892a1477eb8e2fb826e233959cd76184c6dcde6b1f3cb0e9e
|
|
| MD5 |
a45fc34aba8bf4dc4dc8a0e5adc8253c
|
|
| BLAKE2b-256 |
5890d24bb12e03dc37107b20d0795fb81a39d8201381f25b5c9b0a605f4be2c9
|
File details
Details for the file zmesh-0.2.0-cp35-cp35m-manylinux1_x86_64.whl.
File metadata
- Download URL: zmesh-0.2.0-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 786.4 kB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bbbbba8307af3855e2de68d7c1232a2dd97a7421f55fa74612f5ab6538c4f00
|
|
| MD5 |
30f00ebf6e03643a18f94f8a582b198f
|
|
| BLAKE2b-256 |
fe3e6f9298e3b664b6bf55ed20a2a7f920de040b3d171bbdbe6ed2f27280bf86
|
File details
Details for the file zmesh-0.2.0-cp27-cp27m-manylinux1_x86_64.whl.
File metadata
- Download URL: zmesh-0.2.0-cp27-cp27m-manylinux1_x86_64.whl
- Upload date:
- Size: 763.8 kB
- Tags: CPython 2.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e87dd7aa6f1c73f1518e3c45e0fc64251e9796040d6116ed2573136502730297
|
|
| MD5 |
17ea54fb77880fad2092a0ac045be7e7
|
|
| BLAKE2b-256 |
642c2f89af13748aedfeb95ef24d2d70c94672392dfea28cedb3158b71787a29
|