A Python library for parsing different mesh formats in to a list of points and a list of elements.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/meshparser Add decode to version read from pkg_resources. Jun 21, 2017
tests Create a single location for setting the version of the library. Add … Jun 21, 2017
.gitignore Add further tests for vrml parser. Jun 21, 2017
.travis.yml Set the test environment to use Ubuntu 14.04. Jun 3, 2017
LICENSE Minor bug fixes. Set license to University of Auckland. Apr 12, 2016
README.rst
setup.cfg Add setup.cfg file for pypi. Apr 13, 2016
setup.py

README.rst

Mesh Parser build_badge

A Python library for parsing different mesh formats in to a list of points and a list of elements. The element's nodes are identified by indexes into the point list array.

This project uses semantic versioning when versioning the software.

Currently this library supports reading of the following formats:

  • stl
  • vrml
  • vtk

Install

pip install git+https://github.com/ABI-Software/MeshParser.git

Usage

from meshparser.parser import MeshParser

# It has some tests to determine the file format, if this fails you can set the format to use manually
# using a second argument 'use_parser'.  The 'use_parser' parameter must have one of the values from {'vtk', 'stl', 'vrml'}.
p = MeshParser()
p.parse('file/to/parse')
# getPoints has an option to get the pared down points, i.e. all repeated points will be removed.
n = p.getPoints()
# getElements has two options, zero_based: returns point indexes that are zero based [false], pared: remove repeated points [false]
e = p.getElements()