Skip to content

A basic Wavefront .obj and .mtl reader module for Python

License

Notifications You must be signed in to change notification settings

ratcave/wavefront_reader

Repository files navigation

wavefront_reader

https://travis-ci.org/neuroneuro15/wavefront_reader.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.

About

A basic Wavefront .obj and .mtl reader module for Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published