Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Relative path type - this should be more amenable for building complex drawings than the PrimPath type in Wumpus-Core.
Note - RelPath is not directly equivalent to AbsPath. AbsPath is more powerful - as it is expected to have more demanding use-cases (e.g. connector paths).
- data RelPath u
- type DRelPath = RelPath Double
- empty :: Num u => RelPath u
- line1 :: Floating u => Vec2 u -> RelPath u
- curve1 :: Floating u => Vec2 u -> Vec2 u -> Vec2 u -> RelPath u
- vertexPath :: Floating u => [Vec2 u] -> RelPath u
- curvedPath :: Floating u => [Vec2 u] -> RelPath u
- circular :: Floating u => u -> RelPath u
- null :: RelPath u -> Bool
- length :: RelPath u -> u
- append :: Num u => RelPath u -> RelPath u -> RelPath u
- consLineTo :: Floating u => Vec2 u -> RelPath u -> RelPath u
- snocLineTo :: Floating u => RelPath u -> Vec2 u -> RelPath u
- consCurveTo :: (Floating u, Ord u, Tolerance u) => Vec2 u -> Vec2 u -> Vec2 u -> RelPath u -> RelPath u
- snocCurveTo :: (Floating u, Ord u, Tolerance u) => RelPath u -> Vec2 u -> Vec2 u -> Vec2 u -> RelPath u
- fromPathAlgVertices :: Floating u => PathAlg u -> (Vec2 u, RelPath u)
- fromPathAlgCurves :: Floating u => PathAlg u -> (Vec2 u, RelPath u)
- toPrimPath :: InterpretUnit u => Point2 u -> RelPath u -> Query u PrimPath
- toAbsPath :: (Floating u, Ord u, Tolerance u) => Point2 u -> RelPath u -> AbsPath u
- openRelPath :: InterpretUnit u => RelPath u -> LocImage u (RelPath u)
- closedRelPath :: InterpretUnit u => DrawStyle -> RelPath u -> LocImage u (RelPath u)
Relative path type
Relative Path data type.
Note this type is more limited than AbsPath, it does not
support introspective operations like length
or anchors.
Construction
empty :: Num u => RelPath uSource
An empty relative path is acceptible to Wumpus because it is always drawn as a LocGraphic.
curve1 :: Floating u => Vec2 u -> Vec2 u -> Vec2 u -> RelPath uSource
Create a relative path from a single Bezier curve.
vertexPath :: Floating u => [Vec2 u] -> RelPath uSource
curvedPath :: Floating u => [Vec2 u] -> RelPath uSource
Queries
length :: RelPath u -> uSource
Length of the Path.
Length is the length of the path as it is drawn, it is not a count of the number or path segments.
Length is cached so this operation is cheap - though this puts a tax on the build operations.
Concat
consCurveTo :: (Floating u, Ord u, Tolerance u) => Vec2 u -> Vec2 u -> Vec2 u -> RelPath u -> RelPath uSource
snocCurveTo :: (Floating u, Ord u, Tolerance u) => RelPath u -> Vec2 u -> Vec2 u -> Vec2 u -> RelPath uSource
Conversion
toPrimPath :: InterpretUnit u => Point2 u -> RelPath u -> Query u PrimPathSource
openRelPath :: InterpretUnit u => RelPath u -> LocImage u (RelPath u)Source
closedRelPath :: InterpretUnit u => DrawStyle -> RelPath u -> LocImage u (RelPath u)Source