Ask Your Question
1

Remove shadows from axes in plot3d with viewer tachyon

asked 2017-12-06 17:08:42 +0100

Nonlocal gravatar image

I would like to remove the shadows from the axes that are projected onto a plot3d image I created. Thank you in advance.

edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Please provide a way to reproduce the problem as a starting point to try and help.

slelievre gravatar imageslelievre ( 2017-12-06 18:28:44 +0100 )edit

Note: 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)
slelievre gravatar imageslelievre ( 2017-12-06 18:29:01 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-12-22 10:33:05 +0100

Emmanuel Charpentier gravatar image

You 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.

edit flag offensive delete link more

Comments

If 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.

nbruin gravatar imagenbruin ( 2017-12-23 20:09:57 +0100 )edit

Nils, your answer is much better than mine. You should develop it in a full answer...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2017-12-26 12:14:30 +0100 )edit
0

answered 2017-12-27 21:19:49 +0100

nbruin gravatar image

If 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 tachyonhttp://jedi.ks.uiuc.edu/~johns/raytra... 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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-12-06 17:08:42 +0100

Seen: 441 times

Last updated: Dec 27 '17