I've followed the accepted answer to this question to invoke Asymptote in an environment without GUI using the -offscreen
option. But it fails on this file:
texpreamble("
\newcommand{\definiteintegral}[4]{\int_{#1}^{#2}\,#3\,d#4}
\newcommand{\myequation}[2]{#1\amp =#2}
\newcommand{\indefiniteintegral}[2]{\int#1\,d#2}
\newcommand{\testingescapedpercent}{ \% }
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
");
// Riemann surface of z^{1/n}
import graph3;
import palette;
int n=3;
size(200,300,keepAspect=false);
currentprojection=orthographic(10,10,5);
currentlight=(10,10,5);
triple f(pair t) {return (t.x*cos(t.y),t.x*sin(t.y),t.x^(1/n)*sin(t.y/n));}
surface s=surface(f,(0,0),(1,2pi*n),8,16,Spline);
s.colors(palette(s.map(zpart),Rainbow()));
draw(s,meshpen=black,render(merge=true));
The last two lines of the verbose output are:
Offscreen context settings: Depth=0 Stencil=0 Accum=0
Error initializing offscreen context: Depth=0
-offscreen
option. Sorry to omit this detail. I've edited the original post to include it.asy -offscreen
works. Perhaps a driver/library problem. For what kind of file the option-offscreen
works on your system ? Perhaps ask for the question on asy forum.