Dear Sage-dev,
This is a poll to make three.js (
https://threejs.org/) the default 3d viewer
in Sage, in replacement of Jmol (
https://sourceforge.net/projects/jmol/).
Indeed, thanks to the work of Paul Masson, the three.js 3d viewer is doing a
very good job in displaying Sage 3d plots, as you can see in these examples
taken from Sage reference's manual:
https://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/sage_reference_threejs.ipynbYou can rotate/zoom the 3d view with the mouse and, by clicking on the small black
arrow at the bottom right of the view, you can download a png screenshot.
Other examples of three.js rendering can be found in this notebook devoted to
anti de Sitter space:
https://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Notebooks/SM_anti_de_Sitter.ipynbFor more information about the three.js renderer in Sage, see
https://doc.sagemath.org/html/en/reference/plot3d/threejs.htmlThe discussion about having three.js as the default viewer is taking place in
the ticket
https://trac.sagemath.org/ticket/22408This ticket also contains the git branch to perform the change if decided.
Here is a discussion summary: in favor of three.js, we have
- three.js, which is based on the WebGL API, displays 3d plots faster than
Jmol, and with a better quality
- 3d plots rendered with three.js can be publicly shared via
nbviewer.jupyter.org, contrary to those rendered with Jmol, which appear as
blank spaces, cf. this test notebook:
https://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/test_3d_view.ipynb- three.js enables to label the plot axes (via the option 'axes_labels', the default
of which is ['x', 'y', 'z']); on the opposite, there are no labels on Jmol
plots and the option 'axes_labels' is ineffective, which looks like a serious
drawback for a mathematical software...
- Jmol causes many troubles to Sage packagers (see
#22408 for details);
for instance in Sage 8.8 console, Jmol display is broken on recent
Debian-based distros (e.g. Debian Buster and Ubuntu 18.04), due to a JRE
issue; fortunately this is fixed by
https://trac.sagemath.org/ticket/25026On the con side, there are
- the current lack of non-interactive conversion of three.js views to static
png figures (in interactive mode, the black arrow mentioned above does the
job). As a result, the png figures in the reference manual will still be
generated with Jmol, as proposed in
#22408- some minor opacity issues (see
#22408 for details)
Given the above elements, please vote!
Eric.