volume2mesh
Voxelize meshes to volumes. Save meshes from volumes.
This package provides to functions volume2mesh and mesh2volume to convert between NumPy volume arrays and meshes:
file = '/tmp/my_mesh_file.obj'
volume = np.zeros((100, 120, 131), np.float32)
volume[20:40, 30:40, 40:50] = 1
volume2mesh(file,
volume,
threshold=0.5,
adaptivity=0.,
spacing=[1., 1., 1.],
origin=[0., 0., 0.],
binary_file=True,
only_write_biggest_components=False,
max_component_count=1)
And to voxelize meshes:
bunny_file = '~/my_bunnyfile.stl'
volume = volume2mesh.mesh2volume(bunny_file, scaling=1.)
Installation
You need to have OpenMesh linkable via -lOpenMeshCore and OpenVDB installed.
On on Ubuntu, you can do this by these commands (see our Travis Script):
# Install OpenVDB
sudo apt-get install -y libopenvdb-dev build-essential libboost-all-dev libtbb-dev
# Install OpenMesh
git clone https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh.git || echo "hi"
cd OpenMesh
git pull
mkdir -p release
cd release && cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -- -j4
sudo make install
# Install this package
pip3 install volume2mesh --user
# Or if you cloned this repo
pip3 install -e . --user
Metadata
Release files for volume2mesh 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| volume2mesh-0.3.2.tar.gz | 824.0 kB | Without provenance | Details for volume2mesh-0.3.2.tar.gz |
Release files / volume2mesh-0.3.2.tar.gz
| Download URL | volume2mesh-0.3.2.tar.gz |
|---|---|
| Size | 824.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a582cdc097d3d27568c7a2f222df034f0c15e6990329a57d82f3285eb8c2cb5
|
|
BLAKE2b-256 checksum How to use checksums |
31ec2643a7b8acbe672cbe449867ded391cb9f2c1c0c6e07deaa0034d9a72d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for volume2mesh 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.