TransWikia.com

Using Asymptote for 3D plots

TeX - LaTeX Asked by Habib Ayati on July 23, 2021

I have recently started learning Asymptote for generating plots in my TeX related documents, and have been using https://asymptote.sourceforge.io/asymptote_tutorial.pdf to get a grip on the code. While I have had much joy (and luck!) using the 2D plotting capabilities, I cannot run the simple 3D code:

settings.outformat = "pdf";
settings.prc = false;
size(5cm,0);
import three;
draw(unitsphere);

mentioned in the above tutorial (p.51). Specifically, when running "asy.exe" on the code in the command prompt environment, I get:

D:Test_Asy>asy test3d.asy
    shipout3(prefix,f,preview ? nativeformat() : format,
            ^
C:/texlive/2021/texmf-distasymptote/three.asy: 2878.13: runtime:       2 [main] asy 11464 cygwin_exception::open_stackdumpfile: Dumping stack trace to asy.exe.stackdump
C:texlive2021binwin32runscript.tlu:915: command failed with exit code 34816:
asy test3d.asy

P.S. I don’t know if it is relevant or not, the generated dump (D:Test_Asyasy.exe.stackdump) is as following:

Exception: STATUS_FLOAT_INVALID_OPERATION at rip=7FFACAA4312F
rax=7FFFFFFFFFFFFF00 rbx=000000000CFA43A0 rcx=7FF0000000000000
rdx=0000000000000000 rsi=0000000000000001 rdi=000000000000000D
r8 =0000000000000508 r9 =000000000C0EA060 r10=00000100000001B3
r11=06BCA1AF286BCA1B r12=0000000000000068 r13=0000000000000000
r14=00000000FFFF44A0 r15=0000000000000000
rbp=0000000000000000 rsp=00000000FFFF4250
program=C:texlive2021tlpkgasymptote64asy.exe, pid 11464, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
00000000000  7FFACAA4312F (000FFFF4400, 0000000000D, 0000000000D, 00000000096)
000FFFF44C0  7FFACAA5073B (000FFFF4401, 00000000300, 0000BF6E3B0, 000FFFF4400)
000FFFF44C0  7FFACAA4B2AF (00000000000, 00000000000, 00000000001, 00000000000)
000FFFF4870  7FFACAA40D4A (0000AE14300, 000FFFF52A0, 00000000494, 00000000018)
000FFFF52A0  7FFACA9E3B00 (000FFFF5670, 0000C0EC0A0, 000FFFF5600, 000FFFF5670)
000FFFF5600  7FFACA9102B3 (00000000000, 000FFFF5670, 0000C0EC0A0, 0000000000F)
000FFFF5600  7FFACA911AF4 (7FFACB61C400, 000FFFF5670, 0000C0EC0A0, 0000AE0CB20)
000FFFF5C90  7FFACA90E154 (000FFFF5C90, 0000AE0CB20, 000FFFF5709, 0000AE0CB20)
000FFFF5C90  7FFACA8A2AFF (0000BF6E530, 0000BF6DD10, 00000000000, 0000CC388D0)
000FFFF5C90  7FFACA92745B (7FFACA88A42A, 00000000000, 000FFFF9070, 00000000000)
000FFFF5F10  7FFACA7C0F8C (0000BD94B08, 0000BEF6830, 00000000000, 0000BDF7F01)
000FFFF63E0  7FFACA78E8FF (0000BD94B08, 00000000000, 0000BDE2890, 000FFFF6A10)
00000000000  7FFACB04EBF9 (0000BD8BD70, 0000BD6EB00, 00000000000, 0000BED3820)
0000BED3820  7FFACB04ED83 (0000BD6ECE0, 000FFFF6B79, 0000BD65801, 000FFFF6B50)
000FFFF6B79  7FFACB04EF8D (0000BD65B01, 00000000000, 7FFA0000000A, 00000000000)
00000000000  7FFACB04E9A0 (000FFFF6D20, 00000000000, 000FFFF9070, 00000000000)
End of stack trace (more stack frames may be present)

One Answer

It may be due to a bug in your graphics library (or card). Here are some things to try (I haven't tested the full TL 2021 installation under Windows, only the executable that I submitted):

  1. Remove the now (mostly) obsolete lines settings.outformat = "pdf"; settings.prc = false; Do you get an OpenGL image? What happens when you press the e key?

  2. try adding the line settings.outformat="html"; Do you get a WebGL image?

  3. Install asy directly from https://asymptote.sourceforge.io/

Correct answer by John Bowman on July 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP