Nodes.mesa
Maureen Stone August 29, 1984 11:32:46 am PDT
DIRECTORY
Seq,
LSPiece USING [Metrics],
Complex USING [Vec],
Cubic USING [Bezier];
Nodes: CEDAR DEFINITIONS = {
The inteface for nodes is a sequence of samples. Points should never be duplicated to close a curve. The routines will return a sequence of indices into the sample sequence that are the nodes, or places to consider for knots. The tangent routines take a sequence of samples and a sequence of nodes. They will return a sequence of tangents the same length as the sequence of nodes. If nodes=NIL then every sample will have a tangent computed. Sample sequences should be checked NIL before calling these routines.
DynNodes:
PROC [samples: Seq.ComplexSequence, closed:
BOOLEAN, penalty:
REAL]
RETURNS [nodes: Seq.NatSequence];
finds nodes by fitting a polygon using DynFit
CubicTangents:
PROC [samples: Seq.ComplexSequence, closed:
BOOLEAN, metrics: LSPiece.Metrics, nodes: Seq.NatSequence ←
NIL]
RETURNS [tangents: Seq.ComplexSequence];
Sets tangents at nodes by fitting a cubic between neighboring nodes
QuickTangents:
PUBLIC PROC [samples: Seq.ComplexSequence, closed:
BOOLEAN, maxAngle:
REAL, nodes: Seq.NatSequence ←
NIL]
RETURNS [tangents: Seq.ComplexSequence];
computes tangents by differencing neighbors
SquareTangents:
PUBLIC PROC [samples: Seq.ComplexSequence, closed:
BOOLEAN, maxAngle:
REAL, nodes: Seq.NatSequence ←
NIL]
RETURNS [tangents: Seq.ComplexSequence];
computes tangents, weighting the longer edges more
Progress: TYPE = PROC[tangent: Complex.Vec, cubic: Cubic.Bezier] RETURNS [stop: BOOLEAN];
ICubicTangents:
PROC [progress: Progress, samples: Seq.ComplexSequence, closed:
BOOLEAN, metrics: LSPiece.Metrics, nodes: Seq.NatSequence ←
NIL];
Like CubicTangents but allows incremental feedback
}.