[Tex/LaTex] Asymptote 3D viewable in Evince/Okular

3dasymptoteevinceokular

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:

enter image description here
enter image description here

3D view in Acroread

Best Answer

There are several options to get 3d asy viewable in other viewers than Acrobat reader (without interactive 3d feature). The options -noprc and -render=<num> have to be specified. The command asy -f pdf -noprc -render=0 results in vector 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 than 4) will generate a higher quality raster image. This is a vector output viewed in Evince: enter image description here

Versions used are:

  • Evince Version: 3.2.1
  • Asymptote Version: 2.24,

but it should work with your versions as well.