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.
- data Path u
- type DPath = Path Double
- length :: Num u => Path u -> u
- line :: Floating u => Point2 u -> Point2 u -> Path u
- curve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> Path u
- tracePoints :: Floating u => [Point2 u] -> Path u
- curveByAngles :: (Floating u, Ord u) => Point2 u -> Radian -> Radian -> Point2 u -> Path u
- toPrimPath :: Path u -> Maybe (PrimPath u)
- toPrimPathU :: Path u -> PrimPath u
- tipL :: Path u -> Maybe (Point2 u)
- tipR :: Path u -> Maybe (Point2 u)
- shortenBoth :: (Real u, Floating u) => u -> Path u -> Path u
- shortenL :: (Real u, Floating u) => u -> Path u -> Path u
- shortenR :: (Real u, Floating u) => u -> Path u -> Path u
- directionL :: (Real u, Floating u) => Path u -> Radian
- directionR :: (Real u, Floating u) => Path u -> Radian
- midpoint :: (Real u, Floating u) => Path u -> Maybe (Point2 u, Radian)
- data PathViewL u
- = EmptyPathL
- | (PathSegment u) :<< (Path u)
- type DPathViewL = PathViewL Double
- data PathViewR u
- = EmptyPathR
- | (Path u) :>> (PathSegment u)
- type DPathViewR = PathViewR Double
- data PathSegment u
- type DPathSegment = PathSegment Double
- pathViewL :: Num u => Path u -> PathViewL u
- pathViewR :: Num u => Path u -> PathViewR u
Documentation
tracePoints :: Floating u => [Point2 u] -> Path uSource
toPrimPath :: Path u -> Maybe (PrimPath u)Source
Turn a Path into an ordinary PrimPath.
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
directionL :: (Real u, Floating u) => Path u -> RadianSource
Direction of empty path is considered to be 0.
directionR :: (Real u, Floating u) => Path u -> RadianSource
Direction of empty path is considered to be 0.
EmptyPathL | |
(PathSegment u) :<< (Path u) |
type DPathViewL = PathViewL DoubleSource
EmptyPathR | |
(Path u) :>> (PathSegment u) |
type DPathViewR = PathViewR DoubleSource
data PathSegment u Source
Eq u => Eq (PathSegment u) | |
Ord u => Ord (PathSegment u) | |
Show u => Show (PathSegment u) |
type DPathSegment = PathSegment DoubleSource