Skip to main content

a versatile halfedge data structure for representing and manipulating polygon meshes

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.post34.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.post34-cp36-cp36m-win_amd64.whl (526.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

openmesh-1.0.0.post34-cp35-cp35m-manylinux1_x86_64.whl (605.9 kB view details)

Uploaded CPython 3.5m

openmesh-1.0.0.post34-cp35-cp35m-macosx_10_13_x86_64.whl (683.9 kB view details)

Uploaded CPython 3.5mmacOS 10.13+ x86-64

openmesh-1.0.0.post34-cp27-cp27mu-manylinux1_x86_64.whl (607.5 kB view details)

Uploaded CPython 2.7mu

openmesh-1.0.0.post34-cp27-cp27m-macosx_10_13_x86_64.whl (684.2 kB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34.tar.gz
Algorithm Hash digest
SHA256 9c8c36d9435ff8963e1acb4409057c1ada2464f2f87d7f441e5a5aab0b685b82
MD5 91b07f03eb6610afb72596acd03f55a3
BLAKE2b-256 072f8012710c6f020c2434f155359fa86efa8c1a902fc640bc7dc0cbabec096c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 4206d2964b2352333a13e89240c3373612fec7f85e956154efad2106210f81fe
MD5 a1df3baeb32c18d2355b3482dbaf2bcb
BLAKE2b-256 1b7fe7cb64388bc7797dd54319fb4b6a5b66c710a55a96894ff90f1cbe080296

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b0caac433686d0f94c1454acc11e1d6cb9f55b7986adcdebb586ae8c47dad71b
MD5 07a9bcc9fd23f9cfc683f34aa1badeaa
BLAKE2b-256 b81c20d68dca6453e161cbb9f0f3f43d6f1af722d23382ecda0dee0f51fd4204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 02034e47785b0a9a6ea21f66b0b5aa215509c8747411ba1a21d1dad7d176b8b0
MD5 c946e44aaecc80a17b04fb3093550648
BLAKE2b-256 981e3e2b1b2d541ed2e86d3d1aa6c38d30c2d6083c4ae49811c000c22d51eeff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8c1573b4fa6963464e119e73881e6d2dcc2881e6095bf466b7becac64c23439c
MD5 85fc23f5809edef6b5deffce94136b2b
BLAKE2b-256 683136a0e97cd27668a2658756ab12dc17ca56ae163017f1db5a1f0663bb9692

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.0.0.post34-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 dd828577593de8f98bdcb7bed9e3a2fc7790fab1e3f1e60db770c00b5f6c0f99
MD5 861ff7de5e8b81a85ef038961e153f76
BLAKE2b-256 990fb8f0b3d3c20076a0d5e41b8aff7cce2d909ff3c31e0026b0b0c7a070bad2

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