2

Both examples in ASY_3D.pdf

\documentclass[border=5pt,varwidth]{standalone}
\usepackage{asymptote}

\begin{document}

\begin{asy}
settings.outformat="png"; 
// settings.render=10; //<<<----
settings.prc=false;

import graph3;
import contour;
size(7.5cm,0);
size3(7.5cm,IgnoreAspect);
currentprojection=orthographic(-6,-20,600);
currentlight=White;
limits((0,0,0),(10,10,300));
xaxis3(OutTicks(Step=2));
yaxis3(OutTicks(Step=5));
zaxis3(Bounds(Min,Max),InTicks(Step=100,Label(align=-X),NoZero));
real f(pair z) {return 2z.x^2-z.x+z.y^2;}
draw(surface(f,(0,0),(10,10),nx=10,Spline),lightgray,meshpen=black);
path p1=(5,1)--(9,1)--(9,4)--(5,4)--cycle,
     p2=(4,0)--(0,8),
     p3;
for(int i=0; i<=10;++i) p3=p3..point(p2,i/10);
guide[][] tabgui={{p1,p2,p3}};
draw(lift(f,tabgui),1bp+red);
draw(path3(p1),1bp+.8green);
draw(path3(p2),1bp+.8purple);
draw(extrude(p1,axis=200Z),blue+opacity(.75));
\end{asy}

\end{document}

With settings.render=10; it produces a figure about 500KB

enter image description here

But with settings.render=15; it produces a figure about 894KB

enter image description here

See the following example:

\documentclass[border=5pt,varwidth]{standalone}
\usepackage{asymptote}

\begin{document}

\begin{asy}
settings.outformat="png"; 
settings.render=15; 
settings.prc=false;

import graph3;
currentprojection=orthographic(1,-2,1);
currentlight=(1,-1,0.5);
size(7cm,0);
real f(pair z) {return abs(z)^2;}
path3 gradient(pair z) {
static real dx=sqrtEpsilon, dy=dx;
return O--((f(z+dx)-f(z-dx))/2dx,
(f(z+I*dy)-f(z-I*dy))/2dy,0);}
pair a=(-1,-1);
pair b=(1,1);
triple F(pair z) {return (z.x,z.y,0);}
add(vectorfield(gradient,F,a,b,red));
draw(surface(f,a,b,Spline),gray+opacity(0.5));
xaxis3(XY()*"$x$",OutTicks(XY()*Label));
yaxis3(XY()*"$y$",InTicks(YX()*Label));
zaxis3("$z$",OutTicks);
\end{asy}

\end{document}

With settings.render=15; it produces a figure about 646KB

enter image description here

With settings.render=10; it produces a figure about 307KB

enter image description here

Can you explain to me the reason of this case?

4

From the documentation, on options for viewing 3D figures:

Render the scene to a specified rasterized format outformat at the resolution of n pixels per bp, as specified by the setting render=n. A negative value of n is interpreted as |2n| for EPS and PDF formats and |n| for other formats. The default value of render is -1.

A higher resolution then led you to a higher filesize.

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.