a versatile halfedge-based data structure for representing and manipulating polygon meshes
Project description
OpenMesh Python Bindings (1.2.1)
OpenMesh is a versatile halfedge-based data structure for representing and manipulating polygon meshes. The OpenMesh Python bindings are are tightly integrated with numpy and are implemented using pybind11.
Example
import openmesh as om
import numpy as np
mesh = om.TriMesh()
# add a a couple of vertices to the mesh
vh0 = mesh.add_vertex([0, 1, 0])
vh1 = mesh.add_vertex([1, 0, 0])
vh2 = mesh.add_vertex([2, 1, 0])
vh3 = mesh.add_vertex([0,-1, 0])
vh4 = mesh.add_vertex([2,-1, 0])
# add a couple of faces to the mesh
fh0 = mesh.add_face(vh0, vh1, vh2)
fh1 = mesh.add_face(vh1, vh3, vh4)
fh2 = mesh.add_face(vh0, vh3, vh1)
# add another face to the mesh, this time using a list
vh_list = [vh2, vh1, vh4]
fh3 = mesh.add_face(vh_list)
# 0 ==== 2
# |\ 0 /|
# | \ / |
# |2 1 3|
# | / \ |
# |/ 1 \|
# 3 ==== 4
# get the point with vertex handle vh0
point = mesh.point(vh0)
# get all points of the mesh
point_array = mesh.points()
# translate the mesh along the x-axis
point_array += np.array([1, 0, 0])
# write and read meshes
om.write_mesh('test.off', mesh)
mesh_2 = om.read_trimesh('test.off')
For further examples see the documentation or refer to the unit tests.
Installation
Using pip
pip install openmesh
Using conda
Thanks to Martin Drawitsch you can also install openmesh-python via conda:
conda install -c conda-forge openmesh-python
Building from source
- recursively clone the repo
cd
to repo dir- ensure the correct virtualenv is activated
pip install -e .
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
Built Distributions
File details
Details for the file openmesh-1.2.1.tar.gz
.
File metadata
- Download URL: openmesh-1.2.1.tar.gz
- Upload date:
- Size: 9.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/22.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd3fa41a68148e4a7523f562426aa9758bf65ccc6642abcf79c37bae9c6af3c |
|
MD5 | 0a2fe2633fcae73bd4fd76aeab0be1c7 |
|
BLAKE2b-256 | 6634fd86bf3ca48d010f3a588fa997595c13162bc07563382f9a4d5ec8855dfb |
File details
Details for the file openmesh-1.2.1-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: openmesh-1.2.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/22.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39aef855270758ae51b6505fd9845025142c274f8dce5633ad27f0a8ab14c3b4 |
|
MD5 | 7c187adac3273a65067dcf6b5d664d12 |
|
BLAKE2b-256 | 5e307b5ffd02d21541f0759e8764ead78bebae9e96343592a4d2beb4fd66c300 |
File details
Details for the file openmesh-1.2.1-cp39-cp39-manylinux1_x86_64.whl
.
File metadata
- Download URL: openmesh-1.2.1-cp39-cp39-manylinux1_x86_64.whl
- Upload date:
- Size: 844.0 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/22.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e91c81f286f4e3443bca0f57b850d04f2ab4888930d08f84715f69fdaac604c3 |
|
MD5 | d87a935b356babb7d9ac77df210c65b8 |
|
BLAKE2b-256 | d81635cf9e1b6984bb4af5384424c6bfbe338dfde89ed64c1e53bcee6d91df71 |
File details
Details for the file openmesh-1.2.1-cp39-cp39-macosx_12_0_arm64.whl
.
File metadata
- Download URL: openmesh-1.2.1-cp39-cp39-macosx_12_0_arm64.whl
- Upload date:
- Size: 660.0 kB
- Tags: CPython 3.9, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/22.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98e09a05504f25584a0e9dbcf74c71c85707bbd8c03010a0a9ec7f9b80fa29e |
|
MD5 | 8ec7bc642cceceee0124f53f7913bce5 |
|
BLAKE2b-256 | f34cb7e7217ccbcda182d7c8d766a201cc46a8bd83bb73d6e83d7aa0ca8f64cc |
File details
Details for the file openmesh-1.2.1-cp39-cp39-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: openmesh-1.2.1-cp39-cp39-macosx_10_13_x86_64.whl
- Upload date:
- Size: 768.5 kB
- Tags: CPython 3.9, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/22.0.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c99c55777cac2183e6161d2cd37723537c74ab57d6483e346931bd4dd5fff9 |
|
MD5 | e6383ca10fb3f06d147aebd01d18ee68 |
|
BLAKE2b-256 | 0ebccbd370af575d36d821c7823dfae39dea8e9d7d88de7baf99bbf12db6e5e5 |