[][src]Crate wavefront

crates.io crates.io

A Wavefront OBJ parser and utility crate.

Example

let model = wavefront::Obj::from_file("tests/ship.obj").unwrap();

for [a, b, c] in model.triangles() {
    // No index lookup required: wavefront handles this for you!
    println!("{:?} {:?} {:?}", a.position(), b.position(), c.position());
}
A parsec isn't a unit of time, Han

Features

  • Ergonomic API for parsing OBJs from files and std::io::Readers.

  • Wrapper types that automatically perform indexing and hide the annoyances of the OBJ format if you just want to grab some triangles.

  • Correct handling of complex polygons.

Roadmap

  • Support for materials and the MTL format.

  • Support for arbitrary geometry.

Modules

util

Utilities relating to the OBJ format.

Structs

Group

A group defined in an OBJ.

Obj

A struct representing the contents of a parsed OBJ file.

Object

An object defined in an OBJ.

Polygon

A polygon defined in an OBJ.

Vertex

A vertex defined in an OBJ.

Enums

Error

An error that may be encountered while attempting to parse an OBJ.

Type Definitions

Index

A number used to index into vertex attribute arrays.