a versatile halfedge-based data structure for representing and manipulating polygon meshes
Project description
OpenMesh Python Bindings
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
Prebuilt Binaries
We provide prebuilt wheels for manual installation with pip
for the following configurations:
Linux
macOS 10.13
Windows
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
openmesh-1.1.1.tar.gz
(8.9 MB
view hashes)
Built Distributions
Close
Hashes for openmesh-1.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09537149f181d4c887977208313abffda9fba929f94c158e9719cfe7c15b4eaf |
|
MD5 | 9d3d8cb944144a8aec6136a72390e9ae |
|
BLAKE2b-256 | f7c9266b07ea8b635ab5ea23e9a8934b44bf7bff6aa9fbfb7da0bb8ee2be570e |
Close
Hashes for openmesh-1.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a40a665897c9681be64eb7c0192dd0d4fa77889933bfa7a5d5a678233057b62 |
|
MD5 | 6bef17c6ce147f4e3a2e3c13c1f29e4a |
|
BLAKE2b-256 | 835834cd63579f25eca02e7243d886c54ca5e66ec8090e32253743e2fd029ea0 |
Close
Hashes for openmesh-1.1.1-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57a7291ca75c003c6adda68a0464807433b71e1865bc57e92b895106fc4da9b2 |
|
MD5 | 9062c2cf0d607043c3a2e9aed26ca240 |
|
BLAKE2b-256 | b5bd1b8af4fa7883c61cd06b0252c5d1615d37ef99014efdc892101e96c9ff83 |
Close
Hashes for openmesh-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 195c61e924a8143aa987a4771d78324a7ef4aa2f1ca102e03ea01341aaf6afb5 |
|
MD5 | 9ee31e4c1cc710cd1a601b599e81bb36 |
|
BLAKE2b-256 | e458a8a2fe7dcd7e141bac7a86a235c2cebf4d7d5a14e5e0710aad4f369971b6 |
Close
Hashes for openmesh-1.1.1-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fea39b7f3bec726f64a910b6b63d716c2ecdc7a1bf8f450c30a8bfe65f005d2 |
|
MD5 | 3c448597ab4a3e610c98b53ace2e8397 |
|
BLAKE2b-256 | c0c82a210ca41e37baa44b78bd1e26963138c357f899966b28599481880a79a4 |