pub fn load_obj<P: AsRef<Path>>(path: P) -> Result<MeshStorage, ObjError>Expand description
Load an OBJ file, reading only v and f lines, supporting arbitrary face vertex counts.
use halfedge::{build_mesh_from_vertices_and_faces, save_obj, load_obj};
let verts = vec![[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]];
let faces = vec![[0u32, 1, 2]];
let mesh = build_mesh_from_vertices_and_faces(&verts, &faces).unwrap();
let path = std::env::temp_dir().join("halfedge_doc_load.obj");
save_obj(&mesh, &path).unwrap();
let loaded = load_obj(&path).unwrap();
let _ = std::fs::remove_file(&path);
assert_eq!(loaded.vertex_count(), 3);
assert_eq!(loaded.face_count(), 1);