Skip to main content

A parser for wavefront .obj and .mtl files

Project description

wavefront_reader

https://img.shields.io/pypi/v/wavefront_reader.svg https://travis-ci.org/neuroneuro15/ratcave.svg?branch=master Documentation Status Updates

A parser for wavefront .obj and .mtl files

Features

Reads out wavefront objects to dictionaries with their attributes, including their materials:

from wavefront_reader import read_wavefront, read_objfile, read_mtlfile
geoms = read_wavefront('myObjects.obj')
cube = geoms['Cube']
cube_vertices = cube['v']
cube_diffuse_material = cube['material']['Kd']

The module has a lot of tests, and handles face indexing by re-indexing the vertex, normal, and texcoord arrays simply by reindexing them into same-length, sequential arrays. While this reduces the memory benefits of the .obj format, it makes it much easier to load the data into OpenGL or reindex the data yourself.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2017-01-18)

  • First release on PyPI.

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

wavefront_reader-0.1.0.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distributions

wavefront_reader-0.1.0-py3.5.egg (38.2 kB view hashes)

Uploaded Source

wavefront_reader-0.1.0-py2.py3-none-any.whl (30.1 kB view hashes)

Uploaded Python 2 Python 3

wavefront_reader-0.1.0-py2.7.egg (37.9 kB view hashes)

Uploaded Source

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