function VM = parallelepiped(X)

A = X';

VM = [0 0 0; A(1,1:3); A(1,1:3)+A(2,1:3); A(2,1:3); A(3,1:3);
    A(1,1:3)+A(3,1:3); A(1,1:3)+A(2,1:3)+A(3,1:3); 
    A(2,1:3)+A(3,1:3)];
    
FM = [1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; 1 2 3 4; 5 6 7 8];

patch('Vertices',VM,'Faces',FM,'FaceVertexCData',hsv(6),'FaceColor','flat')
end