ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 27 Dec 2017 14:19:49 -0600Remove shadows from axes in plot3d with viewer tachyonhttp://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.Wed, 06 Dec 2017 10:08:42 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/Comment by slelievre for <p>I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=39976#post-id-39976Welcome to Ask Sage! Please provide a way to reproduce the problem as a starting point to try and help.Wed, 06 Dec 2017 11:28:44 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=39976#post-id-39976Comment by slelievre for <p>I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=39977#post-id-39977Note: To display inline code, use backticks. To display blocks of code
or error messages, separate them by a blank line from the rest
of the text, and indent them with 4 spaces, or select code lines
and click the "code" button (the icon with '101 010').
For instance, typing
If we define `f` by
def f(x, y):
return (x, y)
then `f(2, 3)` returns `(2, 3)` but `f(2)` gives:
TypeError: f() takes exactly 2 arguments (1 given)
will produce:
> If we define `f` by
>
> def f(x, y):
> return (x, y)
>
> then `f(2, 3)` returns `(2, 3)` but `f(2)` gives:
>
> TypeError: f() takes exactly 2 arguments (1 given)Wed, 06 Dec 2017 11:29:01 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=39977#post-id-39977Answer by nbruin for <p>I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?answer=40326#post-id-40326If you are interested in producing a high-quality raytraced image from sage output, you should probably use special configuration of the raytracer directly. There is definitely more configuration we should allow in sage directly (choice of camera, some basic lighting options), but for really good results there will be no substitute.
Sage just writes a scene file for the `tachyon` raytracer. You can take that file and edit it. Here's how you can get such a file:
sage: var('x,y')
(x, y)
sage: G=plot3d(x^2+y^2,(x,-1,1),(y,-1,1))
sage: with open("T.dat","w") as F: F.write(G.tachyon())
Your next problem would be to figure out how to call the tachyon raytracer with such a file. SOmething like this would probably work:
sage: %system tachyon T.dat -format PNG -o T.png
Now you should have an image file `T.png` that displays your scene.
Your next stop is to read the documentation of `tachyon` http://jedi.ks.uiuc.edu/~johns/raytracer/ and edit the scene file `T.dat` to your liking.
Alternatively, you could look at different export methods, such as `G.obj()` and `G.x3d()` and see if mainstream raytracers such as blender can read one of them.
Wed, 27 Dec 2017 14:19:49 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?answer=40326#post-id-40326Answer by Emmanuel Charpentier for <p>I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?answer=40281#post-id-40281You can do :
P1=<whatever you want plotted>
P1.show(viewer="tachyon", frame=False)
and you get a picture without frame shadows (and without frame, obviously...)
The documentation of the use of Tachyon parameters with Sage 3D graphics objects is sparse (to say the least...). It *might* be possible to get a frame without frame shadows, but I do not (yet) know how to get it.Fri, 22 Dec 2017 03:33:05 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?answer=40281#post-id-40281Comment by Emmanuel Charpentier for <p>You can do :</p>
<pre><code>P1=<whatever you want plotted>
P1.show(viewer="tachyon", frame=False)
</code></pre>
<p>and you get a picture without frame shadows (and without frame, obviously...)</p>
<p>The documentation of the use of Tachyon parameters with Sage 3D graphics objects is sparse (to say the least...). It <em>might</em> be possible to get a frame without frame shadows, but I do not (yet) know how to get it.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=40300#post-id-40300Nils, your answer is much better than mine. You should develop it in a full answer...Tue, 26 Dec 2017 05:14:30 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=40300#post-id-40300Comment by nbruin for <p>You can do :</p>
<pre><code>P1=<whatever you want plotted>
P1.show(viewer="tachyon", frame=False)
</code></pre>
<p>and you get a picture without frame shadows (and without frame, obviously...)</p>
<p>The documentation of the use of Tachyon parameters with Sage 3D graphics objects is sparse (to say the least...). It <em>might</em> be possible to get a frame without frame shadows, but I do not (yet) know how to get it.</p>
http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=40290#post-id-40290If you're serious about getting a raytraced image you probably want to look into `P1.tachyon()` to get the data that can be fed to the tachyon raytracer. You can edit that file to your liking. If you don't want shadows on the axes you should probably go with completely ambient lighting, and no directional light source. Or you could place the light source in such a way that the shadows don't bother you. Alternatively, export to blender somehow and use that raytracer.Sat, 23 Dec 2017 13:09:57 -0600http://ask.sagemath.org/question/39972/remove-shadows-from-axes-in-plot3d-with-viewer-tachyon/?comment=40290#post-id-40290