SetTube:
PROC [p: ProgramData] ~ {
t: REAL ¬ REAL[p.nFrame]/REAL[p.nFrames];
angle: REAL ¬ 90.0-180.0*t;
p1: Triple ¬ [RealFns.CosDeg[angle], RealFns.SinDeg[angle], 0.0];
p.tube ¬ NEW[TubeRep ¬ [p0: [0, -1, 0], p1: [0, 0, 0], v0: [0, 0.5, 0], v1: [0, 0.5, 0]]];
p.tube.next ¬ NEW[TubeRep ¬ [p0: [0, 0, 0], p1: [0, 1, 0], v0: [0, 0.5, 0], v1: [0, 0.5, 0]]];
p.tube.branches ¬ NEW[TubeSequenceRep[1]];
p.tube.branches.length ¬ 1;
p.tube.branches[0] ¬ NEW[TubeRep ¬ [p0: [0,0,0], p1: p1, v0: [0,1,0], v1: p1]];
G3dTube.SetSpline[p.tube];
p.tube.name ¬ IO.PutFR["%gImplicitTube.%g", IO.rope[p.directory], IO.int[p.nFrame]];
G3dTube.SelectAll[p.tube];
G3dTube.SetRadii[p.tube, 0.1];
ImplicitTube.PrepareTube[p.tube, [$Segment, inverse]];
};