Skip to main content

read_obj

Function read_obj 

Source
pub fn read_obj(text: &str) -> Result<ObjReadResult, String>
Expand description

Parse Wavefront OBJ text into flat positions and triangle indices.

Faces with more than three vertices fan-triangulate so the result is always a triangle list (exported polygons are overwhelmingly convex, and the faceted importer welds and repairs downstream anyway). Texture and normal references, grouping state, and material lines carry nothing the kernel mesh keeps, so they are skipped; unknown keywords are OBJ extensions, not errors.