Closed justonlyasy closed 2 years ago
If you enable settings.verbose=2, you will see the message No pages of output. Hence the subsequent error. To generate output, change the last line to
for(int i=0; i < 4; ++i) draw(g_[i],yourpens[i]);
for(int i=0; i < 4; ++i)
draw(g_[i],yourpens[i]);
works , but my purpose is One can also smoothly shade the regions... So Asymptote maybe have a command for doing it?
This question inspired from
size(10cm,0);
import graph;
mapArray("real","pen");
void pspathHSV(path g, pen p=linewidth(1mm)+linecap(2), real HueBegin=0, real HueEnd=1, int plotpoints=100)
{
real[] a=uniform(HueBegin*360,HueEnd*360,plotpoints);
pen[] q = map(new pen(real i){ return hsv(i,1,1)+p;},a);
int n = plotpoints+1;
real l = arclength(g)/n;
path[] p = sequence(new path(int i){ return subpath(g,arctime(g,i*l),arctime(g,(i+1)*l));},n);
// draw(p,q);
for (int i=0; i<q.length; ++i)
draw(p[i],q[i]);
}
guide g=graph(new real(real x){ return sin(x);},0,2pi,350);
pspathHSV((0,0)--(10,1),HueBegin=0,HueEnd=0.5);
pspathHSV((0,1)--(10,3),HueBegin=0.5,HueEnd=0.7);
pspathHSV((0,2)--(10,5),HueBegin=0.8,HueEnd=1);
pspathHSV(g,linewidth(1bp),plotpoints=350);
pspathHSV((0,4)--(3,4),linewidth(1.5cm)+linecap(2),HueBegin=0,HueEnd=1,plotpoints=360);
pspathHSV(g,linewidth(1bp)+opacity(.5),plotpoints=350);
.
Consider this code,
I get this error on http://asymptote.ualberta.ca/
Maybe a bug or not ?