waterfall-cad-svg-0.5.1.0: Declarative CAD/Solid Modeling Library, SVG Support
Safe HaskellNone
LanguageHaskell2010

Waterfall.SVG.FromSVG

Description

Load SVG Data into Path2D

Synopsis

Documentation

data SVGError Source #

Type representing an error that occured when processing an SVG

Instances

Instances details
Show SVGError Source # 
Instance details

Defined in Waterfall.SVG.FromSVG

Eq SVGError Source # 
Instance details

Defined in Waterfall.SVG.FromSVG

Ord SVGError Source # 
Instance details

Defined in Waterfall.SVG.FromSVG

convertPathCommands :: [PathCommand] -> Either SVGError [Path2D] Source #

Generate Path2Ds from a parsed list of PathCommands.

Consective PathCommands will be merged into the same Path2D unless either a move command (m, M) or a close path command (z, Z) is encountered.

parsePath :: String -> Either SVGError [Path2D] Source #

Parse SVG Path data and convert it into a Path2D

convertTransform :: Transformable2D a => Transformation -> Either SVGError (a -> a) Source #

Parse a Transformation into a function that can be applied to any Waterfall type with a Transformable2D instance

This should handle every case except for TransformUnknown

convertTree :: Tree -> Either SVGError [Path2D] Source #

Recursively convert an Tree into a list of Path2Ds

Text elements are not supported

convertDocument :: Document -> Either SVGError [Path2D] Source #

Convert an Document into a list of Path2Ds

readSVG :: FilePath -> IO (Either SVGError [Path2D]) Source #

Load an SVG file into a Path2D