Skip to main content

read_obj

Function read_obj 

Source
pub fn read_obj(text: &str) -> OgeomResult<Triangulation>
Expand description

Read an OBJ into a triangulation.

Vertices, faces and vertex normals; everything else (materials, groups, texture coordinates, smoothing) is a statement about rendering a mesh rather than about the mesh, and is skipped rather than half-honoured. A face of more than three vertices is fanned from its first, which is what a convex polygon means and what OBJ writers emit.

Indices may be negative, which in OBJ counts back from the end, and may carry the v/vt/vn triple, of which the first field is the position.

ยงErrors

OgeomError::Construction if an index names a vertex that is not there, or a coordinate does not parse.