2

I've just copied some asymptote example code to test the compiling. This is my result:

Screenshot

enter image description here

MWE

\documentclass{standalone}

\usepackage[inline]{asymptote}

\begin{document}
\begin{asy}
import three;

currentprojection=orthographic(5,4,2,center=true);

size(5cm);
size3(3cm,5cm,8cm);

draw(unitbox);

dot(unitbox,red);

label("$O$",(0,0,0),NW);
label("(1,0,0)",(1,0,0),S);
label("(0,1,0)",(0,1,0),E);
label("(0,0,1)",(0,0,1),Z);
\end{asy}
\end{document}

What I did

  1. pdflatex cube.tex
  2. asy cube-1.asy
  3. pdflatex cube.tex

and I also tested it without LaTeX, but with the same result

  1. asy cube.asy

There was no error or anything else. Does someone has an idea how to get things to work?

5
  • 1
    I followed your prescription and get the graphics without black square. However, I have heard (without knowing the details) that there are issues with the graphics card vs. asymptote. So what I want to say is that I think that you are doing in principle the right steps.
    – user194703
    May 10, 2020 at 17:51
  • Thank you for looking into the problem. If you're right I have to look for an alternative to asymptote. I'll try pst-solids3d. May 10, 2020 at 17:54
  • 1
    I wouldn't give up so easily, see e.g. this post which provides you with further information and links. Maybe an expert shows up and finds a simple solution.
    – user194703
    May 10, 2020 at 17:56
  • 1
    Actually with your help I compiled the code successfully! (See my edit.) May 10, 2020 at 18:09
  • Glad to hear! I think it would be more appropriate to refer to the maxtile trick as OG's solution and to link this post. All I did was to Google a post that looked related with the search terms site:tex.stackexchange.com asymptote graphics card issue. (You could also write an answer so that in the future others have better chances of finding the thread. This does not exclude the possibility that an expert adds a more detailed answer.)
    – user194703
    May 10, 2020 at 18:15

1 Answer 1

1

Schrödinger's cat mentioned this post where O.G. uses the maxtile trick to solve the graphic card issue. I tested it and it works:

settings.outformat="pdf";
settings.prc = false;
settings.render = 0;

import three;

currentprojection=orthographic(5,4,2,center=true);

size(5cm);
size3(3cm,5cm,8cm);

draw(unitbox);

dot(unitbox,red);

label("$O$",(0,0,0),NW);
label("(1,0,0)",(1,0,0),S);
label("(0,1,0)",(0,1,0),E);
label("(0,0,1)",(0,0,1),Z);

...compiling this with asy -maxtile "(256,256)" cube.asy results in:

enter image description here

4
  • With settings.prc=false you miss the interactive 3D object that opens on click in Acrobat Reader.
    – AlexG
    May 11, 2020 at 6:44
  • @AlexG I think you can assume someone who includes the line settings.prc=false; does not want the interactive object unless they say otherwise. May 13, 2020 at 15:09
  • In this case, I would guess that the image has been deliberately set up so that the labels do not cross the lines, and allowing the viewer to change the point of view would mess that up. May 13, 2020 at 15:11
  • @CharlesStaats The original post does not rule out PRC, so my comment is justified.
    – AlexG
    May 13, 2020 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .