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

Uploaded Source

Built Distribution

admesh-0.98.6-py2.7-linux-x86_64.egg (56.8 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for admesh-0.98.6.tar.gz
Algorithm Hash digest
SHA256 9ef3895d3bac6962a6532b44f5aeaa2591a21c860e466a560020ecfea89af273
MD5 9f10fcb38d76ec7e1c7dfcc2fe6f3b9b
BLAKE2b-256 8b45d1146bf465cb233ef1e9f89df77a56d976643ce5f251ceb16eb3a90ee45a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for admesh-0.98.6-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 2ba1972c3248d113c90f5a1209181f8c936377a29e3ac85c2fa03cd5112e2f32
MD5 59bf33518c1a0230f818349e9876108a
BLAKE2b-256 18d4c83ddeef529e339533ba3245ae4ab8d3ad891f5635b629bd4c9a85ee6756

See more details on using hashes here.

Supported by

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