Skip to main content

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

  1. recursively clone the repo
  2. cd to repo dir
  3. ensure the correct virtualenv is activated
  4. pip install -e .

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

Uploaded CPython 3.6mWindows x86-64

openmesh-1.1.2-cp35-cp35m-manylinux1_x86_64.whl (622.8 kB view details)

Uploaded CPython 3.5m

openmesh-1.1.2-cp35-cp35m-macosx_10_13_x86_64.whl (700.5 kB view details)

Uploaded CPython 3.5mmacOS 10.13+ x86-64

openmesh-1.1.2-cp27-cp27mu-manylinux1_x86_64.whl (624.8 kB view details)

Uploaded CPython 2.7mu

openmesh-1.1.2-cp27-cp27m-macosx_10_13_x86_64.whl (700.8 kB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

Details for the file openmesh-1.1.2.tar.gz.

File metadata

  • Download URL: openmesh-1.1.2.tar.gz
  • Upload date:
  • Size: 8.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for openmesh-1.1.2.tar.gz
Algorithm Hash digest
SHA256 bf63ee95d93e20c8ba9d5451014a912c701b4b5f8857b495ab40cda4fb61aca0
MD5 6905c4a7d71c573cc1d5ede61ac86e3f
BLAKE2b-256 5e98140c27b6279263c40440a85d0d106e97c886b707e180ac6c5c1ca0b1afb7

See more details on using hashes here.

File details

Details for the file openmesh-1.1.2-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for openmesh-1.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 fe450584cac527270f55c1eaabea1ce14a9ee7818842daf635aa8a99318c8587
MD5 3801e30e54b5f0ce8794992f6dc20496
BLAKE2b-256 ba37f955658277aeb4d51f0252b60d3e1969cd66ab9aea16924cc6eaac6d695a

See more details on using hashes here.

File details

Details for the file openmesh-1.1.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 87950c0a0d923f07982defca3cc2f0ea7c2e705910421409360da1b7cc2587c8
MD5 f9daead468e018920280bb4bf920c035
BLAKE2b-256 07e3b13821f99e0e92f2439f374657d0e67f7edc92b6ad346cb9abec56ae66d1

See more details on using hashes here.

File details

Details for the file openmesh-1.1.2-cp35-cp35m-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.1.2-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 83a4be23f39cfb644e0bde3a42751c84b1c7add9effbd733ea50b8318717be35
MD5 2856993eb93b0dbd86b6a3b6cabba9a5
BLAKE2b-256 8014699747b051bf192490ff98d374083df1f6c9044b4dc63684d6beb10f362e

See more details on using hashes here.

File details

Details for the file openmesh-1.1.2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7e2a65cd56be889b075d38287e1b62d7386dc92d804b56ae576b761185706d9b
MD5 7c606b3f7ef48a7443c8134bcfa02d50
BLAKE2b-256 56da36e74908b973e2180518083241a26f27ddaee2c2a26a0b25a72544b2da3c

See more details on using hashes here.

File details

Details for the file openmesh-1.1.2-cp27-cp27m-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for openmesh-1.1.2-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9e17af4e324e9c1d0ac63376fa104e676f6ab0f86edbee4422476ab6121ebf0d
MD5 2ee7d9aac8dc66abe86bb6ecca00749e
BLAKE2b-256 435d0d14b829843b01aa3beb6a951d33cc5a13774c3898ccf4830f3d3b36916b

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