generative-art-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geometry.SvgParser

Synopsis

Documentation

parse :: Text -> Either Text SvgElement Source #

Parse the input line-wise into various SVG elements.

  • g paths: M413.654,295.115c0,0-1.283-13.865,12.717-19.615
  • Line elements: LINE x1 y1 x2 y2
  • Circles: CIRCLE cx cy r
  • Ellipses: ELLIPSE cx cy rx ry

This is not a full SVG parser, but in practice it’s much easier to edit an SVG source file to extract all g element contents to a line rather than writing a full-fledged SVG parser.

data SvgElement Source #

Constructors

SvgLine Line 
SvgCircle Circle 
SvgEllipse Ellipse 
SvgPath [[Either Line Bezier]]

List of poly-bezier-lines.

Instances

Instances details
Show SvgElement Source # 
Instance details

Defined in Geometry.SvgParser

HasBoundingBox SvgElement Source # 
Instance details

Defined in Geometry.SvgParser