(      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Foreign function interface(c) Jonatan H Sundqvist, 2015 MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) Safe+Copyright : (c) Jonatan H Sundqvist, 2015MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) None!/24:_ HAbstract representation of an OBJ model with associated MTL definitions.>TODO | - Rename (?) - Include metadata, comments, rejected data (?) - Separate type for processed OBJTokens (ie. token + context) - Perform index lookups (?) - Reconsider the types (especially of the materials) - Rename accessor functions (eg. texcoords instead of textures) (?)2fTextures :: Set s, data Model f s i m = Model { TODO | - Do all materials have an ambient, a diffuse and a specular colour (?) - Support more attributes (entire spec) (?) - Lenses (?)7TODO | - Use a type from the colour package instead (?)pTODO | - Validation (eg. length ivertices == length == ivertices == length itextures if length isn't 0) - Pack indices in a tuple (eg. indices :: [(Int, Int, Int)]) (?) - Use (String, String) for the names of the mtl file and material instead of Material (?) - Use types so as not to confuse the indices (eg. newtype INormal, newtype ITexcoord)Output type of the MTL parser. Currently a list of line number and token (or error string) pairs TODO | - Add type for processed MTL (eg. a map between names and materials) Color on and Ambient offColor on and Ambient on Highlight onReflection on and Ray trace on0Transparency: Glass on, Reflection: Ray trace on'Reflection: Fresnel on and Ray trace onETransparency: Refraction on, Reflection: Fresnel off and Ray trace onDTransparency: Refraction on, Reflection: Fresnel on and Ray trace onReflection on and Ray trace off1Transparency: Glass on, Reflection: Ray trace off%Casts shadows onto invisible surfaces!%Represents a single (valid) MTL token\TODO | - Is the alpha channel optional, ignored, disallowed? - Include support for (Ns, Ni, d, Tr, illumZ) - Assume no colours have an alpha channel, since transparency is handled by the d attribute (?),Output type of the OBJ parser.>TODO | - Rename (?) - Use Integral for line number (?)-6TODO: Rename (?) TODO: Use union instead of Maybe (?)2%Represents a single (valid) OBJ token TODO | - Polymorphic numerical types (?) - Add context, metadata (eg. line numbers, filename) (?) - Naming scheme (added OBJ prefix to prevent name clashes; cf. Face type) - Comment token (preserve comments in parser output or remove them) (?)Cover the entire spec (http:/www.martinreddy.netgfx3dDOBJ.spec) (and handle unimplemented attributes gracefully)=  !"#$%&'()*+,-./0123456789:;<(  !"#$%&'()*+,-.27345689:;<=23456789:;<-./01,!"#$%&'()*+       ! "#$%&'()*+,-./012 3456789:;<+Copyright : (c) Jonatan H Sundqvist, 2016MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) None9;<=?/JKLMNOPSTUVWYZ[\]^_`aefghijklmqrstuvwxyz{|}~*JKLMNOSTUVYZ[\]^_`efghijklqrstuvwxyz{|}~?NOLMJKPPPUVSTWW_`]^[\YZaaaaklijghefmmmm}~{|yzwxuvstqrJKLMNOPSTUVWYZ[\]^_`aefghijklmqrstuvwxyz{|}~5Copyright : (c) Jonatan H Sundqvist, October 2 2016MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) NonebConsumes all input, including any leading or trailing comments and whitespace TODO | - Rename (?)fSkips any leading comments, line breaks and empty lines TODO | - Rename (?) - Skip whitespace|OBJ rows may be separated by one or more lines of comments and whitespace, or empty lines. TODO | - Make sure this is rightParses a comment (from the #a to end of the line), possibly preceded by whitespace TODO | - Break out the whitespace part (?)&Tries the given parser, falls back to  if it fails TODO | - Use try to enforce backtracking (?)9Like Atto.skipMany, except it skips one match at the mostUSkips atleast one white space character (not including newlines and carriage returns)Predicate for linear space (eg. whitespace besides newlines) TODO | - Unicode awareness (cf. Data.Char.isSpace) - Come up with a better name (?)One or more letters (cf.  for details)Used for texture, material, object and group names (and maybe others that I have yet to think of) TODO | - Use Unicode groups, make more robust (?)0Parses the strings "off" (False) and "on" (True)@Wraps a parser in a '(' and a ')', with no whitespace in between}A single colour channel TODO | - Clamp to [0,1] (cf. partial from monadplus) (?) - Can channels be parenthesised (?)-A colour with three or four channels (RGB[A])A point in 3D spaceA point in 2D space TODO | - Clean up and generalise5Copyright : (c) Jonatan H Sundqvist, October 2 2016MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) None#@LJThis function creates an OBJToken or error for each line in the input data+Parses a token given a single valid OBJ rowTODO | - Correctness (total function, no runtime exceptions) - Handle invalid rows (how to deal with mangled definitions w.r.t indices?) - Use ListLike or Monoid (or maybe Indexable, since that's the real requirement) (?)Parses an OBJ token&Three or more vertex definitions (cf.  for details)\A single vertex definition with indices for vertex position, normal, and texture coordinatesuTODO: | - Should the slashes be optional? - Allowed trailing slashes (I'll have to check the spec again) (?)f Int[((Int[Int])|(/Int))]%Two integers, separated by whitespace)Three cordinates, separated by whitespace(Two coordinates, separated by whitespace*Three coordinates, separated by whitespace%Object names, separated by whitespace$Group names, separated by whitespaceEither on or offAn MTL library nameAn MTL material name  5Copyright : (c) Jonatan H Sundqvist, October 2 2016MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) None#@L Produces a list of MTL tokensParses a single MTL row.RParse an MTL token TODO: How to deal with common prefix (Ka, Kd, Ks) (backtrack?)%Three or four channel values (RGB[A])%Three or four channel values (RGB[A])%Three or four channel values (RGB[A])=A rational number, preceded by whitespace (specular exponent):A number between 0 and 10 (inclusive) (illumination model)<A rational number, preceded by whitespace (refraction index)0A rational number, preceded by whitespace (doss)&A texture name, preceded by whitespace&A texture name, preceded by whitespace'A material name, preceded by whitespace  6Copyright : (c) Jonatan H Sundqvist, February 8 2015MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) None#@L,  !"#$%&'()*+,-.27345689:;<+Copyright : (c) Jonatan H Sundqvist, 2016MIT Jonatan H Sundqvist stable  portable None#:@LTXPerforms a computation on adjacent pairs in a list TODO | - Factor out and make genericConvers an Either to a MaybeConverts a Maybe to an EitherTCreates a mapping between group names and the corresponding bounds ([lower, upper)).TODO | - Figure out how to deal with multiple group names (eg. "g mesh1 nose head") - Include not just face indices but vertex indices (makes it easier to slice, GPU buffers) (maybe in a separate function)UCreates a mapping between object names and the corresponding bounds ([lower, upper)).FCreates a mapping between names (of groups or objects) to face indicesTODO | - Refactor, simplify - What happens if the same group or object appears multiple times (is that possible?) - Rename or add function parameter (the -With suffix implies a function parameter)Filters out faces from a stream of OBJTokens and attaches the currently selected material, as defined by the most recent LibMTL and UseMTL tokens.Tries to find a given material in the specified MTL table TODO | - Specify missing material or library name (would require additional constraints on s) - RefactorfConstructs an MTL table from a list of (libraryName, token stream) pairs. TODO | - Refactor, simplifyoConstructs a map between names and materials. Incomplete material definitions result in an error (Left ...).TODO | - Debug information (eg. attributes without an associated material) - Pass in error function (would allow for more flexible error handling) (?) - Deal with duplicated attributes (probably won't crop up in any real situations)rCreates a new (name, material) pair from a stream of MTL tokens. The first token should be a new material name.jBreaks a stream of MTL tokens into lists of material definitions TODO | - Rename (eg. groupMaterials) (?)Creates a materialTries to extract a diffuse colour, a specular colour, and an ambient colour from a list of MTL tokens TODO | - Should we really require all three colour types (?) - Rename (?)Constructs a model from a stream of OBJ tokens, a materials table and an optional path to root of the model (used for textures, etc.)TODO | - Performance, how are copiesQ of coordinates handled (?) - Performance, one pass (with a fold perhaps)[I never knew pattern matching in list comprehensions could be used to filter by constructoruTODO | - Specialise to [[Face]] (?) - Check vertex count (has to be atleast three) - Better names (?)Finds the axis-aligned bounding box of the model TODO | - Deal with empty vertex lists (?) - Refactor - Folding over applicative (fold in parallel) - Make sure the order is rightTakes a vector of data, an index function, a choice function, a vector of some type with indices and uses the indices to constructs a new Vector with the data in the original vector.KTODO | - Factor out the buffer-building logic - Rewrite the docs...*. fromIntegral . subtract 1 . (^.indices)Does the model have textures?The set of all texture names/Loading (and perhaps writing) OBJ and MTL files(c) Jonatan H Sundqvist, 2015 MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) NoneFTODO | - Use bytestrings (?) - Deal with IO and parsing errorsTODO | - Use bytestrings (?) - Merge OBJ and MTL parsers (and plug in format-specific code as needed) (?) - Deal with IO and parsing errorsTODO | - Better names (than mtls and fnsH) (?) - Refactor, simplify - Improve path handling (cf. #) - Graceful error handling^Loads an OBJ model from file, including associated materials TODO | - Graceful error handling Re-exports public API(c) Jonatan H Sundqvist, 2016 MIT Jonatan H Sundqvist experimental|stable POSIX (not sure) Safe     !"#$%&'()*+,-./01234456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ l r p n (WaveFront-0.5.0.0-JGEQOQnhzWq955tjBgtUvVGraphics.WaveFront.TypesGraphics.WaveFront.LensesGraphics.WaveFront.ParseGraphics.WaveFront.ModelGraphics.WaveFront.LoadGraphics.WaveFront.ForeignGraphics.WaveFront.Parse.CommonGraphics.WaveFront.Parse.OBJGraphics.WaveFront.Parse.MTLGraphics.WaveFrontModel$sel:fVertices:Model$sel:fNormals:Model$sel:fTexcoords:Model$sel:fFaces:Model$sel:fMaterials:Model$sel:fGroups:Model$sel:fObjects:Model$sel:fRoot:ModelMaterial$sel:fAmbient:Material$sel:fDiffuse:Material$sel:fSpecular:Material$sel:fTexture:MaterialColour$sel:fRed:Colour$sel:fGreen:Colour$sel:fBlue:Colour$sel:fAlpha:ColourFace$sel:fIndices:Face$sel:fMaterial:Face MaterialsNormals TexCoordsVerticesMTLTableMTL IlluminationMTLTokenAmbientDiffuseSpecularSpecularExponentIllumDissolve Refraction MapDiffuse MapAmbient NewMaterialOBJ VertexIndices$sel:fIvertex:VertexIndices$sel:fItexcoord:VertexIndices$sel:fInormal:VertexIndicesOBJToken OBJVertex OBJNormal OBJTexCoordOBJFaceLineUseMTLLibMTL SmoothShadingGroupObject$fShowVertexIndices$fEqVertexIndices $fShowColour $fEqColour$fFunctorColour$fFoldableColour$fShowMTLToken $fEqMTLToken$fShowMaterial $fEqMaterial$fShowOBJToken $fShowFace $fShowModel HasIvertexivertex HasItexcoord itexcoord HasInormalinormal$fHasIvertexVertexIndicesi $fHasItexcoordVertexIndicesMaybe$fHasInormalVertexIndicesMaybe HasMaterialmaterial HasIndicesindices$fHasMaterialFaceMaterial$fHasIndicesFacemHasRedredHasGreengreenHasBlueblueHasAlphaalpha$fHasRedColourf$fHasGreenColourf$fHasBlueColourf$fHasAlphaColourf HasTexturetexture HasSpecularspecular HasDiffusediffuse HasAmbientambient$fHasTextureMaterialMaybe$fHasSpecularMaterialColour$fHasDiffuseMaterialColour$fHasAmbientMaterialColour HasVerticesvertices HasTexcoords texcoordsHasRootroot HasObjectsobjects HasNormalsnormals HasMaterials materials HasGroupsgroupsHasFacesfaces$fHasVerticesModelm$fHasTexcoordsModelm$fHasRootModelMaybe$fHasObjectsModelMap$fHasNormalsModelm$fHasMaterialsModelMap$fHasGroupsModelMap$fHasFacesModelm lineSeparatorcommentobjmtl(Cartesian-0.6.0.0-DJ6h0FHNcaK42zVJpQhk2WCartesian.Internal.TypessizeOfcornerOf BoundingBoxfacesOfcreateMTLTable materialsOf createModel tessellatebounds fromIndicesfromFaceIndicesdiffuseColours hasTexturestexturesmodel wholeFile cutToTheChaseoptionalbaseGHC.BaseNothingignorespace isLinearSpaceword*attoparsec-0.13.1.0-K5Fyc3MOMYs22DiprZQxLMData.Attoparsec.Textletternametoggle parenthesisedchannelcolourpoint3Dpoint2Dclampedatleastcoordclamprowtokenface vertexIndiceslinenormalvertexobjectgroupsmoothlibusespecExpillum refractiondissolve mapDiffuse mapAmbient newMaterialpairwise eitherToMaybe maybeToEithergroupsOf objectsOfbuildIndexMapWithlookupMaterialcreateMaterialpartitionMaterialsfromAttributesmaterialColours createFacefilepath-1.4.1.0System.FilePath.Posix