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.8.tar.gz (16.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

admesh-0.98.8-cp36-cp36m-manylinux1_x86_64.whl (224.7 kB view details)

Uploaded CPython 3.6m

admesh-0.98.8-cp36-cp36m-manylinux1_i686.whl (207.8 kB view details)

Uploaded CPython 3.6m

admesh-0.98.8-cp36-cp36m-macosx_10_6_intel.whl (110.0 kB view details)

Uploaded CPython 3.6mmacOS 10.6+ Intel (x86-64, i386)

admesh-0.98.8-cp35-cp35m-manylinux1_x86_64.whl (223.5 kB view details)

Uploaded CPython 3.5m

admesh-0.98.8-cp35-cp35m-manylinux1_i686.whl (207.1 kB view details)

Uploaded CPython 3.5m

admesh-0.98.8-cp35-cp35m-macosx_10_6_intel.whl (109.8 kB view details)

Uploaded CPython 3.5mmacOS 10.6+ Intel (x86-64, i386)

admesh-0.98.8-cp34-cp34m-manylinux1_x86_64.whl (230.5 kB view details)

Uploaded CPython 3.4m

admesh-0.98.8-cp34-cp34m-manylinux1_i686.whl (214.0 kB view details)

Uploaded CPython 3.4m

admesh-0.98.8-cp34-cp34m-macosx_10_6_intel.whl (109.7 kB view details)

Uploaded CPython 3.4mmacOS 10.6+ Intel (x86-64, i386)

admesh-0.98.8-cp33-cp33m-manylinux1_x86_64.whl (212.0 kB view details)

Uploaded CPython 3.3m

admesh-0.98.8-cp33-cp33m-manylinux1_i686.whl (197.7 kB view details)

Uploaded CPython 3.3m

admesh-0.98.8-cp27-cp27mu-manylinux1_x86_64.whl (206.7 kB view details)

Uploaded CPython 2.7mu

admesh-0.98.8-cp27-cp27mu-manylinux1_i686.whl (191.9 kB view details)

Uploaded CPython 2.7mu

admesh-0.98.8-cp27-cp27m-manylinux1_x86_64.whl (206.7 kB view details)

Uploaded CPython 2.7m

admesh-0.98.8-cp27-cp27m-manylinux1_i686.whl (191.9 kB view details)

Uploaded CPython 2.7m

admesh-0.98.8-cp27-cp27m-macosx_10_6_intel.whl (109.6 kB view details)

Uploaded CPython 2.7mmacOS 10.6+ Intel (x86-64, i386)

File details

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

File metadata

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

File hashes

Hashes for admesh-0.98.8.tar.gz
Algorithm Hash digest
SHA256 d5529b8c7799b6cf776e03aa5489e245c17de6c34cfc323336246c62932db1ca
MD5 0c57d9cc5c4e970ad73f68cf7db0ec77
BLAKE2b-256 98666090d5dac0de55db31d8ae643b4c2ef4160db93d20e17d670d6dbf9fda26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9d4adbd668ca74baf016937675dd7d1f2bd12e6013634c293722a62aa08dff6c
MD5 5dab05300a7e7284f7a885d6a919f4fc
BLAKE2b-256 02ca403c2bf81f85db0a26c5fd3a44bd0a33e44162b0340103918dbb0e94e2c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 1a61d8a1b75b189bb9c8d2b865f3726af10859c1546c74370758f4c575c4a8cf
MD5 3c7c92aabca75745b56cff3ca0be96e2
BLAKE2b-256 7cd7e879cb5564a59b0b24f7ca19596a7aa931ae459c8550f0ef44d4fde51e9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 459870d731710573a917677adb38e64f9151a3606697627e533f3b4c13167b02
MD5 fa8e6266a3af1f4ea6c0bedd1dcbb513
BLAKE2b-256 1ba1f3ce042fdbc3907f43347471cf828b1a177ea666ff0d58432236b9dbfc86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 82ba14a0bce1cba4c7e4cf277c67a728c03fc6aca688c1f163e98d75440cc82d
MD5 0c42a1a0285d2da0dbb5050d074e6b55
BLAKE2b-256 d11fa3387b83d23b7849eb3d3f11ff59548ba57f9f35b812a2c5997f8b063361

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp35-cp35m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4c9765d451c4846b282f339cce9a6ee40a2dcf123d27ea0870508414d564852f
MD5 7dd0f41920e48511dfd52ec1017e78cf
BLAKE2b-256 cdf898ae3259b8fa55f46a5dc21b01763f56dd62b13c50f6c66ab740445d9dfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 4ff57b02d03c7d319786366385502819b5911afeec9754239beadc42c7611b1a
MD5 ed74adccf43e6a3c4a823b3067db4c39
BLAKE2b-256 ca47e579cd6e7267284a4a7a24fffcabbb4d36a156e17722d447975df24d3485

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3881a0ec6bf472f70b8ac440dc5299a64c6cb94e1ecf732b9415187cb81f1f75
MD5 65f501a0cb298d05fbd0a24bff963dc5
BLAKE2b-256 5791783d8d06539eff03462fa117b737c69877f04a22256b1e8081286cd7cfc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp34-cp34m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 0a93136169c1ce86a2a9e299bd1d09ac0608a11c31f88378069d3976e3549daf
MD5 101f3f408b285ff674620d0e7989e401
BLAKE2b-256 857bc825ba66c487dd591260b4f76a658947956cfefa0d41ac18e736fb009e64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp34-cp34m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 2750d4c9ce109d52daaa12af4d827416588e0134ae39557dc917c584d966d932
MD5 976842d4385e2433e790b5b8cf5eeca0
BLAKE2b-256 6ec5b095054f8d8df764d330ecdf07ea0606bf4024ef6c1501f09c673a4d553e

See more details on using hashes here.

File details

Details for the file admesh-0.98.8-cp33-cp33m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for admesh-0.98.8-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 925537c877777092661a5fd987286839ee6bce055a65bba543b8ffdcd6faa0a3
MD5 2ddb32837bb6fda9e52cef93ae64b495
BLAKE2b-256 3698e35604f3c68660d927903f17876e0ab4fe9154f7daa23d076d880d1fa38b

See more details on using hashes here.

File details

Details for the file admesh-0.98.8-cp33-cp33m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for admesh-0.98.8-cp33-cp33m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 8924fe7ebc6ca36f4b0f737baec62ecf50f64f633f98764378cfc62a5dbcbd52
MD5 ff7fd21ecb306281ad8ed62f43c37331
BLAKE2b-256 68c589945c8cdabdfe3f06316a98fdc8f23e5faf5f32824292f924fae27e5907

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9f75f9e29cf0b5d27187fb75156a05c7e7436a5afd3264f2be7a0e609b8cedc8
MD5 7442af0a88441839fcef6b7324cb26c2
BLAKE2b-256 03294cd204c11991f20ff78fb7f243d34808a92eafbb6c82e73c5a911b28bfa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 315e4ed087fc299fd8f974f1c49a68f1a949ddfd9283b31a88936cf38b2ad46d
MD5 ad5934281090b36aaf7077b0feebb907
BLAKE2b-256 f0ed753ac1f78d4ae6efd50a765302b147165efd67b744dbbc40e6b74db9beba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ece051d6e07660cd71bd30b0c2ea912c749c58959a5a267e4dbd7d15ccb1a05f
MD5 74a3681127d1909e41aaf2b384e87192
BLAKE2b-256 f6c3c7b661870c2d2c2fb275d235a5440fd37cdaddca9acfad240dfa043a3744

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 e1af5df69f73fc18d4931730f9fbffcce4e67452bc0c3925ee7a79d6d75d7030
MD5 7cf54f738c591019613efe5816fcc450
BLAKE2b-256 327eeb47a3088dcd32e2323b8eeee7c866b0a9cc6514dcd2ee23da7b4bdf43cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.8-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 31f0c6f95e4f3a76bd28104f57d5155e4e1fbf4cbdfd1699fd58f48f78488f4a
MD5 0ad8ce626cb650b567d82a223a3bb596
BLAKE2b-256 880c12c2079ca9eca7cbe35eef016fbac6b6645bf26900695586a59d42850592

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