Maintainer | diagrams-discuss@googlegroups.com |
---|

Paths in two dimensions are special since we may stroke them to create a 2D diagram, and (eventually) perform operations such as intersection and union.

# Constructing path-based diagrams

stroke :: Renderable (Path R2) b => Path R2 -> Diagram b R2Source

Convert a path into a diagram. The resulting diagram has the names 0, 1, ... assigned to each of the path's vertices.

Note that a bug in GHC 7.0.1 causes a context stack overflow when
inferring the type of `stroke`

. The solution is to give a type
signature to expressions involving `stroke`

, or (recommended)
upgrade GHC (the bug is fixed in 7.0.2 onwards).

strokeT :: Renderable (Path R2) b => Trail R2 -> Diagram b R2Source

A composition of `stroke`

and `pathFromTrail`

for conveniently
converting a trail directly into a diagram.

Note that a bug in GHC 7.0.1 causes a context stack overflow when
inferring the type of `stroke`

and hence of `strokeT`

as well.
The solution is to give a type signature to expressions involving
`strokeT`

, or (recommended) upgrade GHC (the bug is fixed in 7.0.2
onwards).