\ifthenelse{\bdorientation = \bdvert}
{
\FPfadd{\tmpvar}{#2}{#4}
\FPdiv{\xtda}{\tmpvar}{2} % Xcenter of the bottom ellipse
\FPdiv{\tmpvar}{\ytd}{2}
\FPfadd{\ytda}{\tmpvar}{#3} % Ycenter of the bottom ellipse
% Draw the bottom ellipse
\psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytda)(\elRx,\elRy)
\FPdiv{\tmpvar}{\ytd}{2}
\FPfadd{\ytdb}{\tmpvar}{#5} % Ycenter of the top ellipse
% Draw the rectangle
\psframe[fillstyle=solid,fillcolor=#6,linecolor=#6](#2,\ytda)(#4,\ytdb)
\psline(#2,\ytda)(#2,\ytdb)
\psline(#4,\ytda)(#4,\ytdb)
% Draw the top ellipse
\psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytdb)(\elRx,\elRy)
}
{ \FPfadd{\tmpvar}{#3}{#5}
\FPdiv{\ytda}{\tmpvar}{2}
\FPdiv{\tmpvar}{\ytd}{2}
\FPfadd{\xtda}{\tmpvar}{#2}
% Draw the left ellipse
\psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytda,)(\elRy,\elRx)
\FPdiv{\tmpvar}{\ytd}{2}
\FPfadd{\ytdb}{\tmpvar}{#4}
% Draw the rectangle
\psframe[fillstyle=solid,fillcolor=#6,linecolor=#6](\xtda,#3)(\ytdb,#5)
\psline(\xtda,#3)(\ytdb,#3)
\psline(\xtda,#5)(\ytdb,#5)
% Draw the right ellipse
\psellipse[fillstyle=solid,fillcolor=#6](\ytdb,\ytda)(\elRy,\elRx)
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%