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

Using conda

Thanks to Martin Drawitsch you can also install openmesh-python via conda:

conda install -c conda-forge openmesh-python

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.4.post18.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.4.post18-cp37-cp37m-win_amd64.whl (499.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl (636.2 kB view details)

Uploaded CPython 3.5mmacOS 10.13+ x86-64

openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl (632.6 kB view details)

Uploaded CPython 2.7mu

openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl (636.3 kB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

Details for the file openmesh-1.1.4.post18.tar.gz.

File metadata

  • Download URL: openmesh-1.1.4.post18.tar.gz
  • Upload date:
  • Size: 8.9 MB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for openmesh-1.1.4.post18.tar.gz
Algorithm Hash digest
SHA256 1ae2b83086c63859ae53dcb85664ab9b6df4245acb7986377c230524abe9169d
MD5 f3150db627655b5934e9f17f2b4feb8c
BLAKE2b-256 b2aa5108cafb9c7892f85371c9f5e17ad78491bab9252e3cbd803364a651ab06

See more details on using hashes here.

File details

Details for the file openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 499.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for openmesh-1.1.4.post18-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 895e6fdd23b4bc44e5989ae6c820205a9e913e48dd589a90c6a48ee810771156
MD5 8a6cbcfd67c40db17920ed40c703996b
BLAKE2b-256 dc659920162c42f452a0d5c834321b0207b02557723ec4939e0033fe0bab5929

See more details on using hashes here.

File details

Details for the file openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 636.2 kB
  • Tags: CPython 3.5m, macOS 10.13+ x86-64
  • Uploaded using 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

File hashes

Hashes for openmesh-1.1.4.post18-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2aa05f39ed498b4c78eb8adc6bb131506e278eec7aac3b7cfdfbb1f0a6900d81
MD5 10890750d9dbaa23e407c137600a0702
BLAKE2b-256 918e9e1531fdd1d9a1fb304b713dc530fd07c998f36d31f7ba28eb6388bc421a

See more details on using hashes here.

File details

Details for the file openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 632.6 kB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for openmesh-1.1.4.post18-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b0629a40bbf60b4e9e2c794aaccbd53aca7f9f24c62575c651037545dc13255b
MD5 53eeb7633bd2c8f184e98a906754b276
BLAKE2b-256 49bba9a519f6e5b8ce004fd002efb08613bb9938e7b2db7b45a130bb01751d73

See more details on using hashes here.

File details

Details for the file openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 636.3 kB
  • Tags: CPython 2.7m, macOS 10.13+ x86-64
  • Uploaded using 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

File hashes

Hashes for openmesh-1.1.4.post18-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6691d3d9906f4329a76ae2b58f8b538f04cc81229a8cac2b09169b7c1a903086
MD5 04fbf7025221fa47ec25d6720dabac1f
BLAKE2b-256 1dca171f43ef2033e40fad2c4917e7b3f336bb5b9ea2e36cda1024c19cfb1f41

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