Graphics, Figures & TablesAsymptote's rendering in interactive viewing mode

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

Asymptote's rendering in interactive viewing mode

Post by Ingvar »

The following example illustrates that something is wrong with Asymptote's rendering of transparency in 3D (in interactive viewing mode Acrobat Reader):
akPvJMEvRR0.jpg
akPvJMEvRR0.jpg (72.36 KiB) Viewed 1162 times
The example consists mainly of two intersecting (~blue) solids of revolution (spheres), which is partially transparent (rgb(0.3,0.7,1)+opacity(0.3)). The surfaces have weird-looking "streaks" and patches on them which I think are artifacts of the rendering.

The complete .tex file for generating the picture:

Code: Select all

\documentclass{standalone}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}
import solids;
currentprojection = perspective(0,100,25);
currentlight=Viewport;
viewportmargin=(0.1cm,0.1cm);
unitsize(1.2cm);
triple pO=(0,0,0);
real a=0.5;
real a1=0.1;
revolution s=sphere(pO,a);
revolution s1=sphere(pO,a1);
draw(surface(s),rgb(0.3,0.7,1)+opacity(0.3));
draw(surface(s1),red+opacity(0.3));

transform3 t1=shift(0.7*X);
draw(t1*surface(s),rgb(0.3,0.7,1)+opacity(0.3));
draw(t1*surface(s1),red+opacity(0.3));

path3 gene = (0,0,0)--(0.7,0,0);
draw(gene,black+bp);

\end{asy}
\end{document}
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