Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data WaterfallIOException = WaterfallIOException {}
- data WaterfallIOExceptionCause
- writeSolid :: Double -> FilePath -> Solid -> IO ()
- writeSTL :: Double -> FilePath -> Solid -> IO ()
- writeAsciiSTL :: Double -> FilePath -> Solid -> IO ()
- writeSTEP :: FilePath -> Solid -> IO ()
- writeGLTF :: Double -> FilePath -> Solid -> IO ()
- writeGLB :: Double -> FilePath -> Solid -> IO ()
- writeOBJ :: Double -> FilePath -> Solid -> IO ()
- readSolid :: FilePath -> IO Solid
- readSTL :: FilePath -> IO Solid
- readSTEP :: FilePath -> IO Solid
- readGLTF :: FilePath -> IO Solid
- readGLB :: FilePath -> IO Solid
- readOBJ :: FilePath -> IO Solid
Documentation
data WaterfallIOException Source #
The type of exceptions thrown by IO actions defined in IO
Instances
Exception WaterfallIOException Source # | |
Defined in Waterfall.IO | |
Show WaterfallIOException Source # | |
Defined in Waterfall.IO showsPrec :: Int -> WaterfallIOException -> ShowS # show :: WaterfallIOException -> String # showList :: [WaterfallIOException] -> ShowS # |
data WaterfallIOExceptionCause Source #
Reason for an IO action to have failed
FileError | Something went wrong when accessing a file, eg. a write to a file path that is unreachable, or a read to a file in the wrong format |
BadGeometryError | The contents of a file could not be converted into a |
UnrecognizedFormatError | The |
Instances
Show WaterfallIOExceptionCause Source # | |
Defined in Waterfall.IO showsPrec :: Int -> WaterfallIOExceptionCause -> ShowS # show :: WaterfallIOExceptionCause -> String # showList :: [WaterfallIOExceptionCause] -> ShowS # | |
Eq WaterfallIOExceptionCause Source # | |
Defined in Waterfall.IO |
Solid Writers
writeSolid :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to a file, work out the format from the file extension
Errors if passed a filename with an unrecognized extension
Because BRep representations of objects can store arbitrary precision curves, but some of the supported file formats store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
writeSTL :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to a (binary) STL file at a given path
Because BRep representations of objects can store arbitrary precision curves, but STL files store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
writeAsciiSTL :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to an Ascii STL file at a given path
Because BRep representations of objects can store arbitrary precision curves, but STL files store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
writeGLTF :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to a glTF file at a given path
glTF, or Graphics Library Transmission Format is a JSON based format used for three-dimensional scenes and models
Because BRep representations of objects can store arbitrary precision curves, but glTF files store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
writeGLB :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to a glb file at a given path
glb is the binary variant of the glTF file format
Because BRep representations of objects can store arbitrary precision curves, but glTF files store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
writeOBJ :: Double -> FilePath -> Solid -> IO () Source #
Write a Solid
to an obj file at a given path
Wavefront OBJ is a simple ascii file format that stores geometric data.
Because BRep representations of objects can store arbitrary precision curves, but obj files store triangulated surfaces, this function takes a "deflection" argument used to discretize curves.
The deflection is the maximum allowable distance between a curve and the generated triangulation.
Solid Readers
Load a Solid
from a file
At present, the "read*" functions do slightly less validation on the loaded solid than they arguably should and may succeed when reading solids that may generate invalid geometry when processed
readSolid :: FilePath -> IO Solid Source #
Read a Solid
from a file at a given path
Throws an error if loading fails, or if it's unable to work out the intended file format from the path