wumpus-basic-0.9.0: Common drawing utilities built on wumpus-core.

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

Wumpus.Basic.Paths.Base

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

Documentation

data Path u Source

Constructors

Path 

Fields

path_length :: u
 
path_elements :: Seq (PathSeg u)
 

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) 

Instances

Eq u => Eq (PathSeg u) 
Ord u => Ord (PathSeg u) 
Show u => Show (PathSeg u) 

data Curve u Source

Constructors

Curve 

Instances

Eq u => Eq (Curve u) 
Ord u => Ord (Curve u) 
Show u => Show (Curve u) 

data Line u Source

Constructors

Line 

Fields

line_start :: Point2 u
 
line_end :: Point2 u
 

Instances

Eq u => Eq (Line u) 
Ord u => Ord (Line u) 
Show u => Show (Line u) 

pcurve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> PathSeg uSource

addSegment :: Num u => Path u -> PathSeg u -> Path 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.

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