function S = stairs(GP)


degraus = GP.escadas.nDegraus;
lar_degrau = GP.escadas.comp;                  % largura do degrau
h0 = 0;                             % altura inicial das escadas
h = GP.escadas.altu;                           % altura da plataforma
l = lar_degrau*(degraus);           % largura da primeira plataforma

x=[];
y=[];
z=[];

for i=1:degraus,
    
    x = [x, [-l,-l,-l, l,-l;-l,-l,-l, l,-l; l,-l, l, l, l; l,-l, l, l, l]];
    y = [y, [-l,-l,-l,-l, l; l,-l,-l,-l, l; l, l,-l, l, l;-l, l,-l, l, l]];
    z = [z, [ h, h0, h0, h0, h0; h, h, h, h, h; h, h, h, h, h; h, h0, h0, h0, h0]];
    
    l=l-lar_degrau;
    h0=h;
    h=h+h/i;
    
end

S(:,:,1) = x+ones(size(x,1), size(x,2))*GP.escadas.x;
S(:,:,2) = y+ones(size(y,1), size(y,2))*GP.escadas.y;
S(:,:,3) = z;
S(1,:,4) = 1/(5*degraus):1/(5*degraus):1;           % cor

% keyboard
