Everything is ok here (both with "-f pdf -render 0" option, or "-f html" option), with no complains about "ghostscript cannot be found" and similar, if I DO NOT UNCOMMENT the final "offending line".
BUT if I uncomment the "offending line", at the end, then I have issues (wrong pdf or complains about "ghostscript cannot be found" if I use -f html option...)
Of course that line makes use of my routine "drawshifted", created by me years ago. I have to make clear that in 2D pictures my routine still works well (for my usage, at least)
More interestingly, and this is a problem I had on other occasions, this source file was created by me 2/3 years ago and I am sure that at that time IT WORKED, including the "offending line". I still have the nice pdf produced by it.
It is not the first time that for some "complex" 3D pictures my 2/3 years (good) old source code will no longer work, or it will give me some problems.
My other question (perhaps of more general interest) is:
How much asymptote is really backward compatible?
Thanks!!!
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 some documented incompatibilities have been introduced over the last two decades. For example, see the Release Notes for version 2.90, 2.10, 2.02, 1.89, 1.83, 1.50, 1.44, 1.43, 1.42, 1.17, 1.04, and 0.84. In your case, you were relying on undocumented behaviour of how 2D and 3D graphics generated by the same asy process should be handled; should they be output to different files?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, basically I wanted to combine 2d and 3d output, in order to be able to use in some 3d context my macro "drawshifted" which is basically a 2d tool, but which I found useful in some 3d situation. I attach a picture which some years ago I was able to create in this way. The path with the $s$ clearly denotes the abscissa of the point where the tube ends. I got that by "drawing shifted" the path on which the tube is based. Now I am in the situtation in which I need to edit and slightly modify a bunch of pictures like that, but it seems my technique no longer works, and now I understand why. It is not clear to me if my "drawshifted" routine (which I find very useful in many many 2d pictures, where it works nicely) can be modified to some "drawshifted3d" (say) which could be applied in a 3D context. This is my problem.
Thanks!
Maurizio
PS: I post again my drawshifted routine. I add that if I remember correctly this is a construction which is based on some examples in the Gallery (I think that at least one example was created as an anwser to a request of mine....).
Now I realize something strange is happening here. I attached a pdf to my previous answer. The pdf I see and which I uploaded from my mac is different from the pdf I see if I download the attached picture and I look at it (with the same viewer). Indeed, I no longer see a part of it (I no longer see the tube but only the part with the 2d segment). How is that possible? I add that the pdf I have on my mac was sent to Springer and a book was printed (2 or 3 years ago) with that picture appearing on paper exactly as I see it on my Mac.
Is this a pdf (adobe) problem, or something related with Asymptote? Or else?
Thanks
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am on MacOS Sonoma and Asymptote 2.91
I do not understand why compiling a certain .asy file with options
-f html
I get
I have file:
/Users/maurizio/.asy/config.asy
with content:
and I have gs with the following path
/opt/homebrew/Cellar/ghostscript/10.03.1/bin/gs
Why gs is not found?
What could be wrong?
Thanks
Maurizio
dvisvgm needs the ghostscript library libgs.so or libgs.a; see
https://dvisvgm.de/FAQ/
Thanks!!!
However my situation is still not clear, and perhaps of interest to someone else.
I searched for libgs.so (which on MacOs, is named libgs.dylib, as I learned) and I found it:
I also added a path to it:
LIBGS="/opt/homebrew/lib/libgs.dylib"
just to make sure. Thus, I assume that "libgs.dylib" is known to the compiler.
However, please consider the following .asy file (sorry for its length):
Everything is ok here (both with "-f pdf -render 0" option, or "-f html" option), with no complains about "ghostscript cannot be found" and similar, if I DO NOT UNCOMMENT the final "offending line".
BUT if I uncomment the "offending line", at the end, then I have issues (wrong pdf or complains about "ghostscript cannot be found" if I use -f html option...)
Of course that line makes use of my routine "drawshifted", created by me years ago. I have to make clear that in 2D pictures my routine still works well (for my usage, at least)
More interestingly, and this is a problem I had on other occasions, this source file was created by me 2/3 years ago and I am sure that at that time IT WORKED, including the "offending line". I still have the nice pdf produced by it.
It is not the first time that for some "complex" 3D pictures my 2/3 years (good) old source code will no longer work, or it will give me some problems.
My other question (perhaps of more general interest) is:
How much asymptote is really backward compatible?
Thanks!!!
Maurizio
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 some documented incompatibilities have been introduced over the last two decades. For example, see the Release Notes for version 2.90, 2.10, 2.02, 1.89, 1.83, 1.50, 1.44, 1.43, 1.42, 1.17, 1.04, and 0.84. In your case, you were relying on undocumented behaviour of how 2D and 3D graphics generated by the same asy process should be handled; should they be output to different files?
Yes, basically I wanted to combine 2d and 3d output, in order to be able to use in some 3d context my macro "drawshifted" which is basically a 2d tool, but which I found useful in some 3d situation. I attach a picture which some years ago I was able to create in this way. The path with the $s$ clearly denotes the abscissa of the point where the tube ends. I got that by "drawing shifted" the path on which the tube is based. Now I am in the situtation in which I need to edit and slightly modify a bunch of pictures like that, but it seems my technique no longer works, and now I understand why. It is not clear to me if my "drawshifted" routine (which I find very useful in many many 2d pictures, where it works nicely) can be modified to some "drawshifted3d" (say) which could be applied in a 3D context. This is my problem.
Thanks!
Maurizio
PS: I post again my drawshifted routine. I add that if I remember correctly this is a construction which is based on some examples in the Gallery (I think that at least one example was created as an anwser to a request of mine....).
Now I realize something strange is happening here. I attached a pdf to my previous answer. The pdf I see and which I uploaded from my mac is different from the pdf I see if I download the attached picture and I look at it (with the same viewer). Indeed, I no longer see a part of it (I no longer see the tube but only the part with the 2d segment). How is that possible? I add that the pdf I have on my mac was sent to Springer and a book was printed (2 or 3 years ago) with that picture appearing on paper exactly as I see it on my Mac.
Is this a pdf (adobe) problem, or something related with Asymptote? Or else?
Thanks
Maurizio
I attach a screenshot of the original pdf.
Here's how to draw a 3D version of that scene. I've attached the corresponding HTML output.