Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

- POV-Ray Tutorial

  - POV-Ray Examples
   Index of Content
  - Geometry
  - Architecture
  - Engineering
    - Ladder
    - Pylons
    - Railing
    - Bridge
    - Tubes
    - Tube Fork
    - Tube Stopcock
    - Chain
    - Coil of Wire
    - Torpedo
    - Cruise Missile
    - Rocket
    - Wheel
    - Truck
    - Propeller
    - Airplanes
    - Canoe
    - Guitar Body
    - 7-Segment Display
    - Ribbon Cable
    - Cable Harness


with "macro" and while loop
Objects: cylinder.
Methods: #declare, #local, union, #macro, #while.

An include file to use this object as a read-made object
you can find at my POV-Ray Objects page.

The following "macro" produces a ladder. Here we have to define the radius of the lateral cylinders, the radius of the steps, the half width of the steps as well as the height of the ladder and distance of the steps. The number of steps is calculated by the height and the distance in this "macro". The steps are placed with a while loop.

Definition of the dimensions and texture:

//------------------------------ Dimensions
#declare LR1 = 0.025; // radius latteral
#declare LR2 = 0.010; // radius of steps
#declare LW = 0.23-LR1;// half width
#declare LH = 3.20;   // height
#declare Step_Distance = 0.25;
//--------------------------------- texture
#declare Texture_L =
 texture{pigment{color White}
         finish {diffuse 0.9 phong 1}} 

The "macro" itself:

//---------------------------------- Ladder
#macro Ladder (R1_L,R2_L,W_L,H_L,Step_Dist)
#local Step_Totals = int(H_L / Step_Dist);
#local Step =

#local Nr  = 0;             // start
#local EndNr = Step_Totals; // end
#while (Nr < EndNr)
 #declare Nr = Nr + 1;  // next Nr
#end // --------------- end of loop
// cylinders latteral:
         translate< W_L,0,0>}
 }// end of union
#end // end of macro  "Ladder (...)

Calling the "macro" object:

>object{ Ladder(LR1,LR2,LW,LH,Step_Distance)
      } // end of object
//------------------------------------- end 
Scene description
for POV-Ray:
or "ladder.pov"
Ready-made POV-Ray objects as
include files and example files you'll find
at the POV-Ray Objects Page

© Friedrich A. Lohmüller, 2009