Summary

Intertwined sweeps

Demo-file: Demo8.pov

The approach detailed in the previous chapter can be used to form intertwined sphere_sweeps. However, there is another way, which will be shown below. Here a macro has been written (LinearFlecht), which creates positions on a segment of a cylinder. The size of this segment, the angle when viewed from the center of the cylinder, is one parameter of the macro, the radius of the cylinder another. The red spheres in the figures below indicate the start and end of the cylinder. There we show the results when we first increase the size of the cylinder segment (the variability of the angle a certain sphere_sweep can span when viewed from the center of the cylinder) and then the variability of the radius of the cylinder. In these examples we show several sphere_sweeps which have been produced by multiple repetitions of the whole procedure.

Sphere_sweep, cubic spline Sphere_sweep, cubic spline Sphere_sweep, cubic spline Sphere_sweep, cubic spline Sphere_sweep, cubic spline Sphere_sweep, cubic spline Sphere_sweep, cubic spline

Here is the code it takes to create these structures: First the macro which is creating the positions on the cylinder and stores these positions in an array:

//The following macro creates the positions for a sphere_sweep, which is constructed on a cylinder around a given vector.
//The parameters for the macro are the start and end position for the vector, the radius of the cylinder,
//the number of positions created for the sphere_sweep and the variance of the angle of the sphere_sweep positions,
//viewed from the center of the cylinder.

#macro LinearFlecht (PStart, PEnd, Radius, Number, VarianceAngle)

#declare Positions2 = array [Number];//The array for the positions is initiated.

//The outermost positions for the sphere_sweeps are defined.
#declare Positions2 [0] = PStart-0.1*(PEnd-PStart);
#declare Positions2 [Number-1] = PEnd+0.1*(PEnd-PStart);

//The inner positions for the sphere_sweeps are defined by the following loop and stored in the array.
#declare var1 = rand(chance1);
#local ticker = 1;
#while (ticker < Number-1)
#local P1 = PStart + (ticker-1)*(PEnd-PStart)/(Number-3);
#local P2 = VPerp_To_Vector(PEnd-PStart) ;
#local P2 = vnormalize (P2) ;
#local P1 = P1 + Radius *P2;
#local P1 = vaxis_rotate(P1,PEnd-PStart,360 * var1);
#local P1 = vaxis_rotate(P1,PEnd-PStart,VarianceAngle*rand(chance3)) ;
#declare Positions2 [ticker] = P1;
#local ticker = ticker + 1;
#end
#end

And then the code that repeatedly invokes this macro together with other macros drawing the sphere_sweeps and the spheres.

//Initialization of pseudo-random streams.
#local chance1 = seed (13);
#local chance2 = seed (15);
#local chance3 = seed (23);

//This loop creates a sphere_sweep (together with spheres labeling the defining positions) every turn.
#declare ticker1 = 0;
#while (ticker1 <18)

//The radius can of the cylinder can vary throughout the loop.
#declare Radius = 2 + 0.1*(rand(chance1)-0.5);

//This macro creates the positions.
LinearFlecht (<0, 0, 0>, <0, 0, 24>, Radius, 7, 20)

//This macro draws the sphere_sweeps.
DrawSphereSweep (Positions2, 0.1, 7)

//And this macro draws the spheres.
DrawSpheres (Positions2, 0.12, 7)
#declare ticker1 = ticker1 + 1;
#end

Summary