On Wednesday, 22 June 2016 21:00:50 UTC-6, Paul Masson wrote:Andrey, I have an interest in helping to improve the state of the threejs() function. Here's an example of why from my documentation project:
http://paulmasson.github.io/sagemath-docs/functions/spherical_harmonic.html
The first thing I would like to do is add the option to disable or resize labels on the axes. I'd also like to expose more of the underlying Three.js attributes for those who know how to use them.
In order to test out changes in either the JS or Python code, do I have to build an entire SageMathCell server or is there some subset of the build that would be sufficient?
Building SageMathCell itself is very fast, so I am not sure I quite understand the question. I have updated instructions some time ago and they worked for me to setup a development server from scratch. When you change Python code, there is no need to make anything, just restart web_server. When you change JS you have to make it which is not instantaneous, but not long. And you probably want to uncomment
https://github.com/sagemath/sagecell/blob/master/js/build.js#L4
to speed up making and ease debugging.
Having said that - if you are going to work on threejs it would be highly desirable to coordinate with SageMathCloud (I think our version is based on some old William's code)
and push threejs support in terms of options/scene preparation into Sage itself.
So please consider volunteering for this task ;-)
Also, in my experience the quality of JSmol is still superior to that of threejs
and it is consistent across browsers/OSes.
Since default plotting is done using it, it maybe worthwhile to improve its handling as well.
I'm unclear as to the exact relation of SageMath to SMC. Mr. Stein has made a number of improvements to Three.js handling in SMC: why hasn't any of that made it back to SageMathCell already? Is it for lack of someone wanting to do it, or is there some other issue in using SMC code?
and push threejs support in terms of options/scene preparation into Sage itself.
What do you have in mind here? The preparation in SageMathCell appears to depend on IPython messaging if I recall correctly. Would all of that need to be replicated in SageMath? Or some simpler mechanism?
Presumably for viewing it would then open a browser window to display output. How would that work when SageMath got uploaded to the cell server? Would the preparation in SageMath replace the preparation on the cell server?
Also, in my experience the quality of JSmol is still superior to that of threejs
I'm a bit surprised to hear this, unless it's because of lack of WebGL support on older machines/browsers. I've used Three.js enough to know that it can do amazing things, and I personally wrote one of the examples in the Three.js repository (the only one with math in it). The current implementation in the cell server certainly doesn't give Three.js the space to shine it deserves, and maybe that also is coloring your opinion.
And most important for the future, JSmol on the desktop is Java = security risk. I'd rather support moving to JavaScript processing or even Python interpreted in a browser rather than hanging on to Java.
On Thu, Jun 23, 2016 at 11:06 PM Andrey Novoseltsev <novo...@gmail.com> wrote:On Thursday, 23 June 2016 16:11:42 UTC-6, Paul Masson wrote:I'm unclear as to the exact relation of SageMath to SMC. Mr. Stein has made a number of improvements to Three.js handling in SMC: why hasn't any of that made it back to SageMathCell already? Is it for lack of someone wanting to do it, or is there some other issue in using SMC code?
Note that somewhat confusingly SageMathCloud = SMC = SageMathCell, but this equality is not transitive ;-) On the other hand there are similarities: both SMCs use SageMath not only with some additional interface files, but also with some tweaking. As I've already mentioned, SMCell support for threejs includes methods for graphics objects that produce "threejs input". SMCloud has to have the same type of functionality one way or the other. My guess is that no SMC got to pushing these changes into SageMath itself just because it is not as urgent as other things. There should be no legal issues since SM and SMCloud are GPL.
Also, in my experience the quality of JSmol is still superior to that of threejs
I'm a bit surprised to hear this, unless it's because of lack of WebGL support on older machines/browsers. I've used Three.js enough to know that it can do amazing things, and I personally wrote one of the examples in the Three.js repository (the only one with math in it). The current implementation in the cell server certainly doesn't give Three.js the space to shine it deserves, and maybe that also is coloring your opinion.
Old machines are definitely an issue, but my main problems are
1) displaying partially transparent surfaces
2) no "lines of fixed width" different from one pixel which is usually inadequate for projectors
Andrey, you're absolutely right about the difference between Jmol and JSmol. I guess I got confused because there doesn't appear to be a way to launch JSmol from the Sage command line, only in the context of a notebook. Typing "show(plot3d(...,view='canvas3d'))" at the command line still launches the Java version.Is this a design decision? Is there some reason why the JavaScript version can't be launched in a new browser window, just like the Tachyon viewer opens a .png? This would have a bearing on how Three.js would be used on the desktop. Must it also be restricted to the notebook environment?This is probably a discussion for sage-devel, but I'd like a bit more context before starting it there. Thanks!