Skip to main content

read_obj

Function read_obj 

Source
pub fn read_obj(input: &str) -> Result<TriangleMesh, IoError>
Expand description

Read an OBJ file from a string and return a triangle mesh.

Supports:

  • Vertex positions (v x y z)
  • Vertex normals (vn x y z)
  • Triangle and polygon faces (f v1 v2 v3 ... or f v1//n1 v2//n2 ...)

Polygons with more than 3 vertices are triangulated using fan triangulation.

ยงErrors

Returns an error if the file is malformed.