wumpus-basic-0.22.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.Trail

Description

Trails - prototype paths. Less resource heavy than the Path object in Wumpus-Drawing.

Synopsis

Documentation

data TrailSegment u Source

Constructors

TLine (Vec2 u) 
TCurve (Vec2 u) (Vec2 u) (Vec2 u) 

Instances

data CatTrail u Source

Instances

data PlacedTrail u Source

Instances

(Ord u, Tolerance u) => Eq (PlacedTrail u) 
(Ord u, Tolerance u) => Ord (PlacedTrail u) 
Show u => Show (PlacedTrail u) 

destrPlacedTrail :: PlacedTrail u -> (Vec2 u, [TrailSegment u])Source

Destructor for the opaque PlacedTrail type.

destrCatTrail :: CatTrail u -> [TrailSegment u]Source

Destructor for the opaque CatTrail type.

trailIterateLocus :: Num u => [Vec2 u] -> PlacedTrail uSource

Create a PlacedTrail from the vector list - each vector in the input list iterates to the start point rather then the cumulative tip.

When the PlacedTrail is run, the supplied point is the locus of the path and it does not form part of the path proper.

Like trailStartIsLocus, this constructor is typically used to make shape paths. Some shapes are easier to express as iterated displacements of the center rather than turtle drawing.

rectangleTrail :: Fractional u => u -> u -> PlacedTrail uSource

rectangleTrail : width * height -> PlacedTrail

diamondTrail :: Num u => u -> u -> PlacedTrail uSource

diamondTrail : half_width * half_height -> PlacedTrail

polygonTrail :: Floating u => Int -> u -> PlacedTrail uSource

polygonTrail : num_points * radius -> PlacedTrail

catcurve :: Vec2 u -> Vec2 u -> Vec2 u -> CatTrail uSource

trail_up :: Num u => u -> CatTrail uSource

orthoCatline :: Floating u => u -> u -> Radian -> CatTrail uSource

Alternative to catline, specifying the vector components rather the vector itself.

semicircleCW :: (Real u, Floating u) => Vec2 u -> CatTrail uSource

semicircleCW : base_vector -> CatTrail

Make a clockwise semicircle from two Bezier curves. Although this function produces an approximation of a semicircle, the approximation seems fine in practice.

semicircleCCW :: (Real u, Floating u) => Vec2 u -> CatTrail uSource

semicircleCCW : base_vector_vector -> CatTrail

Make a counter-clockwise semicircle from two Bezier curves. Although this function produces an approximation of a semicircle, the approximation seems fine in practice.

minorCircleSweepCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

minorCircleSweepCW : angle * radius * inclination -> CatTrail

 ang should be in the range 0 < ang <= 90deg.

minorCircleSweepCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

minorCircleSweepCCW : angle * radius * inclination -> CatTrail

 ang should be in the range 0 < ang <= 90deg.

circleSweepCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

circleSweepCW : apex_angle * radius * inclination -> CatTrail

 ang should be in the range 0 < ang < 360deg.
 if   0 < ang <=  90 returns 1 segment
 if  90 < ang <= 180 returns 2 segments
 if 180 < ang <= 270 returns 3 segments
 if 270 < ang <  360 returns 4 segmenets

circleSweepCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

circleSweepCCW : apex_angle * radius * inclination -> CatTrail

 ang should be in the range 0 < ang < 360deg.
 if   0 < ang <=  90 returns 1 segment
 if  90 < ang <= 180 returns 2 segments
 if 180 < ang <= 270 returns 3 segments
 if 270 < ang <  360 returns 4 segmenets

circularArcCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

inclination is the inclination of the chord.

circularArcCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail uSource

inclination is the inclination of the chord.

sineWave :: (Real u, Floating u) => Int -> u -> Radian -> CatTrail uSource

sineWave1 :: (Real u, Floating u) => u -> u -> Radian -> CatTrail uSource

One-phase sine wave. Height is parametric.

squiggleWave :: (Real u, Floating u) => Int -> u -> Radian -> CatTrail uSource

Proper semicircles do not make a good squiggle (it needs a bit of pinch).

tricurve :: Floating u => u -> u -> Radian -> CatTrail uSource

Curve in a triangle.

rectcurve :: Floating u => u -> u -> Radian -> CatTrail uSource

Curve in a rectangle.

trapcurveCW :: Floating u => u -> u -> Radian -> Radian -> CatTrail uSource

Curve in a trapezium (CW).

trapcurveCCW :: Floating u => u -> u -> Radian -> Radian -> CatTrail uSource

Curve in a trapezium (CCW).

bowcurve :: Floating u => u -> u -> Radian -> CatTrail uSource

Curve in half a bowtie.

wedgecurve :: Floating u => u -> u -> Radian -> CatTrail uSource

Wedge curve formed inside a bowtie rotated by 90deg.

loopcurve :: Floating u => u -> u -> Radian -> CatTrail uSource

Variation of wedge curve that draws a loop.