what is the plot3D viewer used in sagemath cloud

224 views
Skip to first unread message

Frédéric Chapoton

unread,
Aug 20, 2014, 4:19:52 PM8/20/14
to sage-...@googlegroups.com
Hello,

I am trying in #12212 to allow plotting colored 3D surfaces.


So far, progress has been done on jmol, tachyon and canvas3D viewers.

Does anybody know what is the viewer used in sagemath cloud ?

Andrey Novoseltsev

unread,
Aug 21, 2014, 1:17:51 PM8/21/14
to sage-...@googlegroups.com
three.js, which is also available in SageCell (you have to call it explicitly as (threejs(plot(sin))), but they function differently. There are some threads on the notebook list about three.js problems.

Frédéric Chapoton

unread,
Aug 21, 2014, 3:27:06 PM8/21/14
to sage-...@googlegroups.com
Thanks ! Do you know which file format is used by sagemath cloud to communicate with threejs ? Is it .obj or .x3d or json ? Where can I find the code ? and some documentation ?

Andrey Novoseltsev

unread,
Aug 21, 2014, 3:48:39 PM8/21/14
to sage-...@googlegroups.com
On Thursday, 21 August 2014 13:27:06 UTC-6, Frédéric Chapoton wrote:
Thanks ! Do you know which file format is used by sagemath cloud to communicate with threejs ? Is it .obj or .x3d or json ? Where can I find the code ? and some documentation ?



I think JSON, William is probably the right person to ask about code/documentation location. SMC replaces show command from Sage with its own version to handle it.

Jason Grout

unread,
Aug 22, 2014, 12:09:03 AM8/22/14
to sage-...@googlegroups.com
On 8/21/14, 15:27, Frédéric Chapoton wrote:
> Thanks ! Do you know which file format is used by sagemath cloud to
> communicate with threejs ? Is it .obj or .x3d or json ? Where can I find
> the code ? and some documentation ?

The relevant files for smc are the 3d.* files here:

https://github.com/sagemath/cloud

(at least, those were the files a while ago, and I doubt much has
changed with the 3d rendering since then.)

My students and I rewrote that 3d renderer for the sage cell server, and
then we again rewrote a system to use the IPython widget infrastructure
(so it works in the sage cell server and the IPython notebook). If
you're interested in either of those, let me know.

Thanks,

Jason


Frédéric Chapoton

unread,
Aug 22, 2014, 3:01:06 AM8/22/14
to sage-...@googlegroups.com
Hello,

thanks for the pointer. I had a look, but cannot clearly see (looking at 3d.coffee) what is the intermediate file format used between sage and the cloud server. I would guess from the code that maybe it is .obj as given by the .obj_repr method (of indexed face sets for example). Unfortunately, the .obj_repr method is not one which has been adapted yet in #12212 to provide material and colors for each face.

Yes, it would be great if the colored 3D surfaces would work also in the cell and in the ipython notebook. Last time I tried to install the ipython notebook, I failed, so I cannot experiment with it right now.

Frederic
Reply all
Reply to author
Forward
0 new messages