5

I need to include several 3d graphics in a LaTeX document, and decided to use asymptote. However, it seems that rendering takes too long. A document with 20 images takes more than 15 minutes to finish compiling.

I wonder if there is a way to tall asymptote to only draw the mesh (I suppose that would be quicker) and switch to a nicer rendering when I compile a final version of the document.

I have been compiling the document with these commands:

pdflatex text.tex
asy text-*.asy
pdflatex text.tex

As an example, the following takes a long time to finish, even though I have only told asymptote to just draw the mesh.

import graph3;
import contour3;
settings.render=4;

real f(real x, real y, real z) {return (x/2)^2 + y- (z/2)^2;}

draw(surface(contour3(f,(-3,-3,-3),(3,3,3),32)),surfacepen=nullpen,meshpen=black,render(compression=Low,merge=true));

defaultrender.merge=true;
defaultrender.tessellate=true;

I'd appreciate any ideas that will make asymptote run faster, but still give a minimally reasonable result (I only need to check if the surfaces are correct, if I need to change the camera, etc).

  • 1
    In this circumstances the mesh takes more time, than the surface - compare with surfacepen=black,meshpen=nullpen. To speed-up compilation in the draft mode you can also reduce the number of mesh lines from 32 to, say, 4 and set settings.render=1, this greatly reduces the compilation time. – g.kov Oct 28 '13 at 20:04
  • Thank you!!! It now compiles instantly! 8-) Would you mind posting your comment as answer? – Jay Oct 28 '13 at 20:12
  • 2
    Another comment: If you use latexmk with the appropriate configuration as described in the Asymptote manual, only the images that have changed will be recompiled. – Charles Staats Oct 28 '13 at 23:48
6

In this circumstances the mesh takes more time, than the surface - compare with surfacepen=black,meshpen=nullpen. To speed-up compilation in the draft mode you can also reduce the number of mesh lines from 32 to, say, 4 and set settings.render=1, this greatly reduces the compilation time.

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.