Skip to main content

Python bindings for ADMesh, STL maipulation library

Project description

https://badge.fury.io/py/admesh.svg https://travis-ci.org/admesh/python-admesh.png?branch=master https://pypip.in/d/admesh/badge.png

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

First, you’ll need to install the ADMesh library. This release is designed for ADMesh 0.98.x. Follow the instructions there. Also, you’ll need Cython. 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']

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

Uploaded Source

Built Distribution

admesh-0.98.5-py2.7-linux-x86_64.egg (52.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for admesh-0.98.5.tar.gz
Algorithm Hash digest
SHA256 0d1dcfa5aba42267146114d13d8082d089b5f21a1f342f3000d77712fbfe352b
MD5 7355334427fcc6fe3a428b7f7b33ad13
BLAKE2b-256 bc82c53ef5576db8ce77bb7dc9822a5dbee71cb61f74765b53241aedc0770f57

See more details on using hashes here.

Provenance

File details

Details for the file admesh-0.98.5-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for admesh-0.98.5-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 472cadfd3940237037203799fa0685b68d3ed5088e7d9eb04f1869b26d9c06a0
MD5 ab7c9897351c4914f8b78100dfeb71f2
BLAKE2b-256 18a4d24752a75ee7a3910e991ab3161ccf171aa1140ae0ef9ba8ebcb2c25a692

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