Maintainer  diagramsdiscuss@googlegroups.com 

Generic functionality for constructing and manipulating trails (sequences of linear or cubic Bezier segments) and paths (collections of concretely located trails).
 class (Monoid p, VectorSpace (V p)) => PathLike p where
 fromOffsets :: PathLike p => [V p] > p
 fromVertices :: PathLike p => [Point (V p)] > p
 pathLikeFromTrail :: PathLike p => Trail (V p) > p
 data Trail v = Trail {
 trailSegments :: [Segment v]
 isClosed :: Bool
 trailSegments' :: AdditiveGroup v => Trail v > [Segment v]
 trailOffsets :: Trail v > [v]
 trailOffset :: AdditiveGroup v => Trail v > v
 trailVertices :: AdditiveGroup v => Point v > Trail v > [Point v]
 reverseTrail :: AdditiveGroup v => Trail v > Trail v
 newtype Path v = Path {
 pathTrails :: [(Point v, Trail v)]
 pathFromTrail :: AdditiveGroup v => Trail v > Path v
 pathFromTrailAt :: Trail v > Point v > Path v
 pathVertices :: (AdditiveGroup v, Ord v) => Path v > [[Point v]]
 pathOffsets :: AdditiveGroup v => Path v > [v]
 explodeTrail :: VectorSpace v => Point v > Trail v > [Path v]
 explodePath :: VectorSpace v => Path v > [[Path v]]
Constructing pathlike things
class (Monoid p, VectorSpace (V p)) => PathLike p whereSource
setStart :: Point (V p) > p > pSource
Set the starting point of the pathlike thing. Some pathlike
things (e.g. Trail
s) may ignore this operation.
fromSegments :: [Segment (V p)] > pSource
Construct a pathlike thing from a list of Segment
s.
"Close" a pathlike thing, by implicitly connecting the endpoint(s) back to the starting point(s).
"Open" a pathlike thing.
(Ord v, VectorSpace v) => PathLike (Path v)  Paths are (of course) pathlike. 
VectorSpace v => PathLike (Trail v)  Trails are 
fromOffsets :: PathLike p => [V p] > pSource
Construct a pathlike thing of linear segments from a list of offsets.
fromVertices :: PathLike p => [Point (V p)] > pSource
Construct a pathlike thing of linear segments from a list of vertices, with the first vertex as the starting point.
pathLikeFromTrail :: PathLike p => Trail (V p) > pSource
Convert a trail to any pathlike thing. pathLikeFromTrail
is the
identity on trails.
Trails
A trail is a sequence of segments placed endtoend. Trails are thus translationally invariant, and form a monoid under concatenation. Trails can also be open (the default) or closed (the final point in a closed trail is implicitly connected back to the starting point).
Trail  

Functor Trail  
Eq v => Eq (Trail v)  
Ord v => Ord (Trail v)  
Show v => Show (Trail v)  
Monoid (Trail v)  The empty trail has no segments. Trails are composed via
concatenation. 
(InnerSpace v, OrderedField (Scalar v)) => Boundable (Trail v)  The bounding function for a trail is based at the trail's start. 
HasLinearMap v => Transformable (Trail v)  
VectorSpace v => PathLike (Trail v)  Trails are 
(Show v, HasLinearMap v) => Renderable (Trail v) ShowBackend 
Destructing trails
trailSegments' :: AdditiveGroup v => Trail v > [Segment v]Source
trailSegments'
is like trailSegments
, but explicitly includes
the implicit closing segment at the end of the list for closed trails.
trailOffsets :: Trail v > [v]Source
Extract the offsets of the segments of a trail.
trailOffset :: AdditiveGroup v => Trail v > vSource
Compute the offset from the start of a trail to the end.
trailVertices :: AdditiveGroup v => Point v > Trail v > [Point v]Source
Extract the vertices of a trail, given a concrete location at which to place the first vertex.
reverseTrail :: AdditiveGroup v => Trail v > Trail vSource
Reverse a trail's direction of travel.
Paths
A path is a (possibly empty) list of trails, with each trail paired with an absolute starting point. Hence, paths are not translationally invariant, and form a monoid under superposition.
Path  

Eq v => Eq (Path v)  
Ord v => Ord (Path v)  
Show v => Show (Path v)  
Monoid (Path v)  
(InnerSpace v, OrderedField (Scalar v)) => Boundable (Path v)  
(HasLinearMap v, Ord v) => Transformable (Path v)  
(Ord v, VectorSpace v) => HasOrigin (Path v)  
(Ord v, VectorSpace v) => PathLike (Path v)  Paths are (of course) pathlike. 
(Ord v, Show v, HasLinearMap v) => Renderable (Path v) ShowBackend 
Constructing paths from trails
pathFromTrail :: AdditiveGroup v => Trail v > Path vSource
Convert a trail to a path beginning at the origin.
pathFromTrailAt :: Trail v > Point v > Path vSource
Convert a trail to a path with a particular starting point.
Destructing paths
pathVertices :: (AdditiveGroup v, Ord v) => Path v > [[Point v]]Source
Extract the vertices of a path.
pathOffsets :: AdditiveGroup v => Path v > [v]Source
Compute the total offset of each trail comprising a path.
Miscellaneous
explodeTrail :: VectorSpace v => Point v > Trail v > [Path v]Source
Given a starting point, "explode" a trail by turning each segment (including the implicit closing segment, if the trail is closed) into its own separate path. Useful for (say) applying a different style to each segment.
explodePath :: VectorSpace v => Path v > [[Path v]]Source
"Explode" a path by exploding every component trail (see explodeTrail
).