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

Uploaded CPython 3.6mWindows x86-64

openmesh-1.1.0-cp35-cp35m-manylinux1_x86_64.whl (606.5 kB view details)

Uploaded CPython 3.5m

openmesh-1.1.0-cp35-cp35m-macosx_10_13_x86_64.whl (682.0 kB view details)

Uploaded CPython 3.5mmacOS 10.13+ x86-64

openmesh-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl (606.9 kB view details)

Uploaded CPython 2.7mu

openmesh-1.1.0-cp27-cp27m-macosx_10_13_x86_64.whl (682.2 kB view details)

Uploaded CPython 2.7mmacOS 10.13+ x86-64

File details

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

File metadata

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

File hashes

Hashes for openmesh-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a10e1be6a346b28c175517d1fc0248d5da90fe5143cee1559386b71a47a35816
MD5 53878d829afc4c4960a009e1651060ae
BLAKE2b-256 ab567142b4db4149331ea788215c94f58829ebdd451bd94419b61d4fb6ad52ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a041af79a4145547ff856d8c79e5a3f6a82aaff5f67d789e6cf6e15e5059591b
MD5 016491ea87c8578bf91155032e8ac18d
BLAKE2b-256 8db40655293527203aa129b56b0da0d7e77d4ad2db4cb4e2b3e5372881084066

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 66f526366eadf837d5356f34c04018f2f53bdf379917d7de81a5d5b8418f6d7d
MD5 0473f83da848175b313f1f2f436647e6
BLAKE2b-256 7cb7b11b08f935de99ff6929f731338d9e582c772be4034882227523a48d5fa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.1.0-cp35-cp35m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b0c2017539d16fb5f068da163962699b96f8f9538ebe3ae1d1f4aa57607d1954
MD5 78d5ef6ab9439fb9ad92e2db9523654c
BLAKE2b-256 ee68364a78234d79a61ced79f924305270050185f2ae86af026eeec9739aed7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 79312c59b885e7337c0a768478fca9201517e60676377f5291a44352cf2171e8
MD5 86a632c7ff769dab6835e432c9f80dcf
BLAKE2b-256 b479d2792b8c51754b81ed5c849b11820f069b8396a9ee9e9dcca273753de47f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openmesh-1.1.0-cp27-cp27m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 653e3e7732051f523941780793fe6b613af098b1132538b691aa3fcbe6aa9c8d
MD5 496a36b8d0281456f9c945b96fc72046
BLAKE2b-256 2c51179b68f5e7c0ee11efbf0b93e0e144da5a6e2f4d821694f2ad9492262ed2

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