A simple datatype and parser for 3D OFF files. A single type is used for OFF information with or without color. Loosely based on http://people.sc.fsu.edu/~jburkardt/data/off/off.html, but uses the file header to determine whether the object's faces contain color values.
Documentation
Representation of an object in OFF format; a pair of vectors containing the vertices and the faces of the object.
A face is a vector of vertex indices and an optional color value.
vertexCount :: OFF -> IntSource
The number of vertices in an OFF
object.
readOFFFile :: FilePath -> IO (Either ParseError OFF)Source
Read an OFF object from the given FilePath
, returning either
the corresponding OFF
value or a ParseError
.