3

I just installed Asymptote on my laptop and while I can compile 2D images, rendering never completes when compiling 3D images. Here is what I did on my Windows 8.1, 64 bit machine:

  • installed Asymptote in standard directory
  • installed Ghostscript (64-bit, version 9.10)
  • created a config.asy file in the .asy folder, containing

    import settings;
    gs="C:\Program Files\gs\gs9.10\bin\gswin64.exe";
    
  • I edit my .asy files with TeXnicCenter, with a build profile with settings:

    path: C:\Program Files (x86)\Asymptote\asy.exe
    command line: -f pdf -tex "pdflatex" "%wm"
    

I can render 2D images just fine with labels. Anything that starts with `import three;' just hangs - no .pdf file is created and TeXnicCenter just shows that it is running...

Is there something I've overlooked in this setup?

  • Did you try running one of the known-good .asy files from the gallery? asymptote.sourceforge.net/gallery/3D%20graphs (Also, you could try running things from the command line so that you know it isn't your wrapper.) – Jim Hefferon Nov 9 '14 at 15:54
  • I have tried running .asy files from the installed Examples file, plus the basic cube from the manual. I tried running from the command line; running asy.exe test.asy compiles and displays the output but not in pdf format, of course. I tried asy.exe -f pdf test.asy and it again hangs. Is this perhaps a Ghostscript issue? – GregH Nov 9 '14 at 20:16
  • Does asy.exe have a verbose or debug option? Or does it write a log file somewhere? – cfr Nov 9 '14 at 21:31
  • @cfr - Yes, it does. That was the key to debugging it as I found it was looking for media9.sty which I hadn't installed on my TeXLive yet. Thanks. – GregH Nov 10 '14 at 2:40
  • Try running with the -k option to see the intermediate TeX files. – alfC Nov 10 '14 at 8:57
3

I am sure there can be lots of reasons why compiling might fail, but in my case I had not yet installed the TeX package media9 yet - i.e., the file media.sty. When installing TeXLive 2014, I installed a smaller version than the full system. I later added the Asymptote related packages but didn't realize that media9 was required for creating 3D graphics.

  • I don't think it's necessary for compiling the Asymptote file, but rather for importing the result in a LaTeX document. – egreg Nov 10 '14 at 8:52
  • 2
    @egreg Actually asymptote makes heavy use of media9 when generating 3D pdfs. One way of confirming this is to run with the -k (keep) option; this way you will get all the intermediate files. You can run latex on each of the intermediate files to see what fails. – alfC Nov 10 '14 at 8:56
  • 2
    media9 is used to produce any 3D PRC pdf output. In fact media9 allows to include the PRC code source of your picture and to create your pdf output. The OpenGL render does use media9. – O.G. Nov 10 '14 at 12:10

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.