3D plots: Past-Present-Future

66 views
Skip to first unread message

Andrey Novoseltsev

unread,
Jan 15, 2017, 7:40:09 PM1/15/17
to sage-cell
Past:

For a few years SageMathCell had issues with 3D plots due to some difficulties configuring and running Jmol/JSmol. While at the moment it mostly works, new issues keep appearing and there is a lack of manpower resolving them.

Also for a few years it was possible to use three.js graphics in SageMathCell via commands like
threejs(cube())
The problem with this function is that it is undocumented as far as I know and it is unmaintained, at least there are no improvements to some old code absorbed at some point from early versions of SageMathCloud. It is also at the moment the main reason why SageMathCell is using a special branch of SageMath - several plot-related files have added bits for three.js scenes.

Present:

There is now an option to use three.js code from SageMath itself, thanks to Paul Masson work https://trac.sagemath.org/ticket/12402 and some recent improvements (unmerged in SageMath yet) https://trac.sagemath.org/ticket/22123 The big advantage of this implementation is that it is likely to be used in multiple interfaces and therefore get regular bug fixes and enhancements.

Future:

My plan is to make
threejs(cube())
to be an alias (perhaps deprecated) for
show(cube(), viewer="threejs")
and change the default viewer in SageMathCell so that it is actually the same as just
show(cube())

A good time to do it is probably the next update to Sage 7.6, whenever that will happen. Until then, please test the new implementation and report any issues so that they can be addressed before changing defaults!

kcrisman

unread,
Jan 16, 2017, 8:10:47 PM1/16/17
to sage-cell
Andrey, good work and a good plan, I think.   Does pretty much everything that can be done in jsmol still work in three.js at this point?  (I recall that with Jason's early implementation that may not have been the case.)

Andrey Novoseltsev

unread,
Jan 16, 2017, 8:43:59 PM1/16/17
to sage-cell
On Monday, 16 January 2017 18:10:47 UTC-7, kcrisman wrote:
Andrey, good work and a good plan, I think.   Does pretty much everything that can be done in jsmol still work in three.js at this point?  (I recall that with Jason's early implementation that may not have been the case.)

There are transparency issues that bug me, but are very difficult to work around automatically, it seems. There maybe something else important missing, that why I hope that other people will check how it work for their use cases! It may be a good idea also to first make threejs(...) use new code, which will affect those who used this command, and then switch default show(...) behavior with the next update.

Andrey Novoseltsev

unread,
Mar 19, 2017, 2:36:29 PM3/19/17
to sage-cell
Old threejs(cube()) code will be removed and the call will translate with deprecation into cube().show(viewer='threejs') once I push Sage-7.6.

I will not change the default from JSmol to threejs, since it is likely to happen in Sage-8.0 itself.

On a related note: there are now very few changes to SageMath in the dedicated SageMathCell branch, I hope to get rid of them and start using vanilla Sage (with some extra modules of course).

kcrisman

unread,
Mar 20, 2017, 10:05:12 AM3/20/17
to sage-cell



Old threejs(cube()) code will be removed and the call will translate with deprecation into cube().show(viewer='threejs') once I push Sage-7.6.

I will not change the default from JSmol to threejs, since it is likely to happen in Sage-8.0 itself.

On a related note: there are now very few changes to SageMath in the dedicated SageMathCell branch, I hope to get rid of them and start using vanilla Sage (with some extra modules of course).

Thanks for the continued updates! 
Reply all
Reply to author
Forward
0 new messages