\documentclass[a4paper]{article}
\usepackage{pst-solides3d,multido}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{arrayjob}
\pagestyle{empty}
\date{13 septembre 2\,006}
\author{JPV \& ML}

\title{test de couleur des faces}

\newarray\colors
\readarray{colors}{%
Apricot&Aquamarine%
&Bittersweet&Black&Blue&BlueGreen&BlueViolet&BrickRed&Brown&BurntOrange%
&CadetBlue&CarnationPink&Cerulean&CornflowerBlue&Cyan&Dandelion&DarkOrchid%
&Emerald&ForestGreen&Fuchsia&Goldenrod&Gray&Green&GreenYellow&JungleGreen%
&Lavender&LimeGreen&Magenta&Mahogany&Maroon&Melon&MidnightBlue&Mulberry%
&NavyBlue&OliveGreen&Orange&OrangeRed&Orchid&Peach&Periwinkle&PineGreen%
&Plum&ProcessBlue&Purple&RawSienna&Red&RedOrange&RedViolet&Rhodamine&RoyalBlue%
&RoyalPurple&RubineRed&Salmon&SeaGreen&Sepia&SkyBlue&SpringGreen&Tan&TealBlue%
&Thistle&Turquoise&Violet&VioletRed&White&WildStrawberry&Yellow&YellowGreen&YellowOrange}


\edef\colorfaces{}%
\multido{\i=0+1}{67}{%
 \checkcolors(\i)
\xdef\colorfaces{\colorfaces\i\space(\cachedata)\space}}

% chaque face de 0 à 66 se voit affectée d'une couleur dans l'ordre de la liste.

\begin{document}
\maketitle
\begin{enumerate}
  \item couleur d'une face + définition utilisateur du maillage
\end{enumerate}

\begin{center}
%%
\psset{unit=0.5}
%
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psset{Decran=30}
% je garde les valeurs par défaut
\psSolid[
   typedrawsolid=solid*,
  fcol=1 (OliveGreen) 0 (color1) 5 (color2),
   object=cube,
   RotZ=30
](0,0,0)
\end{pspicture}
%%
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psset{Decran=25}
\psset{color1=Mahogany,color2=Aquamarine}
\psSolid[
 fcol=\colorfaces,
   object=cylindre,
   ngrid=8 9,
   RotZ=30
](0,0,-3)
\end{pspicture}
%%
\end{center}

\begin{center}
%%
\psset{unit=0.5}
%%
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psset{Decran=30}
\psset{color1=cyan,color2=red}
\psSolid[
  fcol=\colorfaces ,
   object=sphere,
   ngrid=10 10,
   RotZ=30
](0,0,0)
\end{pspicture}
%%
%%
\begin{pspicture}(-5,-5)(5,5)
\psframe(-5,-5)(5,5)
\psset{Decran=50,viewpoint=10 5 20}
\psset{color1=Plum,lightsrc=10 5 20,grid=false}
\psSolid[
  fcol=\colorfaces ,
   object=sphere,
   ngrid=12 12,
   RotZ=30
](0,0,0)
\end{pspicture}
%%
\end{center}

\end{document}
