TubeStructure.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, August 6, 1986 2:28:23 pm PDT
DIRECTORY Controls, Imager, IO, Matrix3d, Menus, Rope, Spline3d, TubeDefs, Vector3d;
TubeStructure: CEDAR DEFINITIONS
~ BEGIN
OPEN TubeDefs;
GetFrame: PUBLIC PROC [tube: Tube, t: REAL];
Return the frame at parametric position t.
ReScaleTube: PUBLIC PROC [tube: Tube, scale: REAL];
Resize tube.frames to scale*tube.r.
MakeTube: PUBLIC PROC [
tube: Tube, scale, epsilon: REAL ← 1.0, taper: REAL ← 0.0, view: Matrix ← NIL];
Create coeffs and reference frames for tube.
Only points, tangents, radii, and twists are assumed defined.
PropagateCircleRes: PUBLIC PROC [tube: Tube, circleRes: INTEGER];
Change circular resolution to circleRes for tube.
PropagateFrames: PROC [
tube: Tube, scale, epsilon: REAL ← 1.0, taper: REAL ← 0.0, view: Matrix ← NIL];
MakeFrames for each of the spline segments in tube. Epsilon controls the subdivision. 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.
MakeFrames: PROC [tube: Tube, scale0, scale1, epsilon: REAL ← 1.0, view: Matrix ← NIL];
Create sequence of frames for the entire limb. See PropagateFrames for an explanation of
epsilon and view.
ResInfo: PUBLIC PROC [tube: Tube]
RETURNS [nPoints, nPolys, minCres, maxCres: INTEGER];
Return the total number of points and polygons in a tube.
GetCircle: PUBLIC PROC [res: INTEGER] RETURNS [PairSequence];
Get a planar circle for subsequent tubular constructions.
Basis: PROC [v, vv, rv: Triple] RETURNS [n, b: Triple];
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
RefMatrix: PROC [p, x, y, z: Triple, s, t: REAL, out: Matrix ← NIL] RETURNS [Matrix];
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.
NSegments: PUBLIC PROC [tube: Tube] RETURNS [n: INTEGER ← 0];
Return number of splines in limb:
END.