vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
550 stars 90 forks source link

It used to work, but "plane" is not rendering in 3D in asymptote #395

Closed natkuhn closed 12 months ago

natkuhn commented 1 year ago

Please note that I first posted this on tex.stackexchange, hopefully the link to the output from there still works. To save LaTeX compile time, I have been hand-running asymptote from the command line using the version of asymptote specified below. A stackexchange commenter pointed me to http://asymptote.ualberta.ca/, and since I can download the png file from there, this is not urgent for me, but I thought I should submit it so that you are aware of the problem. Here is the SE post:

I have a figure that I created some time ago that includes 3 orthogonal planes. It rendered fine before, but now when I compile it, two planes render as triangles, and the third doesn't render at all. If I move lines of code around, maybe one renders as a square the way it's supposed to, one renders as a triangle, and the third doesn't at all.

I have v2.85 of asymptote running on a MacBook Pro. TeXlive says I have the "universal-darwin files" and is not showing any pending updates. EDIT: I did update my TeX installation between when it worked and now, and I'm guessing that that's why it's not working anymore.

ALSO: It seems to render just fine in Overleaf.

settings.render = 16;
settings.outformat = "png";
import three; 
size(10cm,0);
currentprojection = orthographic((10,8,3));
defaultpen(fontsize(9pt));

path3 pXY=plane(O=(-.25,-.25,0),1.5X,1.5Y);
label("$x_2=0$",(1,1,0));
draw(surface(pXY), gray(0.5)+opacity(.5));
draw(pXY,blue);

path3 pYZ=plane(O=(0,-.25,-.25),1.4Z,1.5Y);
label(YZ*"$x_0=0$",(0,1,1),Embedded);
draw(surface(pYZ), gray(0.5)+opacity(.5));
draw(pYZ,green);

path3 pXZ=plane(O=(-.25,0,-.25),1.5X,1.4Z);
label(XZ*"$x_1=0$",(1,0,1),Embedded);
draw(surface(pXZ), gray(0.5)+opacity(.5));
draw(pXZ,red);

Here is the output: the output from my code

johncbowman commented 12 months ago

MacOS doesn't support SSBOs under OpenGL, which are required for opacity. To render this example correctly, you either need to remove +opacity(.5) everywhere, use another platform, or wait for the upcoming Vulkan port of Asymptote (coming soon).

natkuhn commented 12 months ago

Thank you, @johncbowman !