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 :: RelPath u
- line1 :: Vec2 u -> RelPath u
- curve1 :: Vec2 u -> Vec2 u -> Vec2 u -> RelPath u
- vertexPath :: [Vec2 u] -> RelPath u
- curvedPath :: [Vec2 u] -> RelPath u
- circular :: Floating u => u -> RelPath u
- null :: RelPath u -> Bool
- append :: RelPath u -> RelPath u -> RelPath u
- consLineTo :: Vec2 u -> RelPath u -> RelPath u
- snocLineTo :: RelPath u -> Vec2 u -> RelPath u
- consCurveTo :: Vec2 u -> Vec2 u -> Vec2 u -> RelPath u -> RelPath u
- snocCurveTo :: RelPath u -> Vec2 u -> Vec2 u -> Vec2 u -> RelPath u
- fromPathAlgVertices :: Num u => PathAlg u -> (Vec2 u, RelPath u)
- fromPathAlgCurves :: Num u => PathAlg u -> (Vec2 u, RelPath u)
- toPrimPath :: InterpretUnit u => Point2 u -> RelPath u -> Query PrimPath
- toAbsPath :: (Floating u, Ord u, Tolerance u) => Point2 u -> RelPath u -> AbsPath u
- strokeRelPath :: InterpretUnit u => RelPath u -> LocGraphic 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
An empty relative path is acceptible to Wumpus because it is always drawn as a LocGraphic.
curve1 :: Vec2 u -> Vec2 u -> Vec2 u -> RelPath uSource
Create a relative path from a single Bezier curve.
vertexPath :: [Vec2 u] -> RelPath uSource
curvedPath :: [Vec2 u] -> RelPath uSource
Queries
Concat
consLineTo :: Vec2 u -> RelPath u -> RelPath uSource
snocLineTo :: RelPath u -> Vec2 u -> RelPath uSource
Conversion
toPrimPath :: InterpretUnit u => Point2 u -> RelPath u -> Query PrimPathSource
strokeRelPath :: InterpretUnit u => RelPath u -> LocGraphic uSource