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
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
cdto repo dir- ensure the correct virtualenv is activated
pip install -e .
Metadata
Release files for openmesh 1.1.4.post18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openmesh-1.1.4.post18.tar.gz | 8.9 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details |
| openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl | CPython 3.5 | CPython 3.5 pymalloc | macOS 10.13+ x86-64 | Details |
| openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl | CPython 2.7 | CPython 2.7 pymalloc wide-unicode | Linux glibc 2.5+ x86-64 | Details |
| openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl | CPython 2.7 | CPython 2.7 pymalloc | macOS 10.13+ x86-64 | Details |
Total release size: 11.3 MB
Release files / openmesh-1.1.4.post18.tar.gz
| Download URL | openmesh-1.1.4.post18.tar.gz |
|---|---|
| Size | 8.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ae2b83086c63859ae53dcb85664ab9b6df4245acb7986377c230524abe9169d
|
|
BLAKE2b-256 checksum How to use checksums |
b2aa5108cafb9c7892f85371c9f5e17ad78491bab9252e3cbd803364a651ab06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
|
Release files / openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl
| Download URL | openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 499.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
895e6fdd23b4bc44e5989ae6c820205a9e913e48dd589a90c6a48ee810771156
|
|
BLAKE2b-256 checksum How to use checksums |
dc659920162c42f452a0d5c834321b0207b02557723ec4939e0033fe0bab5929
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
|
Release files / openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl
| Download URL | openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl |
|---|---|
| Size | 636.2 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
2aa05f39ed498b4c78eb8adc6bb131506e278eec7aac3b7cfdfbb1f0a6900d81
|
|
BLAKE2b-256 checksum How to use checksums |
918e9e1531fdd1d9a1fb304b713dc530fd07c998f36d31f7ba28eb6388bc421a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
|
Release files / openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl
| Download URL | openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl |
|---|---|
| Size | 632.6 kB |
| Tags | CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
b0629a40bbf60b4e9e2c794aaccbd53aca7f9f24c62575c651037545dc13255b
|
|
BLAKE2b-256 checksum How to use checksums |
49bba9a519f6e5b8ce004fd002efb08613bb9938e7b2db7b45a130bb01751d73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
|
Release files / openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl
| Download URL | openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl |
|---|---|
| Size | 636.3 kB |
| Tags | CPython 2.7 CPython 2.7 pymalloc macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
6691d3d9906f4329a76ae2b58f8b538f04cc81229a8cac2b09169b7c1a903086
|
|
BLAKE2b-256 checksum How to use checksums |
1dca171f43ef2033e40fad2c4917e7b3f336bb5b9ea2e36cda1024c19cfb1f41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
|