diagrams-contrib-1.3.0: Collection of user contributions to diagrams EDSL

Safe HaskellNone
LanguageHaskell2010

Diagrams.TwoD.Path.Metafont.Types

Synopsis

Documentation

data PathJoin d j Source

A PathJoin specifies the directions at both ends of a segment, and a join which describes the control points explicitly or implicitly.

Constructors

PJ 

Fields

_d1 :: d
 
_j :: j
 
_d2 :: d
 

Instances

j :: forall d j j. Lens (PathJoin d j) (PathJoin d j) j j

d2 :: forall d j. Lens' (PathJoin d j) d

d1 :: forall d j. Lens' (PathJoin d j) d

data PathDir n Source

A direction can be specified at any point of a path. A curl should only be specified at the endpoints. The endpoints default to curl 1 if not set.

Constructors

PathDirCurl n 
PathDirDir (Dir n) 

isCurl :: PathDir n -> Bool Source

A predicate to determine the constructor used.

type Curl n = n Source

type Dir n = Direction V2 n Source

data Tension n Source

Higher Tension brings the path closer to a straight line between segments. Equivalently, it brings the control points closer to the endpoints. TensionAmt introduces a fixed tension. TensionAtLeast introduces a tension which will be increased if by so doing, an inflection point can be eliminated.

Constructors

TensionAmt n 
TensionAtLeast n 

Instances

Show n => Show (Tension n) 

data TensionJoin n Source

Two tensions and two directions completely determine the control points of a segment.

Constructors

TJ 

Fields

_t1 :: Tension n
 
_t2 :: Tension n
 

data ControlJoin n Source

The two intermediate control points of a segment, specified directly.

Constructors

CJ 

Fields

_c1 :: P2 n
 
_c2 :: P2 n
 

t2 :: forall n. Lens' (TensionJoin n) (Tension n)

t1 :: forall n. Lens' (TensionJoin n) (Tension n)

c2 :: forall n. Lens' (ControlJoin n) (P2 n)

c1 :: forall n. Lens' (ControlJoin n) (P2 n)

data P Source

data J Source

data MFPathData a n where Source

MFPathData is the type manipulated by the metafont combinators.

data MetafontSegment d j n Source

MetafontSegment is used internally in solving the metafont equations. It represents a segment with two known endpoints, and a join, which may be specified in various ways.

Constructors

MFS 

Fields

_x1 :: P2 n
 
_pj :: PathJoin d j
 
_x2 :: P2 n
 

Instances

Functor (MetafontSegment d j) 
(Show d, Show j, Show n) => Show (MetafontSegment d j n) 

data MFPath d j n Source

MFPath is the type used internally in solving the metafont equations. The direction and join types are progressively refined until all control points are known. The loop flag affects both the equations to be solved and the type of Trail in the result. If constructing an MFPath in new code, the responsibility rests on the user to ensure that successive MetafontSegments share an endpoint. If this is not true, the result is undefined.

Constructors

MFP 

Fields

_loop :: Bool
 
_segs :: [MetafontSegment d j n]
 

Instances

(Show d, Show j, Show n) => Show (MFPath d j n) 

type MFP n = MFPath (Maybe (PathDir n)) (BasicJoin n) n Source

MFP is a type synonym to clarify signatures in Metafont.Internal. Note that the type permits segments which are "overspecified", having one or both directions specified, and also a ControlJoin. In this case, Metafont.Internal ignores the directions.

type MFS n = MetafontSegment (Maybe (PathDir n)) (BasicJoin n) n Source

MFS is a type synonym to clarify signatures in Metafont.Internal.

x2 :: forall d j n. Lens' (MetafontSegment d j n) (P2 n)

x1 :: forall d j n. Lens' (MetafontSegment d j n) (P2 n)

pj :: forall d j n d j. Lens (MetafontSegment d j n) (MetafontSegment d j n) (PathJoin d j) (PathJoin d j)

segs :: forall d j n d j n. Lens (MFPath d j n) (MFPath d j n) [MetafontSegment d j n] [MetafontSegment d j n]

loop :: forall d j n. Lens' (MFPath d j n) Bool