What does the .fit() method of a picture do in the following Asymptote code?
picture pic1;
real size=50;
size(pic1,size);
fill(pic1,(0,0)--(50,100)--(100,0)--cycle,red);
picture pic2;
size(pic2,size);
fill(pic2,unitcircle,green);
picture pic3;
size(pic3,size);
fill(pic3,unitsquare,blue);
picture pic;
add(pic,pic1.fit(),(0,0),N);
add(pic,pic2.fit(),(0,0),10S);
add(pic.fit(),(0,0),N);
add(pic3.fit(),(0,0),10S);
This is from the manual of Asymptote: http://asymptote.sourceforge.net/doc/Frames-and-pictures.html
The result is
Without the .fit() method the code fails with the error
fun.asy: 15.4: no matching function 'add(picture, picture, pair, pair)'
The function does not seem to be documented anywhere. There is however a cryptic comment on that same page dealing with fitting pictures to frames which says
A picture pic can be explicitly fit to a frame by calling
frame pic.fit(real xsize=pic.xsize, real ysize=pic.ysize, bool keepAspect=pic.keepAspect);
I am not sure I understand this properly. Is there a simple example which can explain the behaviour of this function?

pictureto aframe. In apicture, there are two coordinate systems -- one for drawing, and one for pen nibs. So, for instance, if you multiply a picture byscale(2.0), the lines get longer but not thicker. Once you convert apictureto aframe, there is only one coordinate system; if you scale theframesize, it rescales both the length and the thickness of lines. (And if you rescale aframeby differentxandyscales, your dots become ovals.) – Charles Staats Nov 19 '18 at 16:35<void add(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>)>I am not sure whatpositionandalignmean. If I had not seen the output of the code above, I would have guessed that the lower left corner of the triangle would have been directly vertically over the center of the circle, but it isn't so in the output. – smilingbuddha Nov 19 '18 at 18:50