// Vorgabe der Dimensionen u. der Textur:
//-------------------------------- Dimensionen
#declare LR1 = 0.025; // Radius
#declare LR2 = 0.010; // Radius d. Stufen
#declare LW = 0.23-LR1;// halbe Breite
#declare LH = 3.20; // Höhe
#declare Step_Distance = 0.18;
// Stufen-Abstand
//------------------------------------- Textur
#declare Texture_L =
texture{pigment{color White}
finish {ambient 0.15
diffuse 0.85 phong 1}}
// Das eigentliche "macro":
//------------------------------------- Leiter
#macro Ladder (R1_L,R2_L,W_L,H_L, Step_Dist)
#local Step_Totals = int(H_L / Step_Dist);
#local Step = cylinder{<-W_L,0,0>,<W_L,0,0>,R2_L}
#local Nr = 0; // start
#local EndNr = Step_Totals; // end
union{
#while (Nr< EndNr)
object{Step
translate<0,(Nr+0.5)*Step_Dist,0>}
#declare Nr = Nr + 1; // next Nr
#end // --------------- end of loop
// Zylinder seitlich:
cylinder{<0,0,0>,<0,H_L,0>,R1_L
translate<W_L,0,0>}
cylinder{<0,0,0>,<0,H_L,0>,R1_L
translate<-W_L,0,0>}
}// end of union
#end // end of macro "Ladder (...)
//--------------------------------------------
// Aufruf des "macro"-Objekts:
object{ Ladder(LR1,LR2,LW,LH, Step_Distance)
texture{Texture_L}
}
//---------------------------------------- end |
|