Graphics, Figures & TablesProblem about Asymptote's Gradient

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Ingvar
Posts: 2
Joined: Mon Mar 21, 2022 11:14 am

Problem about Asymptote's Gradient

Post by Ingvar »

The following example illustrates that something is wrong with Asymptote's rendering of Gradient in 3D (in interactive viewing mode Acrobat Reader):
ZKCoM.png
ZKCoM.png (225.42 KiB) Viewed 1288 times
The complete .tex file for generating the picture:

Code: Select all

\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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply