2

The following example illustrates that something is wrong with Asymptote's rendering of Gradient in 3D (in interactive viewing mode Acrobat Reader):enter image description here

The complete .tex file for generating the picture:

\documentclass{standalone}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}
import solids;
import palette;
currentprojection = perspective(0,100,25);
currentlight=Viewport;
viewportmargin=(0.1cm,0.1cm);
unitsize(5cm);
triple pO=(0,0,0);
path3 gene=(-0.57,0,0)..(-0.3,0,0.3)..(-0.1,0,0.3)..(0.1,0,0.42)..(0.3,0,0.52)..(0.99,0,0);
triple point1=(0,0,0), point2=(0,1,0);

revolution sur=revolution(pO,gene,X,0,360); surface sur=surface(sur); sur.colors(palette(sur.map(xpart), Gradient(red,royalblue))); draw(sur);

\end{asy} \end{document}

May I know what's the problem? Can you please offer some help on this topic?

Ingvar
  • 51
  • Does the problem also occur when you compile directly from Asymptote itself instead of in a LaTeX document? – Marijn Mar 21 '22 at 09:11
  • To answer my own comment (I just tried it), direct compilation from Asymptote in the preview window and in EPS output is more or less smooth, but in pdf output with prc the gradient is as shown in the question. – Marijn Mar 21 '22 at 09:33
  • @Marijn, well, unfortunately, all I can do is code on the Overleaf. The image looks fine in non-activated mode of this pdf-document. – Ingvar Mar 21 '22 at 09:35
  • @Marijn, Seems to me the problem is due to the points of the ´´´´path´´´´. – Ingvar Mar 21 '22 at 09:50
  • Apparently this issue is known for PRC (the interactive 3D format used in Adobe Reader), see https://tex.stackexchange.com/questions/225461/asymptote-draw-surface-from-data-points-in-3d that contains some comments mentioning smooth gradients in PRC. – Marijn Mar 21 '22 at 10:17

0 Answers0