function handles = DesenharRoboPZ( GP, axis_h )

P = GP.def.P;       % endoesqueleto
C = GP.def.C;       % juntas rotacionais
F = GP.def.F;       % pé
H = GP.def.H;       % anca
W = GP.def.W;       % tronco
E = GP.def.E;       % exoesqueleto


axes(axis_h);
cla
[AZ,EL] = view(3);
hr = hggroup;
%-- Elementos da superficie -----------------------------------------
    % Tapete
    if (isfield(GP.def, 'T'))
        T = GP.def.T;       % tapete
        handles.Th = patch(T(1,:), T(2,:), T(3,:),'c');
        axis([T(1,1) T(1,2) T(2,1) T(2,3) 0 0.70]), 
    else
        axis([-.8 .8  -.4 .4   0 .70])
    end
    axis('off'), axis('equal'),
    hold on
    % Escadas
    if(isfield(GP.def, 'S'))
        S = GP.def.S;       % escadas
        handles.Esh = patch(S(:,:,1),S(:,:,2),S(:,:,3), S(1,:,4), 'Visible', 'Off'); 
    end
    % Bola
    if(isfield(GP.def, 'Sp'))
        Sp = GP.def.Sp;     % Bola
        color = repmat(0.3, size(Sp,1), size(Sp,2));
        color(:,:,2) = repmat(1, size(Sp,1), size(Sp,2));
        color(:,:,3) = repmat(0.3, size(Sp,1), size(Sp,2));
        handles.Sph = surface(Sp(:,:,1),Sp(:,:,2),Sp(:,:,3), color, 'Visible', 'Off', 'LineStyle','none');
    end
%-- Elos mecanicos: endoesqueleto ("stick diagram") ----------------
    plot3(  0,0,0,'k.', 'Parent', hr);
    handles.E1(1)  = plot3( P( 1:14,1), P( 1:14,2), P( 1:14,3),'b','XDataSource', 'P( 1:14,1)', 'YDataSource', 'P( 1:14,2)', 'ZDataSource', 'P( 1:14,3)', 'Parent', hr, 'LineWidth', 2.0); %-- Pernas
    handles.E1(2)  = plot3( P(15:18,1), P(15:18,2), P(15:18,3),'b','XDataSource', 'P(15:18,1)', 'YDataSource', 'P(15:18,2)', 'ZDataSource', 'P(15:18,3)', 'Parent', hr, 'LineWidth', 2.0); %-- Tronco
    handles.E1(3)  = plot3( P(19:21,1), P(19:21,2), P(19:21,3),'b','XDataSource', 'P(19:21,1)', 'YDataSource', 'P(19:21,2)', 'ZDataSource', 'P(19:21,3)', 'Parent', hr, 'LineWidth', 2.0); %-- Cabeça
    handles.E1(4)  = plot3( P(22:24,1), P(22:24,2), P(22:24,3),'b','XDataSource', 'P(22:24,1)', 'YDataSource', 'P(22:24,2)', 'ZDataSource', 'P(22:24,3)', 'Parent', hr, 'LineWidth', 2.0); %-- Braço direito
    handles.E1(5)  = plot3( P(25:27,1), P(25:27,2), P(25:27,3),'b','XDataSource', 'P(25:27,1)', 'YDataSource', 'P(25:27,2)', 'ZDataSource', 'P(25:27,3)', 'Parent', hr, 'LineWidth', 2.0); %-- Braço esquerdo
%-- Elos mecanicos: exoesqueleto -----------------------------------
    for i=1:size(E,3), handles.Eh(i) = patch(   E(1,:,i),E(2,:,i),E(3,:,i),'y',...
                                                'Parent', hr);
    end
%-- Juntas rotacionais ---------------------------------------------
    for i=1:size(C,3),
        handles.Jh(i) = surface([C(1,:,i); C(2,:,i)],...
                                [C(3,:,i); C(4,:,i)],...
                                [C(5,:,i); C(6,:,i)],...
                                'Parent', hr);
    end
%-- Pe de suporte e pe livre --------------------------------------
    for i=1:size(F,3),
        handles.Fh(i) = patch(  F(1,:,i),F(2,:,i),F(3,:,i),'y',...
                                'Parent', hr);
    end
%-- Secçao da Anca ------------------------------------------------
    for i=1:size(H,3), 
        handles.Hh(i) = patch(  H(1,:,i),H(2,:,i),H(3,:,i),'y',...
                                'Parent', hr); 
    end
%-- Secçao do Tronco ----------------------------------------------
    for i=1:size(W,3), 
        handles.Wh(i) = patch(  W(1,:,i),W(2,:,i),W(3,:,i),'y',...
                                'Parent', hr);
    end
%-- Esfera na extremidade -----------------------------------------
    [X,Y,Z] = sphere(100);     %-- Esfera de raio unitario
    R = 0.025; X = R*X+P(28,1); Y = R*Y+P(28,2); Z = R*Z+P(28,3);
    handles.Sh = surface(X,Y,Z,'Parent', hr);
    

    handles.hr = hr;