Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Extended path type - more amenable for complex drawings than the type in Wumpus-Core.
** WARNING ** this module is an experiment, and may change significantly or even be dropped from future revisions.
- type PathF u = Point2 u -> Point2 u -> Path u
- data Path u = Path {
- path_length :: u
- path_elements :: Seq (PathSeg u)
- data PathSeg u
- data Curve u = Curve {
- curve_start :: Point2 u
- ctrl_point1 :: Point2 u
- ctrl_point2 :: Point2 u
- curve_end :: Point2 u
- data Line u = Line {
- line_start :: Point2 u
- line_end :: Point2 u
- emptyPath :: Num u => Path u
- pline :: Floating u => Point2 u -> Point2 u -> PathSeg u
- pcurve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> PathSeg u
- addSegment :: Num u => Path u -> PathSeg u -> Path u
- segmentLength :: PathSeg u -> u
- segmentStart :: PathSeg u -> Point2 u
- segmentEnd :: PathSeg u -> Point2 u
- toPrimPath :: Path u -> Maybe (PrimPath u)
- toPrimPathU :: Path u -> PrimPath u
- subdivide :: Fractional u => Curve u -> (Curve u, Curve u)
- subdividet :: Real u => u -> Curve u -> (Curve u, Curve u)
Documentation
Path | |
|
Curve | |
|
Line | |
|
segmentLength :: PathSeg u -> uSource
segmentStart :: PathSeg u -> Point2 uSource
segmentEnd :: PathSeg u -> Point2 uSource
toPrimPath :: Path u -> Maybe (PrimPath u)Source
Turn a BasicPath into an ordinary Path.
An empty path returns Nothing - the path representation in Wumpus-Core does not allow empty paths - a path must always have at least start point.
Assumes path is properly formed - i.e. end point of one segment is the same point as the start point of the next segment.
toPrimPathU :: Path u -> PrimPath uSource