Module Mlpost.MetaPath
MetaPaths: gradually build a path with constraints, get a real path at thxe end.
type direction
= Path.direction
A
direction
is used to put constraints on metapaths:vec p
defines a direction by a point (interpreted as a vector)curl f
changes the curling factor of the extremity of a metapath; higher curling factor means flatter curvesnoDir
means no particular direction
type knot
= Path.knot
A
knot
is the basic element of a metapath, and is simply a point with an incoming and outgoing direction constraint
val knotp : ?l:direction -> ?r:direction -> Point.t -> knot
Build a knot from a point; the optional arguments are the incoming directions.Warning they are going in the same direction.
type joint
= Path.joint
A joint is the connection between two knots in a metapath. It is either
jLine
for a straight linejCurve
for a spline curvejCurveNoInflex
to avoid inflexion pointsjTension f1 f2
to specify "tension" on the joint;jCurve
uses a default tension of 1. Higher tension means less "wild" curvesjControls p1 p2
to explicitely specify control points
val jLine : joint
val jCurve : joint
val jCurveNoInflex : joint
val jTension : float -> float -> joint
val jControls : Point.t -> Point.t -> joint
type path
= Path.t
Labelled metapath constructors
val knot : ?l:direction -> ?r:direction -> ?scale:(float -> Num.t) -> (float * float) -> knot
Build a knot from a pair of floats
- parameter l
an incoming direction
- parameter r
an outgoing direction
- parameter scale
a scaling factor applied to the floats
val knotn : ?l:direction -> ?r:direction -> (Num.t * Num.t) -> knot
Build a knot from a Num.t pair; the optional arguments are as in
knot
val path : ?style:joint -> ?scale:(float -> Num.t) -> (float * float) list -> t
Build a metapath from a list of pairs of floats
- parameter style
the joint style used for all joints in the metapath
- parameter cycle
if given, the metapath is closed using the given style
- parameter scale
permits to scale the whole metapath
val jointpathp : Point.t list -> joint list -> t
Build a metapath from
n
points andn-1
joints, with default directions
Primitive metapath constructors
Predefined values
val defaultjoint : joint
The default joint style (
JCurve
)