Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    deutsche Version

Wheel - with and without while-Loop overview Ladder

Winding Staircase - with a while Loop

Sample for the use of a while loop

Objects: "plane", "box"
Methods: "declare", "union", "while", "intersection", "bounded_by"
top view: principle of a step segment

The shape of the steps is formed by an intersection of a box with two rotated planes.
The stair is constructed with a while loop.

...
//------------------------------------- dimensions --------
#declare StH = 0.10; // Stepheight
#declare StT = 0.50; // Stepdeapth, maximum, outside
#declare StB = 1.20; // StepWide
#declare StI = 0.40; // StepInnerRadius
#declare StAnz = 40; // Number of Steps
#declare A = 360/20; // Step rotation angle
//------------------------------------------textures--------
// Here is a little trick to create
// "shadow differenciated colors"
// which look the same in the sunshine:
#declare Stex1 = texture{pigment{color White}
                         finish {ambient 0.15 diffuse 0.85}}
#declare Stex2 = texture{pigment{color White}
                         finish {ambient 0.10 diffuse 0.90}}
#declare Step = //-----------------------------------------
intersection{
box  {<0,0,-StT>,< StB,StH,StT>   translate<StI,0,0> 
         texture{Stex1}}
plane{<0,0, 1>,0 rotate<0,-A/2,0> translate<0,0,0.01>
         texture{Stex2}}
plane{<0,0,-1>,0 rotate<0, A/2,0> translate<0,0,0.0 >
          texture{Stex2}}
bounded_by{box{<0,0,-StT>,<StB,StH,StT> translate<StI,0,0>}}
    }//---------------------------------------- end of Step 

// - building all together and drawing of the winding staircase -
union{
//-------------------------------- #while - Loop -------
#declare Nr = 0;    // sets counter Nr on start value
#while (Nr<StAnz)  // check if end value is reached
   object{Step    // Object depending from counter Nr
              translate<0,Nr*StH,0>
              rotate <0,-Nr*A,0>}
#declare Nr = Nr+1; // increase counter by 1
#end               // end of the sector to repeat
//----------------------------------------------------------
rotate<0,90,0> } 
//----------------------------------------------------- end
Wendeltreppe - Winding Staircase  394x480
Click here for the complete scene description for POV-Ray:
".txt" file or ".pov" file

Wheel - with and without while-Loop overview Ladder

© Friedrich A. Lohmüller, 2003    emailemail: (legacy email redacted)