Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python bindings for ADMesh, STL maipulation library

Project Description

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.

Release History

Release History

This version
History Node

0.98.8

History Node

0.98.7

History Node

0.98.6

History Node

0.98.5

History Node

0.98.4

History Node

0.98.3

History Node

0.98.2

History Node

0.98.1

History Node

0.98

History Node

0.98a1

History Node

0.96

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
admesh-0.98.8-cp27-cp27m-macosx_10_6_intel.whl (109.6 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 20, 2017
admesh-0.98.8-cp27-cp27m-manylinux1_i686.whl (191.9 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 20, 2017
admesh-0.98.8-cp27-cp27m-manylinux1_x86_64.whl (206.7 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 20, 2017
admesh-0.98.8-cp27-cp27mu-manylinux1_i686.whl (191.9 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 20, 2017
admesh-0.98.8-cp27-cp27mu-manylinux1_x86_64.whl (206.7 kB) Copy SHA256 Checksum SHA256 cp27 Wheel Sep 20, 2017
admesh-0.98.8-cp33-cp33m-manylinux1_i686.whl (197.7 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Sep 20, 2017
admesh-0.98.8-cp33-cp33m-manylinux1_x86_64.whl (212.0 kB) Copy SHA256 Checksum SHA256 cp33 Wheel Sep 20, 2017
admesh-0.98.8-cp34-cp34m-macosx_10_6_intel.whl (109.7 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Sep 20, 2017
admesh-0.98.8-cp34-cp34m-manylinux1_i686.whl (214.0 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Sep 20, 2017
admesh-0.98.8-cp34-cp34m-manylinux1_x86_64.whl (230.5 kB) Copy SHA256 Checksum SHA256 cp34 Wheel Sep 20, 2017
admesh-0.98.8-cp35-cp35m-macosx_10_6_intel.whl (109.8 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Sep 20, 2017
admesh-0.98.8-cp35-cp35m-manylinux1_i686.whl (207.1 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Sep 20, 2017
admesh-0.98.8-cp35-cp35m-manylinux1_x86_64.whl (223.5 kB) Copy SHA256 Checksum SHA256 cp35 Wheel Sep 20, 2017
admesh-0.98.8-cp36-cp36m-macosx_10_6_intel.whl (110.0 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Sep 20, 2017
admesh-0.98.8-cp36-cp36m-manylinux1_i686.whl (207.8 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Sep 20, 2017
admesh-0.98.8-cp36-cp36m-manylinux1_x86_64.whl (224.7 kB) Copy SHA256 Checksum SHA256 cp36 Wheel Sep 20, 2017
admesh-0.98.8.tar.gz (16.0 kB) Copy SHA256 Checksum SHA256 Source Sep 20, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting