3

Help me with 3D arc in asymptote. Thank you very much! Code:

\begin{asy}
settings.outformat="pdf";
import three;
size(7.5cm,0);
currentprojection=perspective(20,18,8);
currentlight=light(8,10,2);

path3 p=(-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle;
draw(p);
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g,2bp+.8red);
draw(surface(g),paleblue);
dot(g,5bp+.8green);
draw((0,0,0)--normal(p),1bp+blue,Arrow3()); 
\end{asy}

enter image description here

2

2 Answers 2

2

I compiled

\documentclass[border=3.14mm]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
settings.outformat="pdf";
import three;
size(7.5cm,0);
currentprojection=perspective(20,18,8);
currentlight=light(8,10,2);

path3 p=(-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle;
draw(p);
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g,2bp+.8red);
draw(surface(g),paleblue);
dot(g,5bp+.8green);
draw((0,0,0)--normal(p),1bp+blue,Arrow3()); 
\end{asy}
\end{document}

with the usual chain pdflatex, then asy and again pdflatex, I get a flawless

enter image description here

However, I prefer to use asypictureB, and when I compile

\documentclass[border=3.14mm]{standalone}
\usepackage{asypictureB}
\begin{document}
\begin{asypicture}{name=pfft}
settings.outformat="pdf";
import three;
size(7.5cm,0);
currentprojection=perspective(20,18,8);
currentlight=light(8,10,2);

path3 p=(-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle;
draw(p);
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g,2bp+.8red);
draw(surface(g),paleblue);
dot(g,5bp+.8green);
draw((0,0,0)--normal(p),1bp+blue,Arrow3()); 
\end{asypicture}
\end{document}

with

pdflatex -shell-escape

I also get this result. Please check what you get with these standard methods. If you get the same, please describe in detail what you do, i.e. provide us with a complete example, which starts with \documentclass and ends with \end{document} that allows us to reproduce the issue.

1

Full codes:

\documentclass[border=5mm]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
settings.outformat="pdf";
import three;
size(7.5cm,0);
currentprojection=perspective(20,18,8);
currentlight=light(8,10,2);
path3 p=(-1,-1,0)--(1,-1,0)--(1,1,0)--(-1,1,0)--cycle;
draw(p);
path3 g=(1,0,0)..(0,1,1)..(-1,0,0)..(0,-1,1)..cycle;
draw(g,2bp+.8red);
draw(surface(g),paleblue);
dot(g,5bp+.8green);
draw((0,0,0)--normal(p),1bp+blue,Arrow3()); 
\end{asy}
\end{document}

enter image description here

And error pdf: enter image description here

3
  • 1
    Is this now an answer or an addendum to your question?
    – user121799
    Nov 18, 2018 at 3:48
  • I still haven't fixed the bug. Maybe because of my computer's graphics card. Nov 19, 2018 at 6:45
  • @LêĐìnhMẫn please see my comment (following your question) and the link. It is not an error in your asy code but a driver pb. With 'maxtile` option it is possible to obtain a picture without black line.
    – O.G.
    Nov 19, 2018 at 7:55

You must log in to answer this question.

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