This is not really an answer to your question, so you may want to wait for other answers which your questions about pst-solides3d
.
This answer is to build up the knowledge base and to address your last sentence in the linked question https://graphicdesign.stackexchange.com/questions/42022/transforming-3rd-party-discrete-gradient-mesh-to-ais-smooth-gradient-mesh, namely
Alternatively, if there is a better way to do this, I would also like
to know it. Thank you.
From what I understand, you want
- a smooth gradient (=smooth shading)
- quadrilateral patches
- vector graphics
This specific problem can be solved by means of pgfplots
. I have used a Möbius strip since I have neither your data files nor the parametrization of your surface:
- bilinear patches. First-order resolution of the patch boundary, bilinear color interpolation:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepgfplotslibrary{patchplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3[
surf,
samples=25, samples y=25,
variable=r, domain=-1:1,
variable y=a, domain y=0:2*pi,
trig format plots=rad,
shader=faceted interp,
patch type=bilinear,
]
({cos(a) * (1+r/2 * cos(a/2))},
{sin(a) * (1+r/2 * cos(a/2))},
{r/2 * sin(a/2)});
\end{axis}
\end{tikzpicture}
\end{document}
- bicubic patches. Third order resolution of the patch boundary (and less patches), bilinear color gradient:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\usepgfplotslibrary{patchplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot3[
surf,
samples=10, samples y=10,
variable=r, domain=-1:1,
variable y=a, domain y=0:2*pi,
trig format plots=rad,
shader=faceted interp,
patch type sampling,
patch type=bicubic,
]
({cos(a) * (1+r/2 * cos(a/2))},
{sin(a) * (1+r/2 * cos(a/2))},
{r/2 * sin(a/2)});
\end{axis}
\end{tikzpicture}
\end{document}
Both examples need the patchplots
library, and both have a parameterized surface depending on r
and a
. The parameterization is from wikipedia. Note that trig format plots=rad
switches the default config from degrees to radians.
Bicubic patches are quite difficult to generate: they have 16 points for each patch. The key patch type sampling
simplifies this considerably -- if the input data is sampled from a function anyway. If you have table input, you will have to provide the patches on your own.
The colors are taken from a colormap
: the smallest z
coordinate is mapped to the first color of the colormap
, the largest z
coordinate is mapped to the last color of the colormap
. Everything in-between is mapped linearly into the colormap
. Further reading: keys point meta
(choose which scalar value to use) and colormap
(which colormap
), also related are "Surface plots with explicit color".
Related question: Creating Bezier surfaces using procedural graphics