DIRECTORY Controls, Imager, IO, Matrix3d, Menus, Rope, Spline3d, TubeDefs, Vector3d; TubeGeometry: CEDAR DEFINITIONS ~ BEGIN OPEN TubeDefs; SetCoeffs: PUBLIC PROC [tube: Tube]; SetSectionCoeffs: PUBLIC PROC [tube: Tube]; SetLengths: PUBLIC PROC [tube: Tube]; SetSectionLengths: PUBLIC PROC [tube: Tube]; Make: PUBLIC PROC [ tube: Tube, epsilon: REAL _ 0.03, scale: REAL _ 1.0, taper: REAL _ 0.0, skin: BOOL _ FALSE, roundTip: BOOL _ FALSE, view: Matrix _ NIL, frameProc: FrameProc _ NIL]; MakeFrames: PROC [ tube: Tube, epsilon: REAL _ 0.03, scale: REAL _ 1.0, taper: REAL _ 0.0, skin: BOOL _ FALSE, roundTip: BOOL _ FALSE, view: Matrix _ NIL, frameProc: FrameProc _ NIL]; MakeSectionFrames: PROC [ tube: Tube, epsilon: REAL _ 0.03, scale0, scale1: REAL _ 1.0, skin: BOOL _ FALSE, roundTip: BOOL _ FALSE, view: Matrix _ NIL, frameProc: FrameProc _ NIL]; ReScale: PUBLIC PROC [tube: Tube, scale: REAL _ 1.0, taper: REAL _ 0.0]; SetCircles: PUBLIC PROC [tube: Tube, circleRes: NAT]; NFrames: PUBLIC PROC [tube: Tube] RETURNS [INTEGER]; GetFrame: PUBLIC PROC [tube: Tube, t: REAL] RETURNS [Frame]; PutFrame: PUBLIC PROC [tube: Tube, frame: Frame]; CopyFrame: PUBLIC PROC [frames: Frame] RETURNS [Frame]; CopyFrames: PUBLIC PROC [frames: FrameSequence] RETURNS [FrameSequence]; Basis: PUBLIC PROC [v, vv, rv: Triple] RETURNS [Triad]; RefMatrix: PUBLIC PROC [position: Triple, triad: Triad, scale, twist: REAL, out: Matrix _ NIL] RETURNS [Matrix]; XYFromFrame: PUBLIC PROC [point: Triple, tube: Tube, t: REAL] RETURNS [Pair]; END. ΨTubeGeometry.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Bloomenthal, January 22, 1987 3:40:13 pm PST Setting Spline Coefficients Set the spline coefficients for tube and its descendents. Set the spline coefficients for tube only. Setting Tube Lengths Set the length0 and length1 fields for tube and its descendents. Set the length0 and length1 fields for tube only. Creating Tube Frames Create spline coefficients and reference frames for the entire tube (its descendants and antecedants). For each tube section, points, tangents, radii, and twists are presumed defined. scale is the amount by which a frame matrix is scaled at the base of the tree. The scale is reduced according to distance from the tube base and taper; if taper is 0, no tapering occurs; if taper is 1, then scale is reduced to zero after a distance of 1. If skin is TRUE then the curve subdivison considers the variation in any associated contours and at each frame the contour is computed. If roundTip is TRUE then make the ends of those tubes without branches be hemispherical by adding additional frames. If view is NIL, the tube is considered only in object space and epsilon is the same discriminator as in Spline3d.FlatBezier; if view is non-NIL, epsilon is the number of pixels the straight line approximation is permitted to deviate from the curve as transformed to screen space. If frameProc is non-NIL, it is used to create the each frame; otherwise a standard procedure, return a frame consisting of a circular cross-section. Make the frames for the tube sub-tree (tube and its descendants only). epsilon, scale, taper, skin, roundTip, view, and frameProc have same meaning as in Make[]. Create a frame sequence for the tube section only. epsilon, skin, roundTip, view, and frameProc have the same meaning as in Make[]. scale0 and scale1 are the scales applied at the beginning and end of the tube section. Altering Tube Frames Resize tube.frames to scale*tube.r. Set all tube frames to be circular, with the given resolution. Miscellaneous Frame Operations Return the number of frames in tube. Return the frame at parametric position t, t IN [0..1]. Insert the frame in the tube. Return a copy of the input frame. Return a copy of the input frame sequence. Frame Geometric Operations Given tangent v along a curve, previous tangent vv, and reference vector rv, compute vectors n and b; v, n, and b form a new set of axes; the transformation of the x, y, and z axes to v, n, and b accomodates the twist in the curve; n and b are unitized. Return matrix which transforms origin to p, xaxis to x, yaxis to y and zaxis to z; twist around z by t degrees and scale by s. Return the point as transformed to the x-y plane determined by tube.frames at t. Κ<˜šœ™Jšœ Οmœ1™——š ™š ‘œžœžœžœžœ˜4L™$L™—š ‘œžœžœžœžœ ˜