Skip to main content

Python bindings for OpenMesh.

Project description

OpenMesh Python Bindings

OpenMesh Python bindings implemented with pybind11 that are tightly integrated with numpy.

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

  1. recursively clone the repo
  2. cd to repo dir
  3. pip install -e . (or pip install -e . --user if you are not root or in a virtualenv)

Project details


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.0.0.post28.tar.gz (8.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openmesh-1.0.0.post28-cp36-cp36m-win_amd64.whl (492.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

openmesh-1.0.0.post28-cp35-cp35m-manylinux1_x86_64.whl (562.1 kB view details)

Uploaded CPython 3.5m

openmesh-1.0.0.post28-cp35-cp35m-macosx_10_13_x86_64.whl (604.6 kB view details)

Uploaded CPython 3.5mmacOS 10.13+ x86-64

openmesh-1.0.0.post28-cp27-cp27mu-manylinux1_x86_64.whl (562.1 kB view details)

Uploaded CPython 2.7mu

openmesh-1.0.0.post28-cp27-cp27m-macosx_10_13_x86_64.whl (604.9 kB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

Details for the file openmesh-1.0.0.post28.tar.gz.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28.tar.gz
Algorithm Hash digest
SHA256 9ddb752bf238c01baa1ba9d31f0bd1fbf6aea378dc4eca6d2cb126899ae77da3
MD5 a8a32c217a68ade82f1a2358e1e2d8d2
BLAKE2b-256 efd71f0bcc780728799f7b49c685af913778683c8900fbdc5ac9f5b1f33ab61f

See more details on using hashes here.

File details

Details for the file openmesh-1.0.0.post28-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c6dffc65c1acb8c87951df5a0875637e99b02c7d9dec8c531eb5f6a5db0c1dbf
MD5 7bb37eff3d1d811968250b3d90559d57
BLAKE2b-256 e19ed0917a6fb3bd31744c28349e87e169266656a7d83f28cc5ac0ceeb084955

See more details on using hashes here.

File details

Details for the file openmesh-1.0.0.post28-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ab5437e10d80e7933fc9268715f6aa6e00c778c5f2b2a85fce1c42b24f4d53d8
MD5 0b957fb8efd4c895f8aa8c8fc0f92c29
BLAKE2b-256 22b28b7fcab045879d757518055b22a20820ec161acae547b35da8f64be91237

See more details on using hashes here.

File details

Details for the file openmesh-1.0.0.post28-cp35-cp35m-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8df1ecb938afb36ec011ce0b32a7d1fbab74c66150b9fc51a63a2222a1f1e1ff
MD5 791c9bde9272665d9fc8be8f4ffdeac9
BLAKE2b-256 8a9e6e6dff76c5097ace12cb41e702929f7e99295bac5a45a9ff91d61a83e987

See more details on using hashes here.

File details

Details for the file openmesh-1.0.0.post28-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3c3d042e64c9554e37ce6969abeba15cf6919ad492735c27a7f438a3511e1f4b
MD5 de5e76d651e9aa0084c393979e303df0
BLAKE2b-256 a471f5018f9d287d3d07266721ffc170a3051e0e5996d1b1236fac21574816bf

See more details on using hashes here.

File details

Details for the file openmesh-1.0.0.post28-cp27-cp27m-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.0.0.post28-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 076973f8d3da2086c31565095385cd494867adde8f560c6fa81744ce2062d096
MD5 50d296c05f99c610102e5d364c3a38e1
BLAKE2b-256 50d8f0eb2ac10a1cc0605ffe4717336b89a33d8eb436ff8877ff3a546bc49749

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page