Portability | GHC |
---|---|

Stability | highly unstable |

Maintainer | stephen.tetley@gmail.com |

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

- data TrailSegment u
- data CatTrail u
- data PlacedTrail u
- drawPlacedTrail :: InterpretUnit u => PathMode -> PlacedTrail u -> LocGraphic u
- drawCatTrail :: InterpretUnit u => PathMode -> CatTrail u -> LocGraphic u
- destrPlacedTrail :: PlacedTrail u -> (Vec2 u, [TrailSegment u])
- destrCatTrail :: CatTrail u -> [TrailSegment u]
- placeCatTrail :: Vec2 u -> CatTrail u -> PlacedTrail u
- trailIterateLocus :: Num u => [Vec2 u] -> PlacedTrail u
- placedTrailPoints :: InterpretUnit u => PlacedTrail u -> LocQuery u [Point2 u]
- rectangleTrail :: Fractional u => u -> u -> PlacedTrail u
- diamondTrail :: Num u => u -> u -> PlacedTrail u
- polygonTrail :: Floating u => Int -> u -> PlacedTrail u
- catline :: Vec2 u -> CatTrail u
- catcurve :: Vec2 u -> Vec2 u -> Vec2 u -> CatTrail u
- trail_up :: Num u => u -> CatTrail u
- trail_down :: Num u => u -> CatTrail u
- trail_left :: Num u => u -> CatTrail u
- trail_right :: Num u => u -> CatTrail u
- trail_north :: Num u => u -> CatTrail u
- trail_south :: Num u => u -> CatTrail u
- trail_east :: Num u => u -> CatTrail u
- trail_west :: Num u => u -> CatTrail u
- trail_north_east :: Floating u => u -> CatTrail u
- trail_north_west :: Floating u => u -> CatTrail u
- trail_south_east :: Floating u => u -> CatTrail u
- trail_south_west :: Floating u => u -> CatTrail u
- trail_up_left :: Num u => u -> CatTrail u
- trail_up_right :: Num u => u -> CatTrail u
- trail_down_left :: Num u => u -> CatTrail u
- trail_down_right :: Num u => u -> CatTrail u
- orthoCatline :: Floating u => u -> u -> Radian -> CatTrail u
- trail_theta_up :: Floating u => u -> Radian -> CatTrail u
- trail_theta_down :: Floating u => u -> Radian -> CatTrail u
- trail_theta_left :: Floating u => u -> Radian -> CatTrail u
- trail_theta_right :: Floating u => u -> Radian -> CatTrail u
- trail_theta_north :: Floating u => u -> Radian -> CatTrail u
- trail_theta_south :: Floating u => u -> Radian -> CatTrail u
- trail_theta_east :: Floating u => u -> Radian -> CatTrail u
- trail_theta_west :: Floating u => u -> Radian -> CatTrail u
- trail_theta_north_east :: Floating u => u -> Radian -> CatTrail u
- trail_theta_north_west :: Floating u => u -> Radian -> CatTrail u
- trail_theta_south_east :: Floating u => u -> Radian -> CatTrail u
- trail_theta_south_west :: Floating u => u -> Radian -> CatTrail u
- trail_theta_up_left :: Floating u => u -> Radian -> CatTrail u
- trail_theta_up_right :: Floating u => u -> Radian -> CatTrail u
- trail_theta_down_left :: Floating u => u -> Radian -> CatTrail u
- trail_theta_down_right :: Floating u => u -> Radian -> CatTrail u
- semicircleCW :: (Real u, Floating u) => Vec2 u -> CatTrail u
- semicircleCCW :: (Real u, Floating u) => Vec2 u -> CatTrail u
- minorCircleSweepCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- minorCircleSweepCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- circleSweepCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- circleSweepCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- circularArcCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- circularArcCCW :: (Real u, Floating u) => Radian -> u -> Radian -> CatTrail u
- sineWave :: (Real u, Floating u) => Int -> u -> Radian -> CatTrail u
- sineWave1 :: (Real u, Floating u) => u -> u -> Radian -> CatTrail u
- squareWave :: Floating u => Int -> u -> Radian -> CatTrail u
- sawtoothWave :: (Real u, Floating u) => Int -> u -> Radian -> CatTrail u
- squiggleWave :: (Real u, Floating u) => Int -> u -> Radian -> CatTrail u
- semicircleWave :: (Real u, Floating u) => ClockDirection -> Int -> u -> Radian -> CatTrail u
- tricurve :: Floating u => u -> u -> Radian -> CatTrail u
- rectcurve :: Floating u => u -> u -> Radian -> CatTrail u
- trapcurveCW :: Floating u => u -> u -> Radian -> Radian -> CatTrail u
- trapcurveCCW :: Floating u => u -> u -> Radian -> Radian -> CatTrail u
- bowcurve :: Floating u => u -> u -> Radian -> CatTrail u
- wedgecurve :: Floating u => u -> u -> Radian -> CatTrail u
- loopcurve :: Floating u => u -> u -> Radian -> CatTrail u

# Documentation

data TrailSegment u Source

Functor TrailSegment | |

(Ord u, Tolerance u) => Eq (TrailSegment u) | |

(Ord u, Tolerance u) => Ord (TrailSegment u) | |

Show u => Show (TrailSegment u) |

data PlacedTrail u Source

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

(Ord u, Tolerance u) => Ord (PlacedTrail u) | |

Show u => Show (PlacedTrail u) |

drawPlacedTrail :: InterpretUnit u => PathMode -> PlacedTrail u -> LocGraphic uSource

drawCatTrail :: InterpretUnit u => PathMode -> CatTrail u -> LocGraphic uSource

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.

placeCatTrail :: Vec2 u -> CatTrail u -> PlacedTrail uSource

Turn a `CatTrail`

into a `PlacedTrail`

.

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

placedTrailPoints :: InterpretUnit u => PlacedTrail u -> LocQuery u [Point2 u]Source

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 `

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

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

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

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

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

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

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

trail_north_east :: Floating u => u -> CatTrail uSource

trail_north_west :: Floating u => u -> CatTrail uSource

trail_south_east :: Floating u => u -> CatTrail uSource

trail_south_west :: Floating u => u -> CatTrail uSource

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

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

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

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

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

Alternative to `catline`

, specifying the vector components
rather the vector itself.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

Wedge curve formed inside a bowtie rotated by 90deg.