This module provides a monadic interface to build
It does so using
PathBuilders. The construction of a
is equivalent to the construction of a
TPath by hand, but with
a sometimes more convenient syntax.
For example, this path corresponds to a triangle:
trianglePath :: TPath trianglePath = bpath (pointAtXY (-1) 0) $ do line $ pointAtXY 1 0 line $ pointAtXY 0 1 pcycle
The equivalent syntax created by hand would be:
trianglePath :: TPath trianglePath = Cycle $ Start (pointAtXY (-1) 0) ->- pointAtXY 1 0 ->- pointAtXY 0 1
- data PathBuilder a
- bpath :: TPoint -> PathBuilder a -> TPath
- line :: TPoint -> PathBuilder ()
- pcycle :: PathBuilder ()
- rectangle :: TPoint -> PathBuilder ()
- circle :: Double -> PathBuilder ()
- ellipse :: Double -> Double -> PathBuilder ()
- node :: LaTeX -> PathBuilder ()
- grid :: [GridOption] -> TPoint -> PathBuilder ()
Build a path using a starting point and a
Rectangle with the current point as one cornder and the given point as the opposite corner.
Ellipse with width and height described by the arguments and centered at the current point.