https://github.com/zesterer/wavefront
A Wavefront OBJ parser and utility crate
https://github.com/zesterer/wavefront
Last synced: about 1 year ago
JSON representation
A Wavefront OBJ parser and utility crate
- Host: GitHub
- URL: https://github.com/zesterer/wavefront
- Owner: zesterer
- License: apache-2.0
- Created: 2020-09-11T15:38:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-19T10:05:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-18T10:45:42.219Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Wavefront
[](https://crates.io/crates/wavefront)
[](https://docs.rs/wavefront)
A [Wavefront OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) parser and
utility crate.
```toml
[dependencies]
wavefront = "x.y.z"
```
## Example
```rust
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());
}
```
# Features
- Ergonomic API for parsing OBJs from files and readers.
- Wrapper types that automatically perform indexing and hide the annoyances of
the OBJ format if you just want to grab some triangles...
- ...but allows you to dip into the nitty-gritty details of OBJ if you want to
do that too.
- Correct handling of complex polygons.
- No dependencies
## Roadmap
- Materials and the MTL support.
- Object, group, polygon, vertex and vertex attribute insertion
- Saving
- Arbitrary geometry support.
## Why not [alternative]?
`wavefront` was born of a general feeling that the API of existing OBJ parsers
were either unnecessarily verbose or didn't properly handle the heirarchical
structure of the OBJ format. `wavefront` aims to couple correct handling of the
format's features with a clean, terse API that allows you to jump straight to
the thing you want to do: rendering your model.
## License
`wavefront` is distributed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at the disgression of the user.