On Sun, 31 Dec 2023, Shiv Shankar Dayal wrote:
It would be nice to either support Metapost 3D or Asymptote. Right now I generate images separately and embed them in PDF using externalfigure command which works but I have to maintain all the graphics separately.
It is possible to obtain simple integration for asymptote using the filter module: https://github.com/adityam/filter Using that you could define an asymptote environment so that: \startbuffer[asymptote-preamble] .... \stopbuffer \starttext \startasymptote % Asymptote figure \stopasymptote \stoptext saves the content of the asymptote-preamble and the figure in a separate file, runs asymptote to generate a PDF figure and includes the figure. The results are cached so the asymptote is re-run only if the content of the figure environment changes. A drawback of this approach is that the labels are generated by asymptote. That means that the font, colors, and any macros needed for the figures need to be redefined at both context and asymptote end. Aditya