#2872: 3d graphics can't be saved to a file
----------------------+-----------------------------------------------------
Reporter: was | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.2
Component: graphics | Keywords:
Reviewer: | Author:
Merged: |
----------------------+-----------------------------------------------------
Comment(by was):
Another nice description of the problem by Jason Grout:
{{{
This has come up before---p.save() for 2d graphics tries
to save an image. p.save() for 3d graphics doesn't try to save an
image. It's an inconsistency. One way to get fix this is to override
the 3d graphics save routine to do what the 2d graphics save routine
does---look at the file extension and if it is a recognized image
extension, save the image; otherwise, save a Sage sobj pickle. This is
also why 3d things don't work with animate(). animate() expects to be
able to do p.save('test.png') and have a graphic image test.png saved
out to disk.
You can save a 3d graphics by hand by plotting in jmol and either
selecting "Get Image" next to the image, which converts to jpg, or if
you're doing this from the command line, you can select File|Export from
the java viewer that pops up. That's rather laborious for creating an
animation, though.
To get an image using tachyon, use show() with filename and viewer
parameters:
sage: show(sphere(), filename='test',viewer='tachyon')
You can use that trick to make a .save() method for 3d graphics (maybe
TransformGroup class or something?) that behaves like the 2d graphics
save. Then animate should work.
I don't have time to do this right now, but I think this should give
someone enough information to be able to fix things if they are
interested.
Thanks,
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2872#comment:1>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---