wumpus-drawing-0.4.0: High-level drawing objects built on Wumpus-Basic.

PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>

Wumpus.Drawing.Paths.Base.RelPath

Contents

Description

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).

Synopsis

Relative path type

data RelPath u Source

Relative Path data type.

Note this type is more limited than AbsPath, it does not support introspective operations like length or anchors.

Instances

Functor RelPath 
(Ord u, Tolerance u) => Eq (RelPath u) 
Show u => Show (RelPath u) 
Num u => Monoid (RelPath u) 

Construction

empty :: Num u => RelPath uSource

An empty relative path is acceptible to Wumpus because it is always drawn as a LocGraphic.

line1 :: Floating u => Vec2 u -> RelPath uSource

Create a relative path from a single straight line.

curve1 :: Floating u => Vec2 u -> Vec2 u -> Vec2 u -> RelPath uSource

Create a relative path from a single Bezier curve.

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

append :: Num u => RelPath u -> RelPath u -> RelPath uSource

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