7

Consider the following minimal Asymptote 3D example:

\documentclass{article}
\usepackage{filecontents}
\usepackage{asymptote}
\begin{filecontents*}{testfile.asy}
import three;
currentprojection=perspective(3,-4,4,center=true);
    draw((0,0,0)--(0,2,0));
    draw((0,0,0)--(2,0,0));
    draw((2,2,0)--(0,2,0));
    draw((2,2,0)--(2,0,0)); 
    draw((0,0,0)--(0,0,2));
    draw((0,2,0)--(0,2,2));
    draw((2,0,0)--(2,0,2));
    draw((2,2,0)--(2,2,2));
    draw((0,0,2)--(0,2,2));
    draw((0,0,2)--(2,0,2));
    draw((2,2,2)--(0,2,2));
    draw((2,2,2)--(2,0,2));
\end{filecontents*}
\begin{document}
    \asyinclude[height=25mm,inline=true,attach=false,viewportwidth=4cm,viewportheight=25mm]{testfile.asy}
\end{document}

It generated a 3D figure which is rotatable in Adobe Reader after the user clicks on it. However, the 'poster' image displayed first (which is also used for printing) is rendered as a raster image. Is there any way to render it vectorized?

6
settings.render=0;

can generate vector graphics. But it fails when using such inline examples. :-(

render=0 force Asymptote to use an old algorithm (used before ver. 1.44). It generate vector graphics but it has some other restrictions about hidden removal. The result may be wrong.

It is possible to compile the 2D result seperately by hand. It's a bit boring, but it works.

I'm still intereted in it. Maybe we should post a message to asymptote.sf.

  • settings.render=0; worked for me, but gave slightly different viewpoint, both for the static image and the 3D model and those two weren't the same anymore. – Ben Jan 19 '11 at 12:18

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.