-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | STL 3D geometry format parsing and pretty-printing
--
-- STL is a simple file format for representing 3D objects as the
-- triangles which form their surface. It is common in 3D printing
-- workflows. This library provides parsing and serialization to and from
-- both text and binary STL formats.
@package STL
@version 0.3.0.3
module Graphics.Formats.STL.Types
-- | A representation of an STL file, consisting of a (possibly empty)
-- object name, and a list of triangles.
data STL
STL :: Text -> [Triangle] -> STL
[name] :: STL -> Text
[triangles] :: STL -> [Triangle]
-- | A single triangle in STL is represented by a normal vector and three
-- vertices.
data Triangle
Triangle :: Maybe Vector -> (Vector, Vector, Vector) -> Triangle
[normal] :: Triangle -> Maybe Vector
[vertices] :: Triangle -> (Vector, Vector, Vector)
type Vector = (Float, Float, Float)
triple :: a -> a -> a -> (a, a, a)
instance Data.Serialize.Serialize Graphics.Formats.STL.Types.Triangle
instance Data.Serialize.Serialize Graphics.Formats.STL.Types.STL
module Graphics.Formats.STL.Parser
-- | A parser from Text to the STL type. The parser should
-- be fairly permissive about whitespace, but has not been tested enough
-- against STL files in the wild.
stlParser :: Parser STL
nameParser :: Parser Text
triangle :: Parser Triangle
loop :: Parser (Vector, Vector, Vector)
normalParser :: Parser (Maybe Vector)
vertex :: Parser Vector
v3 :: Parser Vector
ss :: Parser a -> Parser a
text :: Text -> Parser Text
float :: Parser Float
module Graphics.Formats.STL.Printer
-- | Convert an STL value to a Builder, which can be
-- converted to a ByteString with toLazyByteString
textSTL :: STL -> Builder
triangle :: Triangle -> Builder
maybeNormal :: Maybe Vector -> Builder
vertex :: Vector -> Builder
v3 :: Vector -> Builder
indent :: Int -> Builder -> Builder
vcat :: [Builder] -> Builder
module Graphics.Formats.STL
-- | Convert an STL value to a Builder, which can be
-- converted to a ByteString with toLazyByteString
textSTL :: STL -> Builder
-- | A parser from Text to the STL type. The parser should
-- be fairly permissive about whitespace, but has not been tested enough
-- against STL files in the wild.
stlParser :: Parser STL
-- | A representation of an STL file, consisting of a (possibly empty)
-- object name, and a list of triangles.
data STL
STL :: Text -> [Triangle] -> STL
[name] :: STL -> Text
[triangles] :: STL -> [Triangle]
-- | A single triangle in STL is represented by a normal vector and three
-- vertices.
data Triangle
Triangle :: Maybe Vector -> (Vector, Vector, Vector) -> Triangle
[normal] :: Triangle -> Maybe Vector
[vertices] :: Triangle -> (Vector, Vector, Vector)
type Vector = (Float, Float, Float)