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

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

Wumpus.Basic.Geometry.Paths

Description

Paths for elementary shapes - rectangles...

** - WARNING ** - half baked.

Synopsis

Documentation

data PathAlg u Source

A vector chain building a path.

The vectors are relative to the predecessor, so the rendering of a PathAlg iterates the start point.

A polygon PathAlg should have steps for all sides of the polygon with the end point generated by the last vector coinciding with thet start point.

pathIterateLocus :: Num u => [Vec2 u] -> PathAlg uSource

Note this creates a path very the first vector represents a moveto, then the subsequence vectors represent linetos.

rectanglePathAlg :: Fractional u => u -> u -> PathAlg uSource

Supplied point is center, the genearated points are counter-clockwise so [ bl, br, tr, tl ] .

blRectanglePathAlg :: Num u => u -> u -> PathAlg uSource

Supplied point is bottom-left, subsequent points are counter-clockwise so [ bl, br, tr, tl ] .

diamondPathAlg :: Num u => u -> u -> PathAlg uSource

diamondPathAlg : half_width * half_height -> PathAlg

polygonPathAlg :: Floating u => Int -> u -> PathAlg uSource

polygonPathAlg : num_points * radius -> PathAlg

type LocCoordPath u = Point2 u -> [Point2 u]Source

A functional type from initial point to point list.

coordinatePrimPath :: InterpretUnit u => LocCoordPath u -> Point2 u -> Query PrimPathSource

Relative unit version of coordinatePrimPathAU.

rectangleCoordPath :: Num u => u -> u -> LocCoordPath uSource

Supplied point is bottom-left, subsequenct points are counter-clockwise so [ bl, br, tr, tl ] .

diamondCoordPath :: Num u => u -> u -> LocCoordPath uSource

diamondPath : half_width * half_height * center_point -> PrimPath

polygonCoordPath :: Floating u => Int -> u -> LocCoordPath uSource

polygonCoordPath : num_points * radius * center -> [point]

isoscelesTriangleCoordPath :: Floating u => u -> u -> LocCoordPath uSource

isocelesTriangle bw h pt

Supplied point is the centriod of the triangle. This has a nicer visual balance than using half-height.

isoscelesTrianglePoints :: Floating u => u -> u -> Point2 u -> (Point2 u, Point2 u, Point2 u)Source

isocelesTriangle bw h pt

Supplied point is the centriod of the triangle. This has a nicer visual balance than using half-height.

equilateralTriangleCoordPath :: Floating u => u -> LocCoordPath uSource

 side_length * ctr -> [Points]