wumpus-basic-0.5.0: Common drawing utilities built on wumpus-core.Source codeContentsIndex
Wumpus.Basic.Paths.Base
PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>
Description

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.

Synopsis
type PathF u = Point2 u -> Point2 u -> Path u
data Path u = Path {
path_length :: u
path_elements :: Seq (PathSeg u)
}
data PathSeg u
= LineSeg u (Line u)
| CurveSeg u (Curve 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
type PathF u = Point2 u -> Point2 u -> Path uSource
data Path u Source
Constructors
Path
path_length :: u
path_elements :: Seq (PathSeg u)
show/hide Instances
Eq u => Eq (Path u)
Ord u => Ord (Path u)
Show u => Show (Path u)
data PathSeg u Source
Constructors
LineSeg u (Line u)
CurveSeg u (Curve u)
show/hide Instances
Eq u => Eq (PathSeg u)
Ord u => Ord (PathSeg u)
Show u => Show (PathSeg u)
data Curve u Source
Constructors
Curve
curve_start :: Point2 u
ctrl_point1 :: Point2 u
ctrl_point2 :: Point2 u
curve_end :: Point2 u
show/hide Instances
Eq u => Eq (Curve u)
Ord u => Ord (Curve u)
Show u => Show (Curve u)
data Line u Source
Constructors
Line
line_start :: Point2 u
line_end :: Point2 u
show/hide Instances
Eq u => Eq (Line u)
Ord u => Ord (Line u)
Show u => Show (Line u)
emptyPath :: Num u => Path uSource
pline :: Floating u => Point2 u -> Point2 u -> PathSeg uSource
pcurve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> PathSeg uSource
addSegment :: Num u => Path u -> PathSeg u -> Path uSource
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
subdivide :: Fractional u => Curve u -> (Curve u, Curve u)Source
Curve subdivision via de Casteljau's algorithm.
subdividet :: Real u => u -> Curve u -> (Curve u, Curve u)Source
subdivide with an affine weight along the line...
Produced by Haddock version 2.6.1