Is there a way to get Asymptote 3D figures in a PDF viewable in Evince/Okular?
All what I can get is a very bad rastered image in place of my figure.
I don't care about the interaction with the 3D figure.
I would be happy to get a clean vector graphics 2D projection (from a certain viewpoint) in a PDF file. My target is to include it in a LaTeX document that can be reliably opened with Evince/Okular.
- Evince Version: 2.28.2
- Asymptote Version: 2.16
I am trying the very basic 3D example of unit circle:
import three;
size(100);
path3 g=(1,0,0)..(0,1,0)..(-1,0,0)..(0,-1,0)..cycle;
draw(g);
draw(O--Z,red+dashed,Arrow3);
draw(((-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle));
dot(g,red);
Rastered Image:
3D view in Acroread
Best Answer
There are several options to get
3d
asy
viewable in other viewers thanAcrobat reader
(without interactive3d
feature). The options-noprc
and-render=<num>
have to be specified. The commandasy -f pdf -noprc -render=0
results invector
output (there are some limitations, esp. when transparency is used to draw surfaces) and the other way is, for example,asy -f pdf -noprc -render=4
(or higher than4
) will generate a higher quality raster image. This is a vector output viewed in Evince:Versions used are:
but it should work with your versions as well.