Skip to content

A fast Wavefront .OBJ file reader/writer library for Python 3 written in Cython

License

Notifications You must be signed in to change notification settings

ycjungSubhuman/cyobj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cyobj

PyPI version

A python library for Wavefront .OBJ reading/writing

Why did we write yet another .obj reader/writer?

Many python libraries for .obj do not support

  • Texture coodinates
  • Vertex normals
  • Mixed quad/triangle
  • Automatic generation of .mtl file when texture map exists
  • Fast read/write

Therefore we wrote one ourselves that supports them all.

Requirement

  • NumPy
  • Cython

Install

From PyPI

pip install cyobj

Build yourself

python setup.py build && python setup.py install

Running time

Compared to libigl-python-binding,

Reading

Reads a large .obj (Armadillo) file with V/VT/VN attributes

  • cyobj: around 465 ms
  • igl(C++): round 1043 ms

Writing

Writes an .obj file with V attributes

  • cyobj: around 252 ms
  • igl(C++): around 362 ms

Note

This library does not fully support polygon meshes. It only supports fixed quad and triangles. When mixed quad and triangles are detected, F array has 4 columns, and the last column is the copy of the previous column.

About

A fast Wavefront .OBJ file reader/writer library for Python 3 written in Cython

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •