I am trying to draw a simple tetrahedron with the following code (in Asymptote)
size(10cm,0);
import math;
import three;
import graph3;
currentprojection=perspective(1/3,-1,1/2);
real l2=sqrt(0.75);
triple x1=(0,0,0), x2=(1,0,0), x3=(0.5,l2,0);
draw(x1--x2--x3--cycle);
label("$x_1$",x1,W);
label("$x_2$",x2,E);
label("$x_3$",x3,NW);
dot(x1);dot(x2);dot(x3);
triple b3=(0.5,l2/2,0);
dot(b3,red);
label("$B_3$",b3,S,red);
real l3=sqrt( (5+4*l2*l2)/9 );
triple x4=(0.5,l2/2,l3);
draw(b3--x4,red);
label("$x_4$",x4,N,red);
draw(x4--x1,dashed);
draw(x4--x2,dashed);
draw(x4--x3,dashed);
Compiling with asy tetrahedron.asy
gives me an eps
image in which the line x1--x2
is dashed for some reason, and compiling with asy tetrahedron.asy -tex pdflatex
gives me a blank image. tex.SE
doesn't allow me to upload images in either format, but I can share them with any other tool that users may request. Just post a comment with the tool I should use.
Any help would be greatly appreciated, to understand why I'm getting these errors, and/or how I could fix my script.
epstopdf
does work though, so maybe I will just use this. – Jonathan H Nov 14 '14 at 16:32asy -f pdf tetra.asy
unless I open it with Adobe Reader. – egreg Nov 14 '14 at 16:48