Skip to main content

Python bindings for ADMesh, STL maipulation library

Project description

https://img.shields.io/pypi/v/admesh.svg https://img.shields.io/travis/admesh/python-admesh/master.svg https://img.shields.io/github/license/admesh/python-admesh.svg?style=flat https://img.shields.io/pypi/pyversions/admesh.svg https://img.shields.io/pypi/implementation/admesh.svg

This module provides bindings for the ADMesh library. It lets you manipulate 3D models in binary or ASCII STL format and partially repair them if necessary.

Installation

There are wheels available for Linux and macOS X. All you need to do is:

pip install admesh

If you have a platform not supported by the above, you’ll need to install the C ADMesh library.

This release is designed for ADMesh 0.98.x. Follow the instructions there. Then you can install this as usual with one of the following:

./setup.py install
python3 setup.py install # for Python 3
pip install admesh # install directly from PyPI

In case your ADMesh library is located in non-standard location, you’ll have to tell the compiler and linker where to look:

LDFLAGS='-L/path/to/library' CFLAGS='-I/path/to/header' ./setup.py install

Usage

Use the Stl class provided.

import admesh

# load an STL file
stl = admesh.Stl('file.stl')

# observe the available methods
help(stl)

# read the stats
stl.stats

# see how many facets are there
len(stl)

# walk the facets
for facet in stl:
    # get the normal
    facet['normal']
    # walk the vertices
    for vertex in facet['vertex']:
        # read the coordinates
        vertex['x']
        vertex['y']
        vertex['z']

# add another set of facets
# every facet is a tuple (vertices, normal) or a dict
stl.add_facets([
    (((0, 0, 0), (0, 1, 0), (0, 0, 1)), (1, 0, 0)),
    {'vertex': [{'x': 0, 'y': 0, 'z': 0},
                {'x': 1, 'y': 0, 'z': 0},
                {'x': 0, 'y': 0, 'z': 1}],
     'normal': {'x': 0, 'y': 1, 'z': 0}},
])

Note that all C ADMesh functions start with stl_ prefix and the Python methods of this module do not. Also note that not all C ADMesh functions are provided, because some would require more complicated approach and are not considered worthy. In case you are missing some functions, create new issue.

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

admesh-0.98.9.tar.gz (16.5 kB view details)

Uploaded Source

Built Distributions

admesh-0.98.9-cp37-cp37m-manylinux1_x86_64.whl (205.0 kB view details)

Uploaded CPython 3.7m

admesh-0.98.9-cp37-cp37m-manylinux1_i686.whl (188.3 kB view details)

Uploaded CPython 3.7m

admesh-0.98.9-cp37-cp37m-macosx_10_6_intel.whl (94.7 kB view details)

Uploaded CPython 3.7m macOS 10.6+ intel

admesh-0.98.9-cp36-cp36m-manylinux1_x86_64.whl (204.9 kB view details)

Uploaded CPython 3.6m

admesh-0.98.9-cp36-cp36m-manylinux1_i686.whl (187.8 kB view details)

Uploaded CPython 3.6m

admesh-0.98.9-cp36-cp36m-macosx_10_6_intel.whl (94.9 kB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

admesh-0.98.9-cp35-cp35m-manylinux1_x86_64.whl (203.8 kB view details)

Uploaded CPython 3.5m

admesh-0.98.9-cp35-cp35m-manylinux1_i686.whl (186.9 kB view details)

Uploaded CPython 3.5m

admesh-0.98.9-cp35-cp35m-macosx_10_6_intel.whl (95.0 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

admesh-0.98.9-cp34-cp34m-manylinux1_x86_64.whl (207.6 kB view details)

Uploaded CPython 3.4m

admesh-0.98.9-cp34-cp34m-manylinux1_i686.whl (189.3 kB view details)

Uploaded CPython 3.4m

admesh-0.98.9-cp34-cp34m-macosx_10_6_intel.whl (101.9 kB view details)

Uploaded CPython 3.4m macOS 10.6+ intel

admesh-0.98.9-cp27-cp27mu-manylinux1_x86_64.whl (185.2 kB view details)

Uploaded CPython 2.7mu

admesh-0.98.9-cp27-cp27mu-manylinux1_i686.whl (168.9 kB view details)

Uploaded CPython 2.7mu

admesh-0.98.9-cp27-cp27m-manylinux1_x86_64.whl (185.1 kB view details)

Uploaded CPython 2.7m

admesh-0.98.9-cp27-cp27m-manylinux1_i686.whl (168.9 kB view details)

Uploaded CPython 2.7m

admesh-0.98.9-cp27-cp27m-macosx_10_6_intel.whl (100.8 kB view details)

Uploaded CPython 2.7m macOS 10.6+ intel

File details

Details for the file admesh-0.98.9.tar.gz.

File metadata

  • Download URL: admesh-0.98.9.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for admesh-0.98.9.tar.gz
Algorithm Hash digest
SHA256 2ce7db7dc38b957f0e31de9bf554fdc8bedaf59e41a53dec548c17530ec7f639
MD5 65a46fff7bc83cd044c972642311872a
BLAKE2b-256 be1865160f0b5c6b2e08627ea96dc6f1b65a99898b9caddd8f97f47b338491a8

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c8d09cda35211fa1f6106674d255a08a0d75e12eb98160557b8df13c8583ba37
MD5 7374d8da1a50723903848938632cf296
BLAKE2b-256 abf65b4e1c43f99d0a963bae3af01903c8df05e388904d9920b8b7619cb5bc74

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp37-cp37m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 bb618e1ca75795ac7aaa7940d9e9f1d4709c32b364004f3b764249136e1e70cc
MD5 9f757886e2d94c54c33159a92634a2f3
BLAKE2b-256 02f45165b7ee62707ffc51351c4f93ca77f44a31dd9b4977e0cf4d92a4e5a474

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp37-cp37m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp37-cp37m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 c6440dc004543c30a1256cf2293b71e72c792a0dfd043716c0d3dca7b32b7bcc
MD5 2112924faf7cf529089f6a5a8544fd6e
BLAKE2b-256 b4c8636bb1a182d96027f31cc86a6f231d5916553135026e7ffa79f4dd3f1c95

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 43a86d675a1002a505bf9217fee2cb06b7df43fb6c47d81259b8b8ac91aa9917
MD5 c6f66fb296101a942132bd93102dc37b
BLAKE2b-256 bebae2e1227897cd52eb4dd3d259b233128a65b74dfd6dd2adbd84b1237db97a

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 3608d5f58c894d80e61833f9443efcfb7776f4a9daf55ca9a4dcddfe37729bf5
MD5 b416b0fbaa1a346646a7ec702051cd72
BLAKE2b-256 b9f11b8c67d251665a6e23f998e77b5952d2cbc13c22c6687daa16fb13de7d57

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 79eb8f4fae6d865118552fb7f7236cdee09dac510445770f4c45a9ade8531ca8
MD5 f2c1cd4e4c5b2f07bffe27b0a1c19ee8
BLAKE2b-256 23fab7679b8569fe64db07d5cd9ebccdda43cb6f6bc5a5a8dfcd4d83316df3bb

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0c23d05101aaf11a51dbe2c5cb280886bcbaf29b1a988c1e7a9d471b4ead22bb
MD5 20fea168e1a41b7fdfc0019b408ae1f4
BLAKE2b-256 1b2bd2656a5dd06fac9471c140d4fd6fa66bd654fe809045962c405ca430b861

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp35-cp35m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 41d426653471ca741a957dc84e84708b94b3408cbcbcd8281a482e8f7503a01a
MD5 2ab468c14d3e2b01bdffbb9838c06edf
BLAKE2b-256 9a2ec03100b39f2ca61d89117294069ba82c43b2754ebe8ffbca9945f60e4d75

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 55228137681c220600c84cc8bb46d321162a67154c67a8f317bcb441c33d7790
MD5 6112b439fbf0a7a7076d0e824ad5840c
BLAKE2b-256 ccfe6217b46746e4df0617f8402cb668dcfbacf2713f2587b5147016a75399ee

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0f9b563b72c43f6da0f248bcb4dbde0b6eb75c9ebd2a03b54b04e048b8eb004e
MD5 877007ece903e5571b5e71050893aedc
BLAKE2b-256 f1e66cfe957103820b558661b6a2a029ae34527e5c4c54eedd057134dc42d5d9

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp34-cp34m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 19470eab5a72a40f0e7595abcb2483382043f25a6283be34e3af5dd5fc7360e3
MD5 9b49498cf6eb1520aa5d743385a0aca8
BLAKE2b-256 bfa03490cda0f3a765e509c780103741652ad47eef45bb1b9fae2f8f1083e23d

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp34-cp34m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 89e3eef0038d3c3eac97bb0de207c3267375756dfe5472616896017fa9f66e38
MD5 75e6cbf7c06a0556bafa5002a0dc6984
BLAKE2b-256 7bb7e152a73bbcc3de02e5a84a7c7567f51ad336710c78e58d654a921de666b8

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2b03be7cac244068d80bb3c564edcbaca7c8486111f3266fd53e7aea0ae9a0f7
MD5 9799af45620f56b4f487068fd01ef98d
BLAKE2b-256 5bb7ff73b4182b5008faf8f66f71463cd0ed0f4b4959457e5a829b2bdd79758d

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 21c9b058ac03f6ffec08a89d41842462216aa2a22010203caa89ec0b8dca2265
MD5 effedcd7f6dbe4c3eba83a5141c2e4e3
BLAKE2b-256 e9cd0222b14f22ea978134c35ea287aa076fea2d98d5e2dbe8a070bb23600ebf

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d3bce239a44ddcbde4f0e4e4f1dc6a529507fe0b24e5af6f45ea5c1d7650b517
MD5 37c26f96988ea80f64fe3e001513b2c8
BLAKE2b-256 49085cac45f81e3b343b2de43378d137e505bad247ece694d5736209fd81fb17

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 398d31d505be5569345fe28d0bec9917aed74a78e8fec5870002de0b69974280
MD5 749de86f2d1cb887396d03f4fccfd057
BLAKE2b-256 333d2abf1a7fe120262a092a7e57a5214418f794074f8176485dba0300e227db

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.9-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for admesh-0.98.9-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 b41ddfc57db9239b19b48a22c5cae34d1199203854fe46c95e9c00f939e72d1f
MD5 63896c0ca534fcba9550c6adb70c32ce
BLAKE2b-256 bfc91eac76ea5e1cc8929dc47216d7166056aceb30b1a24a3e06a2e656ccf915

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page