You need to do a make clean to remove the old dependencies.
Presumably that just means that your boost library is too old to compile with the default --enable-lsp configure option. Just configure --disable-lsp and you should be fine.
Thanks for reporting this issue. Next time it would be better to report bugs here: https://github.com/vectorgraphics/asymptote/issues Anyway, a fix is now in git and will be in the upcoming 2.92 release. In the meantime, you can grab a new copy of https://raw.githubusercontent.com/vectorgraphics/asymptote/HEAD/base/slide.asy
You can't output the html to standard output since the workflow requires files. The best you can do is something like asy -f html test.asy && cat test.html
asy -f html test.asy
A working version is attached.
Here's how to draw a 3D version of that scene. I've attached the corresponding HTML output. import three; import tube; import graph3; currentpicture=new picture; unitsize(10cm); currentlight=White; real R=2; triple P(real t){return (R*Cos(t),R*Sin(t),0);} path3 centercurve=shift(-R,0,0)*graph(P,340,360); path centercurveshifted=project(centercurve); draw(surface(tube(centercurve,scale(0.01)*unitcircle)),lightgray); draw(rotate(90,X)*(scale3(0.01)*unitdisk),gray); draw(centercurve,linewidth(.2));...
Fixed; thanks for pointing this out. An ImageMagick bug with tempfiles in 7.1.1.33-1 caused problems when building the gallery for the last release.
Fixed; thanks for pointing this out. An ImageMagick bug with tempfiles in 7.1.1.33-1 caused build problems when building the gallery for the last release.
You are trying to combine 2d and 3d graphics in a single file. Do you want to project everything to 2D? Otherwise how should 2d and 3D graphics be combined? If you delete the shipout line and turn on the -v option you will see that your example first generates the rendered 3D output and then immediately overwrites it with the 2D output you requested. The extra shipout does 2 additional shipouts to the file My3DPicture.eps. Asymptote is generally backwards compatible but in the interest of progress...
You are trying to output 2D graphics to the same file as your 3D graphics. Since version 2.71, Asymptote separates 2D and 3D graphics. If you want both 2D and 3D output, you should shipout to separate fles like this: ~~~unitsize(10cm); currentlight=White; triple P(real t){return (0,t,0);} path3 segment=graph(P,-1,1); path segmentprojected=project(segment); draw(segment,linewidth(.2)); picture pic; unitsize(pic,10cm);; draw(pic,segmentprojected); shipout("2D"); draw(surface(tube(segment,scale(0.05)*unitcircle)),lightgray);...
dvisvgm needs the ghostscript library libgs.so or libgs.a; see https://dvisvgm.de/FAQ/
You need to upgrade ghostscript to the latest version (currently 10.03.1), see for example https://github.com/vectorgraphics/asymptote/issues/264
Asymptote: 2.91 Released
By default, orthographic projections now use center=true; the camera and target are automatically centered within the scene. The surface constructor for triangles was fixed. A bug in the WebGL flatness test was fixed. Triangle group bugs were fixed and now produce compact HTML output. Triangle groups are used for indexed surfaces drawn with the render option tessellate=true. GLSL error reporting was restored. The reported camera up vector was fixed. The map module was fixed. A syntax warning in Xasy...
I've updated the documentation to point to pages 270-274 of https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf
Yes, looking at the installer asymptote.nsi, you are right that we do register some keys. What I meant is that we no longer modify the user's path, since that may have unintended consequences and it is better for the user to choose where they want Asymptote to appear in their path, if at all. When you check the file type association, you have the option at the bottom to search for the correct application. I did this on my system long ago and you only have to do this once. If MiKTeX is calling their...
P.S. See Step 3 of this post: https://sourceforge.net/p/asymptote/discussion/409349/thread/909cd01735/?limit=250#f3c9/321c
For some time now our policy has been to not modify the MSWindows registry. A user is welcome to manually add the Asymptote path and other environment variables as needed. To associate a file with an app, there's no need to explicitly modify the registry: simply right click on it, choose Open with and select the desired executable. Most MSWindows users run Asymptote using the icon; there's no need for the installer to tamper with the windows registry.
Your video shows very clearly that you are running miktex-asy.exe. MikTeX has it's own packaging system and is known to have issues like this. Please remove all other versions of Asymptote from your system, including the third-party MikTeX one, and try again. If instead you want to use Asymptote from a TeX distribution, the TeXLive distribution is preferred over MikTeX for exactly these reasons.
The screen shot you show isn't from the official Asymptote installer. Please delete all other copies of Asymptote on your system and reinstall it from here: https://sourceforge.net/projects/asymptote/files/2.90/asymptote-2.90-setup.exe/download You will notice the installation looks quite different that what you show. Asymptote ships with its own packages and doesn't have an additional installer like the one on your screen, so it must have come from somewhere else.
I'm building and testing under MSWindows 10, so maybe that is the difference. Is anyone else experiencing this problem? Make sure that you don't have more than one version of Asymptote installed. You can always work around this problem by setting an environment variable ASYMPTOTE_DIR to point to the location of the Asymptote base files (the location of plain.asy). On MSWindows the default path should be C:\Program Files\Asymptote
This indicates an installation problem. What version of Asymptote did you install and where did you get it from? The current stable official Windows 64-bit release is here: https://sourceforge.net/projects/asymptote/files/2.90/asymptote-2.90-setup.exe/download
The current Windows port of Asymptote is built with cygwin, so you are actually using the cygwin dll without realizing it. You can put the asy file anywhere; the output file will appear in %USERPROFILE%, which is the current working directory specified in the Asymptote icon. You can change that directory in the shortcut if you like. For security reasons, an Asymptote program can't request writing to a directory other than the one it was launched from or the one given on the command line (with the...
This error occurs because are using an obsolete version of Asymptote that is incompatible with the version of Ghostscript that you are using. Please upgrade to Asymptote 2.90 and Ghostscript 10.03.1.
Asymptote: 2.90 Released
A bug in the approximate transparency rendering code for GPUs without SSBO support was fixed. Support was added for templated accesses involving imported types, top-level structure types, and static fields. ImageMagick magick convert is now used instead of convert. The add(picture dest, picture src, pair position) function now respects size specifications (backwards incompatible; the previous behaviour can be obtained with add(dest,src.fit(identity()),position). The terminal is now reset upon exit....
Opacity is a real number in the closed interval [0,1]. You can use something like if(settings.outformat == "html") currentlight.background=purple+opacity(0.5); or currentlight.background=settings.outformat == "html" ? purple+opacity(0.5) : defaultpen; or currentlight.background=settings.outformat == "html" ? purple+opacity(0.5) : red+opacity(1.0); It is generally recommend to avoid using white ink in a PDF intended for publication (CMYK doesn't support white).
Opacity is a real number in the closed interval [0,1]. You can use something like if(settings.outformat == "html") currentlight.background=purple+opacity(0.5); or currentlight.background=settings.outformat == "html" ? purple+opacity(0.5) : defaultpen; or currentlight.background=settings.outformat == "html" ? purple+opacity(0.5) : red+opacity(0.5); It is generally recommend to avoid using white ink in a PDF intended for publication (CMYK doesn't support white).
Hi Sean, Sure, you can use a pen like this: opacity(settings.outformat == "html" ? 0.5 : 1.0);
Maybe this is what you are looking for? https://github.com/rowhit/asy_circuit
I encountered the same problem on another machine. So from now on we will ship pkg.m4 with configure: (commit 684570c8872a2e93ef86a6ef456a0599a934bf12).
An unfinished attempt to support NURBS is in the nurbs branch but it is not yet working correctly.
Perhaps the problem is that your autoconf is too old and is missing PKG_CHECK_MODULES. In that case, you can work around this with ./configure CPPFLAGS=-I/usr/include/tirpc LDFLAGS=-ltirpc
The next step is to look in config.log. Could you please attach that file (the output of configure would be useful too).
Good to hear. Now check that pkg-config --cflags libtirpc returns -I/usr/include/tirpc and pkg-config --libs libtirpc returns -ltirpc If it doesn't, you will need to either fix this or modify your configure command line to specify this missing information manually: ./configure CPPFLAGS=-I/usr/include/tirpc LDFLAGS=-ltirpc
First of all you should upgrade to Asymptote version 2.89. To help isolate the problem with XDR, first try to compile the attached file with g++ xstream.cc -I/usr/include/tirpc -ltirpc
You can specify a transparent background in webgl with currentlight.background=opacity(0.0); Then a background color specified in the body will show through; for example: <body style="overflow: hidden; background-color:red;" onload="webGLStart();">
No, since you mentioned surface I assumed you were drawing a 3D scene. In a 2D figure with labels, Asymptote generates a TeX file, so that requires latex+dvips or pdflatex. There's no easy way to shortcut that workflow. If there are no labels, Asymptote generates an eps or pdf file. It wouldn't be worth simplifying that case since most Asymptote figures have labels.
No, since you mentioned surface I assumed you were drawing a 3D scene. In a 2D figure with labels, Asymptote generates a TeX file, so that requires going latex+dvips or pdflatex. There's no easy way to shortcut that workflow. If there are no labels, Asymptote generates an eps or pdf file. It wouldn't be worth simplifying that case since most Asymptote figures have labels.
By default, Asymptote renders to an OpenGL window, not to a pdf file. Try: asy -V -vvv import three; draw(unitsphere,red); draw(unitcube,blue); If you check your working directory, you will see that no files have been written.
What compilation error are you referring to? Incidentally, for XDR/V3D support you need to install the tirpc library.
You forgot the picture argument to graph (which defaults to currentpicture). Just change your draw commands to read: draw(pic,graph(pic,W_dB,flow,fhi,npts),black,"Woofer"); draw(pic,graph(pic,LM_dB,flow,fhi,npts),red,"Lower Mid Range"); draw(pic,graph(pic,UM_dB,flow,fhi,npts),green,"Upper Mid Range"); draw(pic,graph(pic,T_dB,flow,fhi,npts),blue,"Tweeter"); draw(pic,graph(pic,IN_dB,flow,fhi,npts),cyan,"System Equalization");
Among other errors, you need to import graph; The next error is: ~~~ no matching variable 'W_dB' ~~~
Asymptote: 2.89 Released
Portability fixes were made to allow static builds with or without pkg-config. Static linking of the GSL library is now supported. Redundant templated imports are avoided.
Asymptote: 2.88 Released
Building against specific static libraries is supported again. An ambiguity in statistics.h was resolved. The output of dvisvgm is optimized by default. PDF 1.5 output is now generated.
Asymptote: 2.87 Released
Templated imports were implemented. An incorrect dvisvgm optimization is avoided. SVG gradient shading offsets were fixed. Integer are now implicitly formatted with full precision. Inferred assignment of void type is prohibited. An LSP segmentation fault was fixed. Repeated stripping of file extensions is avoided. The --output-directory option of latexmk is supported. The OSMesa compatibility profile is used for offscreen rendering. The fitscreen toggle is fixed. The context menu in Xasy is now only...
Colors can look different in different colorspaces: rgb is intended for screens, whereas cmyk is intended for print. You didn't post your 3D example but be aware that by default the lighting affects colors in 3D. So if you are looking at an unlighted side of an object, it may appear very dark. Try rotating it.
Yes, we'll add it to our TODO list.
You should encourage Mint to update their Asymptote package. Or simply install TeXLive from the official source; that will get you a version of Asymptote that is at most 1 year old.
TeX is a 2D program. Asymptote lifts TeX font shapes to 3D but you will have to specify the color with an Asymptote pen, not using TeX.
Your problem is that you are using an obsolete verion of Asymptote that is over 2 years old. The current version 2.86 works fine with NVIDIA 545.29.06. I expect the 2.87 release will be made today.
Using asy version 2.86, try running asy -config "" -k -V test where test.asy contains import graph; import three; // used for the unsuccessful surface attempt unitsize(1cm,1cm); limits((-2,0),(2,8)); xaxis("$x$",xmin=-2, xmax=2,axis=BottomTop(extend=true), ticks=LeftTicks(beginlabel=true,N=4,n=2,begin=true,end=true, extend=true,pTick=gray,ptick=lightgray),above=true); yaxis("$y$",ymin=0, ymax=8,axis=LeftRight(extend=true), ticks=RightTicks(beginlabel=true,N=4,n=2,begin=true,end=true, extend=true,pTick=gray,ptick=lightgray),above=true);...
pdflatex doesn't do any rendering. Can you post the complete TeX file? Make sure you are running the 64 bit version of asy (e.g. the one that comes with TeXLive 2023), not the 32-bit version.
FFTW++: 3.01 Released
Adding the line shipout(scale(1.0) * currentpicture.fit()); at the end of your example should produce the attached pdf file. If it doesn't, please add -vvvto your command line and post the screen output. What version of ghostscript are you using?
The -V option (the default on Windows) display an interactive OpenGL window for 3D scenes, to allow you to adjust the camera viewpoint. Once you are ready to export the image, just press the ekey. Or disable the interactive OpenGL window with the -noVoption. By the way, settings.render=16 will generate 16 pixels per bp in each direction, which is likely excessive and will generate large files.
Thanks; I've correct the path in the git repository to https://asymptote.sourceforge.io/gallery/3Dwebgl/vectorfieldsphere.html
Also, since you are working under MacOS, please be aware that MacOS doesn't support OpenGL SSBOs, which are required for implementing 3D transparency. So you need to remove +opacity(0.8) from your code. If you need transparency, you'll have to wait for the upcoming Vulkan port (currently in the vulkan branch and soon to be released) or work on another platform.
The image is best viewed with 3D graphics software like OpenGL. If you want to flatten the image to a 2D format, you will need to render it. You can increase settings.render to improve the resolution of the image. Don't use settings.render=0. I've attached the output of your example with the (hardcoded) settings settings.outformat = "png"; settings.render = 16; BTW, it's better not to hardcode these settings and specify them on the command line instead.
I am running Asymptote version 2.86 on MacOS 10.15.7 I have followed the Asymptote Tutorial and in particular pages 56-58 which deal with rendering. I want to show objects behind the surface with a different shading. Up to now the best solution I have found is as follows: settings.outformat = "pdf"; //settings.prc = false; //settings.render = 4; size(200,0); import three; import graph3; texpreamble("\usepackage{physics}"); //size(500,0); //settings.outformat = "pdf"; currentprojection=orthographic(4,3,2);...
The second label is in fact shifted by (3,5) PostScript (rather than user) units. Applying a shift to truesize objects such as labels moves them in PostScript coordinates. If you want to use units of exactly 1cm, you could do this: import graph; import geometry; import math; settings.tex="pdflatex"; picture pic; unitsize(pic,1cm,1cm); Label goldfish = graphic("fish.png","width=6cm, bb=0 0 469 275"); label(pic,goldfish,shift(3,5)*(0,0)); //Shifts label label(pic,shift(3cm,5cm)*goldfish,(0,0)); add(pic,grid(10,10));...
The second label is in fact shifted by (3,5) PostScript (rather than user) units. Applying a shift to truesize objects such as labels moves them in PostScript coordinates. If you want to use units of exactly 1cm, you could do this: import graph; import geometry; import math; settings.tex="pdflatex"; picture pic; unitsize(pic,1cm,1cm); Label goldfish = graphic("fish.png","width=6cm, bb=0 0 469 275"); label(pic,goldfish,shift(3,5)*(0,0)); //Shifts label label(pic,shift(3cm,5cm)*goldfish,(0,0)); //Does...
asy --help and the documentation already mention the render setting (but be aware that -render=0 does not in general handle hidden surface removal or lighting effects correctly). I've updated that example to use Spline interpolation.
SVG only supports 2D images, not 3D. So 3D images normally need to be rendered if OpenGL is enabled (make sure you have OpenGL enabled; check the output of asy --version to be sure). Asymptote includes an experimental facility using -render=0or settings.render=0 to approxximately flatten 3D images to 2D, which works ok in this case.
SVG only supports 2D images, not 3D. So 3D images normally need to be rendered if OpenGL (make sure you have OpenGL enabled; check the output of asy --version to be sure) Asymptote includes an experimental facility using -render=0or settings.render=0 to approxximately flatten 3D images to 2D, which works ok in this case.
Doesn't this duplicate the make checkfacility already in tests (in particular, the one in tests/output)?
To diagnose the problem, try manually running asy -k test and then dvisvgm -n -v3 --optimize -otest.svg test_.dvi. What version of dvisvgm are you using?
This is not an Asymptote problem; you need to fix these errors first (you may need to reinstall TeXLive): warning: /home/fabrice/context/tex/texmf/web2c/texmf.cnf:49: (kpathsea) No cnf value on line: OSFONTDIR =. dvips: warning: no config file for `download35
We actually don't recommend using MiKTeX due to such installation issues. Instead, you should install TeXLive from https://tug.org/texlive/
It looks like you don't have permission to write in that directory; you should first change directories to a folder where you have write access.
I just now added the tag and incremented the version number.
That sequence of commands puts $HOME/asymptote-2.86 after $HOME/texlive/2023/bin/x86_64-linux. It needs to come before. Check your path with echo $PATH.
That means that you have two versions installed in different places (maybe the 2.85 one is coming from your TeXLive distribution)? You need to either fix your path or delete the old version.
Asymptote: 2.86 Released
PDF transfer functions are automatically applied; EPS output suppresses .setblendmode. NaN and inf values can be read in cvs mode. The OpenGL index buffer is properly initialized. WebGL and V3D primitives are used only when unscaled. Bugs in the inversion section of the geometry module were fixed. Portability issues were addressed.
Hi Jim, If you really want each section of code to be run in a separate asy process, you can use eval for this: write(format("dotfactor=%f",dotfactor)); // ============= eval(quote { string OUTPUT_FN = "test%03d"; picture pic; int picnum = 0; unitsize(pic, 1cm); dotfactor = 3; write(format("inside: dotfactor=%f",dotfactor)); draw(pic, (0,0)--(1,1), red); dot(pic,(0,0)); shipout(format(OUTPUT_FN,picnum),pic,format="pdf"); },false); // ============= write(format("dotfactor=%f",dotfactor)); If you are...
Great to hear! You could go deeper into trEndFile in tr.cc and try to isolate which call (maybe glReadPixels?) is buggy. We'll make this conditional on HAVE_LIBOSMESA since it is defect only in that software rendering library (although I can't reproduce it under ubuntu 22.04.2 or on Fedora).
As you previously noted, you need to configure --disable-gcin order to use valgrind. There is no point in trying to detect memory leaks when garbage collection is disabled. You'll have to move fpu_trap(settings:trap()) later in the program flow; this will require some trial and error. Good luck and let us know when you've isolated the OpenGL call where someone divided by zero.
Checking for leaks with garbage collection disabled doesn't make sense. But asy -vvv gives some useful information: you made it all the way to line 880 in glrender.cc (version 2.85). Try enclosing the call to drawscene on line 896 with a fpu_trap(false); // Work around FE_INVALID and fpu_trap(settings::trap()); We'll eventually try to isolate the buggy library function more precisely, but this is a good place to start. Then run asy -vvv -nothreads teapot again.
Unfortunately that debugging session didn't provide much information. You could try using valgrind asy teapot -nothreads instead (with the same configuartion and compilation options). It would also be helpful to see the output of asy -vvv teapot -nothreads Thanks!
Thanks for reporting this. The fix is in commit 4715fea108852e25cd38a6a74079985f5fe91e7f and the upcoming 2.86 release.
Yes, to debug you need to configure with --disable-gc. You also should make with CFLAGS="-g -O0" and run asy with -nothreads.
Could you run without -mask in the debugger (e.g. gdb) and tell me which library call in glrender.cc the floating point exception is generating the floating point exception? Once we identify the line number we can locally apply the mask like this (there might be more than one place): fpu_trap(false); // Work around FE_INVALID // offending call goes here fpu_trap(settings::trap());
I see the problem now. The line OpenGL 3D OpenGL rendering in response to asy --version shows that you didn't actually compile with ./configure --enable-offscreen (and then make). When offscreen rendering is enabled, this diagnostic should report OpenGL 3D OSMesa offscreen rendering
I haven't tried Ubuntu 22.04 but it works fine for me under Ubuntu 22.04.2 LTS (which I just upgraded to yesterday). Make sure that you are executing the version of asy that you think you are executing. Maybe you have an issue with your Xwindows connection. Try asy -v teapot It should say Processing teapot adjusting camera to (258.225171371384,-245.864162612474,245.268025433915) adjusting target to (14.3772627291114,4.13583738752519,39.9136904339161) Wrote teapot.eps
For comparison, I tested offscreen rendering of this example on asymptote.ualberta.ca running on Ubuntu 21.04 and 22.04.2 LTS. The final diagnostic lines should read: adjusting camera to (258.225171371384,-245.864162612474,245.268025433915) adjusting target to (14.3772627291114,4.13583738752519,39.9136904339161) GLSL version 4.50 No fragment shader interlock support Rendering teapot as 2950x2160 image Under your platform there is a problem with OSMesa initialization. CentOS tends to use very old...
One reason for using the OSMesa library is if you don't have a graphics card. In that case, you should ./configure --enable-offscreen
One reason for using the PSMesa library is if you don't have a graphics card. In that case, you should ./configure --enable-offscreen
Please post the output of asy --version and asy -vvv -V teapot
Hi Jim, Version 2.79 works fine for me on this example, but there were some recent bug fixes in vectorfield. So first try upgrading to 2.85. If that doesn't work, could you post the output of asy -vvv test.asy
OpenGL GLSL version 1.40 is very old (circa 2009). For full functionality (e.g. transparency) you will need to upgrade to GLSL 4.3 or later (which dates back to 2013). You should uprade your drivers.
Asymptote doesn't come with a CERN ROOT interface but perhaps that would be a good future contribution.
Great you have OpenGL support. Now try ./asy -V teapot and you should see a teapot in the OpenGL window. Perhaps you didn't know about the -V option, which is enabled by default for MSWindows users, since that is what they expect.
That means you are lacking OpenGL (and hence 3D) support. The necessary libraries should have been provided with apt-get build-dep asymptote What is the output of ./asy --version