Nodes.mesa
Copyright © 1985 by Xerox Corporation.  All rights reserved.
Maureen Stone August 29, 1984 11:32:46 am PDT
Doug Wyatt, September 5, 1985 2:32:29 pm PDT
 
DIRECTORY
Complex USING [VEC],
Cubic USING [Bezier],
LSPiece USING [Metrics],
Seq USING [ComplexSequence, NatSequence];
 
Nodes: CEDAR DEFINITIONS = {
The interface 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
 
}.