Closed zzdatura closed 2 years ago
You can't embed a 3D picture into a 2D picture unless you are willing to render the 3D picture to a 2D bitmap first. Is that what you want?
Yes! That's exactly what I want!
This regression is now fixed in commit 588d4d204cb0874c1e4a4229c5b8108e9785e049. Fitting 2D bitmaps of 3D pictures into a 2D picture works again:
import graph3;
// make a red frame
size(6cm);
draw(box((-1,-1),(1, 1)),red+4);
picture pic;
size(pic,5cm);
draw(pic,unitsphere);
add(currentpicture,pic.fit());
System
Configuration
Description of the problem
I want to be able to embed a 3D frame into a 2D picture, this way I could for instance align multiple 3D pictures in a single page, maybe frame them, put titles above each of them or even connect them with drawing elements like lines or arrows which could be useful for presentations and so on. I know I could use
mogrify
or other software for this kind of things but I’d like to do it from asymptote in a single go.It was possible to do it before but recently there was a regression. For now I don't have the exact commit that caused this but I noticed a lot of work being done in 3D recently.
Example
Looking at the documentation, I suppose I could get something like this to work:
However, none of these option for adding the
pic
frame intocurrentpicture
gives me the desired result and the 3D sphere does not appear. In my system, I can make a standalone 3D picture without any problems, it's embedding them into a 2D “background” that doesn’t work.