sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.39k stars 472 forks source link

Tachyon objects should be able to accept 3d plots and fields from sage. #14428

Open ef32b0da-e160-47e1-a4a4-eb9e264d5ebc opened 11 years ago

ef32b0da-e160-47e1-a4a4-eb9e264d5ebc commented 11 years ago

Currently the sage objects created by

sage: t = Tachyon() 

only accept certain drawn primitives that are predefined inside sage/plot/plot3d/tachyon.py after they are created, e.g. using sphere, plane, cylinder methods to insert those figures. General sage 3d plots can't be added to such scenes. A round about method using

sage: var('x y')
(x, y)
sage: a = plot3d(sin(x+y), (x, -4, 4), (y, -4, 4))
sage: tachyon_rt(a.tachyon())

is possible, however most of the options are hard-coded into sage/plot/plot3d/base.pyx. Even worse the whole scene is treated as one large text file making any further manipulation difficult at best.

CC: @nilesjohnson @paulmasson @slel

Component: graphics

Keywords: tachyon 3d plot raytrace

Author: anton_t

Issue created by migration from https://trac.sagemath.org/ticket/14428

ef32b0da-e160-47e1-a4a4-eb9e264d5ebc commented 11 years ago

Attachment: tachyon.patch.gz

patch to tachyon.py to enable general 3d objects to be inserted into tachyon scenes.

9343d2e0-59ba-4406-bd4f-c78e4cf1230e commented 10 years ago
comment:5

This definitely needs to be done :) I'm not sure of the best way to go about it -- I had a different approach in mind, and yet another way is outlined at this AskSage answer.

9343d2e0-59ba-4406-bd4f-c78e4cf1230e commented 10 years ago

helpers to convert graphics objects to Tachyon or join two Tachyon objects

9343d2e0-59ba-4406-bd4f-c78e4cf1230e commented 10 years ago
comment:8

Attachment: tachyon_converter.sage.gz

I've cleaned up and attached some function definitions that outline the approach I had in mind. Part of it is similar to the approach of anton_t, but it also includes some code for extracting a tachyon scene string from a graphics object and some code for joining the objects from a scene string into another Tachyon object.

It's still in a very sketchy state, and I'm not yet sure this is the best approach, but it's what I have at the moment :)