Catalog PyPI
Back to packageRELEASE DETAILS

0.98.9

PyPI

admesh

Python bindings for ADMesh, STL maipulation library

3dmeshstl
Published24 Jun 2018
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.98.9 documentation
ADMesh bindings for Python
==========================

.. image:: https://img.shields.io/pypi/v/admesh.svg 
    :target: https://pypi.python.org/pypi/admesh

.. image:: https://img.shields.io/travis/admesh/python-admesh/master.svg
        :target: https://travis-ci.org/admesh/python-admesh

.. image:: https://img.shields.io/github/license/admesh/python-admesh.svg?style=flat
        :target: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

.. image:: https://img.shields.io/pypi/pyversions/admesh.svg
        :target: https://pypi.python.org/pypi/admesh

.. image:: https://img.shields.io/pypi/implementation/admesh.svg
        :target: https://pypi.python.org/pypi/admesh

This module provides bindings for the `ADMesh <https://github.com/admesh/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:

.. code:: sh

    pip install admesh

If you have a platform not supported by the above,
you'll need to install the C `ADMesh <https://github.com/admesh/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:

.. code:: sh

    ./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:

.. code:: sh

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

Usage
-----

Use the ``Stl`` class provided.

.. code:: python

    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 <https://github.com/admesh/python-admesh/issues/new>`_.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

18 collected
admesh-0.98.9-cp27-cp27m-macosx_10_6_intel.whl

bdist_wheel · 98.4 KB · Python cp27

Source file
admesh-0.98.9-cp27-cp27m-manylinux1_i686.whl

bdist_wheel · 164.93 KB · Python cp27

Source file
admesh-0.98.9-cp27-cp27m-manylinux1_x86_64.whl

bdist_wheel · 180.78 KB · Python cp27

Source file
admesh-0.98.9-cp27-cp27mu-manylinux1_i686.whl

bdist_wheel · 164.92 KB · Python cp27

Source file
admesh-0.98.9-cp27-cp27mu-manylinux1_x86_64.whl

bdist_wheel · 180.82 KB · Python cp27

Source file
admesh-0.98.9-cp34-cp34m-macosx_10_6_intel.whl

bdist_wheel · 99.54 KB · Python cp34

Source file
admesh-0.98.9-cp34-cp34m-manylinux1_i686.whl

bdist_wheel · 184.87 KB · Python cp34

Source file
admesh-0.98.9-cp34-cp34m-manylinux1_x86_64.whl

bdist_wheel · 202.7 KB · Python cp34

Source file
admesh-0.98.9-cp35-cp35m-macosx_10_6_intel.whl

bdist_wheel · 92.73 KB · Python cp35

Source file
admesh-0.98.9-cp35-cp35m-manylinux1_i686.whl

bdist_wheel · 182.48 KB · Python cp35

Source file
admesh-0.98.9-cp35-cp35m-manylinux1_x86_64.whl

bdist_wheel · 199.03 KB · Python cp35

Source file
admesh-0.98.9-cp36-cp36m-macosx_10_6_intel.whl

bdist_wheel · 92.7 KB · Python cp36

Source file
admesh-0.98.9-cp36-cp36m-manylinux1_i686.whl

bdist_wheel · 183.44 KB · Python cp36

Source file
admesh-0.98.9-cp36-cp36m-manylinux1_x86_64.whl

bdist_wheel · 200.08 KB · Python cp36

Source file
admesh-0.98.9-cp37-cp37m-macosx_10_6_intel.whl

bdist_wheel · 92.5 KB · Python cp37

Source file
admesh-0.98.9-cp37-cp37m-manylinux1_i686.whl

bdist_wheel · 183.85 KB · Python cp37

Source file
admesh-0.98.9-cp37-cp37m-manylinux1_x86_64.whl

bdist_wheel · 200.21 KB · Python cp37

Source file
admesh-0.98.9.tar.gz

sdist · 16.13 KB · Python source

Source file

Repository

PENDING
admesh/python-admesh

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:40 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2e232a2c269426968703d8cf6f18d415cc2042efd16ce324601ee5f517b221e5

Other collected versions

View all collected versions →