5

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

6

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.

  • 1
    And how could we get both, a scalable vector graphics as the poster imgage and an interactive 3D model that opens on click on those Readers which support it? – AlexG Sep 18 '13 at 17:52
  • @AlexG: It's a good question, never thought about it. Not sure if these options are mutually exclusive. – g.kov Sep 18 '13 at 18:09
  • 1
    asy -f pdf -render=0 produces both, a preview as vector graphics and the PRC. – AlexG Mar 17 '14 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.