Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |
Paths for elementary shapes - rectangles...
** - WARNING ** - half baked.
- data PathAlg u
- runPathAlgPoint :: Num u => Point2 u -> PathAlg u -> [Point2 u]
- runPathAlgVec :: PathAlg u -> (Maybe (Vec2 u), [Vec2 u])
- pathStartIsStart :: [Vec2 u] -> PathAlg u
- pathStartIsLocus :: [Vec2 u] -> PathAlg u
- pathIterateLocus :: Num u => [Vec2 u] -> PathAlg u
- rectanglePathAlg :: Fractional u => u -> u -> PathAlg u
- blRectanglePathAlg :: Num u => u -> u -> PathAlg u
- diamondPathAlg :: Num u => u -> u -> PathAlg u
- polygonPathAlg :: Floating u => Int -> u -> PathAlg u
- arcPathAlg :: Floating u => u -> Radian -> Radian -> PathAlg u
- circlePathAlg :: (Fractional u, Floating u) => u -> PathAlg u
- type LocCoordPath u = Point2 u -> [Point2 u]
- coordinatePrimPath :: InterpretUnit u => LocCoordPath u -> Point2 u -> Query PrimPath
- rectangleCoordPath :: Num u => u -> u -> LocCoordPath u
- diamondCoordPath :: Num u => u -> u -> LocCoordPath u
- polygonCoordPath :: Floating u => Int -> u -> LocCoordPath u
- isoscelesTriangleCoordPath :: Floating u => u -> u -> LocCoordPath u
- isoscelesTrianglePoints :: Floating u => u -> u -> Point2 u -> (Point2 u, Point2 u, Point2 u)
- equilateralTriangleCoordPath :: Floating u => u -> LocCoordPath u
- equilateralTrianglePoints :: Floating u => u -> Point2 u -> (Point2 u, Point2 u, Point2 u)
Documentation
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.
pathStartIsStart :: [Vec2 u] -> PathAlg uSource
pathStartIsLocus :: [Vec2 u] -> PathAlg uSource
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
circlePathAlg :: (Fractional u, Floating u) => u -> PathAlg uSource
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]