<> <> <> <> <> <> <> <<>> DIRECTORY Seq USING [JointSequence, ComplexSequence], Complex USING [VEC], Rope USING [ROPE], LSPiece USING [Metrics], Cubic2 USING [Bezier]; PiecewiseFit: CEDAR DEFINITIONS = { Data: TYPE = REF DataRec; DataRec: TYPE = RECORD [ samples: Seq.ComplexSequence, closed: BOOLEAN, joints: Seq.JointSequence, --[index: NAT, forced: BOOLEAN] tangents: Seq.ComplexSequence --two per potentialKnot; tanIn, tanOut ]; <> <> <> Default: PROC [data: Data]; <> << >> Error: SIGNAL [why: Rope.ROPE]; <<>> Metrics: TYPE = LSPiece.Metrics; <> <> <> <> <> <> <<];>> <= maxItr. The curve is not guaranteed to fit within all the metrics, only the first one to get small enough.>> Cubic2Proc: TYPE = PROC[bezier: Cubic2.Bezier, sumErr, maxDev: REAL, iterations: INT] RETURNS[quit: BOOLEAN _ FALSE]; <> FitSpline: PROC [data: Data, metrics: Metrics, outputCubic2: Cubic2Proc]; <> GrowSpline: PROC [data: Data, metrics: Metrics, outputCubic2: Cubic2Proc, hilight: Cubic2Proc _ NIL]; <> DynSpline: PROC [data: Data, metrics: Metrics, penalty: REAL, trim: BOOLEAN _ TRUE, outputCubic2: Cubic2Proc, hilight: Cubic2Proc _ NIL]; <> FitPiece: PROC [data: Data, from, thru: NAT, initFree, finalFree: BOOLEAN _ TRUE, metrics: Metrics, outputCubic2: Cubic2Proc]; <> TangentProc: TYPE = PROC[data: Data, at: NAT] RETURNS[Complex.VEC]; --at is the index of the point where the tangent is needed ie. data.samples[at]; AdaptiveFit: PROC [data: Data, from, thru: NAT, initFree, finalFree: BOOLEAN _ TRUE, metrics: Metrics, outputCubic2: Cubic2Proc, tangent: TangentProc]; <> }.