wumpus-basic-0.4.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 BPathF u = Point2 u -> Point2 u -> BPath u
data BPath u = BPath {
path_length :: u
path_elements :: Seq (BPathSeg u)
}
data BPathSeg u
= BLineSeg u (Line u)
| BCurveSeg 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 => BPath u
pline :: Floating u => Point2 u -> Point2 u -> BPathSeg u
pcurve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> BPathSeg u
addSegment :: Num u => BPath u -> BPathSeg u -> BPath u
segmentLength :: BPathSeg u -> u
segmentStart :: BPathSeg u -> Point2 u
segmentEnd :: BPathSeg u -> Point2 u
toPath :: BPath u -> Maybe (Path u)
toPathU :: BPath u -> Path u
subdivide :: Fractional u => Curve u -> (Curve u, Curve u)
subdividet :: Real u => u -> Curve u -> (Curve u, Curve u)
Documentation
type BPathF u = Point2 u -> Point2 u -> BPath uSource
data BPath u Source
Constructors
BPath
path_length :: u
path_elements :: Seq (BPathSeg u)
show/hide Instances
Eq u => Eq (BPath u)
Ord u => Ord (BPath u)
Show u => Show (BPath u)
data BPathSeg u Source
Constructors
BLineSeg u (Line u)
BCurveSeg u (Curve u)
show/hide Instances
Eq u => Eq (BPathSeg u)
Ord u => Ord (BPathSeg u)
Show u => Show (BPathSeg 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 => BPath uSource
pline :: Floating u => Point2 u -> Point2 u -> BPathSeg uSource
pcurve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> BPathSeg uSource
addSegment :: Num u => BPath u -> BPathSeg u -> BPath uSource
segmentLength :: BPathSeg u -> uSource
segmentStart :: BPathSeg u -> Point2 uSource
segmentEnd :: BPathSeg u -> Point2 uSource
toPath :: BPath u -> Maybe (Path 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.

toPathU :: BPath u -> Path 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