Skip to main content
Help us improve Python packaging – donate today!

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)

Release history Release notifications

History Node

1.1.0

History Node

1.0.0.post34

This version
History Node

1.0.0.post28

History Node

1.0.0.post22

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
openmesh-1.0.0.post28-cp27-cp27m-macosx_10_13_x86_64.whl (604.9 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 21, 2018
openmesh-1.0.0.post28-cp27-cp27mu-manylinux1_x86_64.whl (562.1 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 21, 2018
openmesh-1.0.0.post28-cp35-cp35m-macosx_10_13_x86_64.whl (604.6 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 21, 2018
openmesh-1.0.0.post28-cp35-cp35m-manylinux1_x86_64.whl (562.1 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 21, 2018
openmesh-1.0.0.post28-cp36-cp36m-win_amd64.whl (492.6 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 21, 2018
openmesh-1.0.0.post28.tar.gz (8.9 MB) Copy SHA256 hash SHA256 Source None Mar 21, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page