<<>> <> <> <> DIRECTORY IO, G2dSpline, G3dBasic, G3dMatrix; G3dSpline: CEDAR DEFINITIONS ~ BEGIN <> <> <> <> <<>> Spline: TYPE ~ G3dMatrix.Matrix; SplineRep: TYPE ~ G3dMatrix.MatrixRep; Bezier: TYPE ~ RECORD [b0, b1, b2, b3: Triple ¬ []]; Bspline: TYPE ~ RECORD [b0, b1, b2, b3: Triple ¬ []]; Hermite: TYPE ~ RECORD [p0, p1, tan0, tan1: Triple ¬ []]; SplinePlaneIntersect: TYPE ~ RECORD [nRoots: NAT ¬ 0, roots: ARRAY [0..3) OF REAL]; SplineSequence: TYPE ~ REF SplineSequenceRep; SplineSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Spline ]; NearSpline: TYPE ~ RECORD [ point: Triple ¬ [0.0, 0.0, 0.0], -- point on 3d spline t: REAL ¬ 0.0, -- parametric position distance: REAL ¬ 0.0 -- distance to spline ]; PerPointProc: TYPE ~ PROC [p: Triple] RETURNS [continue: BOOL ¬ TRUE]; Pair: TYPE ~ G3dBasic.Pair; Triple: TYPE ~ G3dBasic.Triple; Quad: TYPE ~ G3dBasic.Quad; Ray: TYPE ~ G3dBasic.Ray; TripleSequence: TYPE ~ G3dBasic.TripleSequence; NearSpline2d: TYPE ~ G2dSpline.NearSpline; <> InterpolateCyclic: PROC [knots: TripleSequence, tension: REAL ¬ 1.0] RETURNS [SplineSequence]; <> <> <<>> Interpolate: PROC [ knots: TripleSequence, tan0, tan1: Triple ¬ [], tension: REAL ¬ 1.0, c: SplineSequence ¬ NIL] RETURNS [SplineSequence]; <> <> <> SplineFromBezier: PROC [b: Bezier, out: Spline ¬ NIL] RETURNS [Spline]; <> SplineFromBspline: PROC [b: Bspline, out: Spline ¬ NIL] RETURNS [Spline]; <> <<>> SplineFromHermite: PROC [h: Hermite, out: Spline ¬ NIL] RETURNS [Spline]; <> <<>> BezierFromSpline: PROC [s: Spline] RETURNS [Bezier]; <> <<>> BsplineFromSpline: PROC [s: Spline] RETURNS [Bspline]; <> HermiteFromSpline: PROC [s: Spline] RETURNS [Hermite]; <> <<>> BezierFromHermite: PROC [p0, p1, v0, v1: Triple] RETURNS [b: Bezier]; <> <<>> CopySpline: PROC [spline: Spline, out: Spline ¬ NIL] RETURNS [Spline]; <> <> Position: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> Velocity: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> Tangent: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> <<>> PositionAndVelocity: PROC [s: Spline, t: REAL] RETURNS [pos, vel: Triple]; <> <<>> Acceleration: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> MinAcceleration: PROC [s: Spline] RETURNS [t: REAL]; <> <<>> Curvature: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> <<>> CurvatureMag: PROC [s: Spline, t: REAL] RETURNS [REAL]; <> <<>> WalkBezier: PROC [b: Bezier, proc: PerPointProc, epsilon: REAL ¬ 0.05, doLast: BOOL ¬ TRUE]; <> <> <> ForwardDifference: PROC [in: Spline, nSegments: INTEGER, out: Spline ¬ NIL] RETURNS [Spline]; <> Samples: PROC [s: Spline, nPoints: NAT, points: TripleSequence ¬ NIL] RETURNS [TripleSequence]; <> RefVec: PROC [s: Spline, t: REAL] RETURNS [Triple]; <> <<>> IsStraight: PROC [s: Spline, epsilon: REAL ¬ 0.01] RETURNS [BOOL]; <> <> <> <> Length: PROC [s: Spline, nSteps: NAT ¬ 100] RETURNS [REAL]; <> ConvexHullArea: PROC [b: Bezier] RETURNS [REAL]; <> ConvexHullLength: PUBLIC PROC [b: Bezier] RETURNS [REAL]; <> <<>> FlatBezier: PROC [b: Bezier, epsilon: REAL ¬ 0.05] RETURNS [BOOL]; <> <> <> <> Tiny: PROC [s: Spline, epsilon: REAL ¬ 0.05] RETURNS [BOOL]; <> Resolution: PROC [s: Spline, epsilon: REAL] RETURNS [INTEGER]; <> <> <> InflectionPoint: PROC [s: Spline] RETURNS [REAL]; <> <> <<>> NearestPoint: PROC [p: Triple, s: Spline, t0: REAL ¬ 0.0, t1: REAL ¬ 1.0, epsilon: REAL ¬ 0.01] RETURNS [NearSpline]; <> <> <> <> <> <<>> PreciseNearestPoint: PUBLIC PROC [p: Triple, s: Spline] RETURNS [n: NearSpline]; <> <<2-5 times slower than NearestPoint, depending on the position of p with respect to the curve.>> <<>> NearestPair: PROC [p: Pair, s: Spline, persp: BOOL ¬ FALSE, t0: REAL ¬ 0.0, t1: REAL ¬ 1.0] RETURNS [NearSpline2d]; <> <> <> <<>> NearestLine: PROC [ line: Ray, s: Spline, t0: REAL ¬ 0.0, t1: REAL ¬ 1.0, epsilon: REAL ¬ 0.01] RETURNS [sPt, lPt: Triple, t, dist: REAL]; <> <> <> <<>> NearestSpline: PROC [s1, s2: Spline, epsilon: REAL ¬ 0.01] RETURNS [t1, t2: REAL]; <> <> <<>> FurthestPoint: PROC [s: Spline] RETURNS [NearSpline]; <> <> <> SplitCurve: PROC [s: Spline, out1, out2: Spline ¬ NIL] RETURNS [s1, s2: Spline]; <> <> SplitBezier: PROC [b: Bezier] RETURNS [b1, b2: Bezier]; <> Subdivide: PROC [s: Spline, t: REAL] RETURNS [s1, s2: Spline]; <> Reparameterize: PROC [in: Spline, t0, t1: REAL, out: Spline ¬ NIL] RETURNS [Spline]; <> <> <> CopySplineSequence: PROC [splines: SplineSequence] RETURNS [SplineSequence]; <> <<>> AddToSplineSequence: PROC [splines: SplineSequence, spline: Spline] RETURNS [SplineSequence]; <> <<>> LengthenSplineSequence: PROC [splines: SplineSequence, amount: REAL ¬ 1.3] RETURNS [SplineSequence]; <> <> SlowInOut: PROC [value0, value1, t: REAL] RETURNS [REAL]; <> <> <<>> TameType: TYPE ~ RECORD [loop, cusp: BOOL ¬ TRUE, inflect, bulge: BOOL ¬ FALSE]; Tame: PROC [in: Spline, tameType: TameType, out: Spline ¬ NIL] RETURNS [Spline]; <> <> <> <> <> <> SplineFromPointsAndNormals: PROC [ point0, point1, normal0, normal1: Triple, tension: REAL ¬ 1.0, spline: Spline ¬ NIL] RETURNS [Spline]; <> <> <> <> <> <> IntersectSplineAndPlane: PROC [spline: Spline, plane: Quad] RETURNS [SplinePlaneIntersect]; <> <> GetA: PROC [s: Spline] RETURNS [Triple]; <> <<>> GetB: PROC [s: Spline] RETURNS [Triple]; <> <<>> GetC: PROC [s: Spline] RETURNS [Triple]; <> <<>> GetD: PROC [s: Spline] RETURNS [Triple]; <> <<>> Same: PROC [s1, s2: Spline] RETURNS [BOOL]; <> <<>> END. .. <> <> <> <<>> <> <> <> <> <<>>