// Definition of the dimensions and texture:
//--------------------------------- Dimensions
#declare LR1 = 0.025; // radius latteral
#declare LR2 = 0.010; // radius of the 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 {ambient 0.15
diffuse 0.85 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 = 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
// cylinders latteral:
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 (...)
//--------------------------------------------
// Calling the "macro" object:
object{ Ladder(LR1,LR2,LW,LH, Step_Distance)
texture{Texture_L}
}
//---------------------------------------- end |
|