3d graphics with jsmol in version 3.9 broken

122 views
Skip to first unread message

João Palhoto Matos

unread,
Oct 14, 2019, 8:49:22 AM10/14/19
to sage-devel
I have found that activating a 3d jsmol animation in a sage 3.9 notebook is broken. Although initial preview is correct activating the animation leads to a graphic showing several small spheres (molecules?!). Reverting to version 3.8 everything works. I build sage on Linux Mint 19.2.

Mikhail Malakhaltsev

unread,
Oct 15, 2019, 6:09:23 AM10/15/19
to sage-devel
I have the same problem with notebook in Sage 8.9, browsers Vivaldi, GoogleChrome, sage built on opensuse Leap 15.0.

Dima Pasechnik

unread,
Oct 15, 2019, 7:16:34 AM10/15/19
to sage-devel
Could you please post concrete steps to reproduce the problem?
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/0f061118-12fb-4e18-a868-b34397491998%40googlegroups.com.

João Palhoto Matos

unread,
Oct 15, 2019, 7:31:08 AM10/15/19
to sage-...@googlegroups.com
This is how I first got there.

Build sage 3.9 on Linux Mint 19.2

Start sage

notebook()

x,y,z=var('x,y,z')
u, v = var('u,v')
from sage.plot.plot3d.transform import rotate_arbitrary
from sage.plot.plot3d.shapes import Text
from sage.manifolds.utilities import set_axes_labels
from sage.plot.plot3d.shapes import Cylinder
c1=parametric_plot3d([v, u*v, (1-v^2)^(1/2) ], (u,0, 1), (v,0, 1),
opacity=0.1, aspect_ratio=1)
cc1 = set_axes_labels(c1, 'x', 'y', 'z', color='red')
c2=parametric_plot3d([u*v, v, (1-v^2)^(1/2) ], (u,0, 1), (v,0, 1),
opacity=0.1, aspect_ratio=1, color='red')
c3=parametric_plot3d([0, u*v, (1-v^2)^(1/2) ], (u,0, 1), (v,0, 1),
opacity=0.1, aspect_ratio=1, color='green')
c4=parametric_plot3d([u*v, 0, (1-v^2)^(1/2) ], (u,0, 1), (v,0, 1),
opacity=0.1, aspect_ratio=1, color='yellow')
b=parametric_plot3d([u, v, 0 ], (u,0, 1), (v,0, 1), opacity=0.1,
aspect_ratio=1, color='grey')
(cc1+c2+c3+c4+b).show(aspect_ratio=1 )

[Graphic shows up as usual]

Click the circle icon on the bottom left of the graphic

[The graphic goes horribly wrong]

I have tried with several browsers and various notebooks and different
builds. It seems any browser and any 3d graphic will do.

Sage version 8.9 includes an updated jmol / jsmol version.

Às 12:16 de 15/10/19, Dima Pasechnik escreveu:

Mikhail Malakhaltsev

unread,
Oct 15, 2019, 7:32:19 AM10/15/19
to sage-devel
The steps are:

sage -n=sagenb

Then in the notebook make a cell:
var('u, v')
parametric_plot3d([u^2 - v^2, u, v], (u, -2, 2), (v, -2, 2))

 Evaluate the cell. The result is a 3D-image which looks as it should be.

Click at the image. The image disappear and you see a configuration of small little red balls. 
You can rotate the configuration and do everything you normally could do with the 3D-image of surface, but now there is no surface, you see only this configuration.   





El martes, 15 de octubre de 2019, 6:16:34 (UTC-5), Dima Pasechnik escribió:
Could you please post concrete steps to reproduce the problem?

On Tue, Oct 15, 2019 at 11:09 AM Mikhail Malakhaltsev <mik...@gmail.com> wrote:
>
> I have the same problem with notebook in Sage 8.9, browsers Vivaldi, GoogleChrome, sage built on opensuse Leap 15.0.
>
> El lunes, 14 de octubre de 2019, 7:49:22 (UTC-5), João Palhoto Matos escribió:
>>
>> I have found that activating a 3d jsmol animation in a sage 3.9 notebook is broken. Although initial preview is correct activating the animation leads to a graphic showing several small spheres (molecules?!). Reverting to version 3.8 everything works. I build sage on Linux Mint 19.2.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

Dima Pasechnik

unread,
Oct 15, 2019, 7:46:54 AM10/15/19
to sage-devel
On Tue, Oct 15, 2019 at 12:32 PM Mikhail Malakhaltsev <mik...@gmail.com> wrote:
>
> The steps are:
>
> sage -n=sagenb
>
> Then in the notebook make a cell:
> var('u, v')
> parametric_plot3d([u^2 - v^2, u, v], (u, -2, 2), (v, -2, 2))

this works for me in Jupyter notebook (on Sage 9.0.beta1)

You might also try the treejs viewer,
parametric_plot3d([u^2 - v^2, u, v], (u, -2, 2), (v, -2, 2),viewer="threejs")
which will be default in Sage 9.0, so then the viewer parameter won't be needed.

This viewer also works in sagenb.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/0e0a85a1-ae73-4abb-89dd-930c3cf30167%40googlegroups.com.

Dima Pasechnik

unread,
Oct 15, 2019, 7:50:21 AM10/15/19
to sage-devel
hmm, on Sage 9.0.beta1 I don't see any circle icon in Jupyter notebook
with this graphics.
What does it mean to do?

>
> [The graphic goes horribly wrong]
>
> I have tried with several browsers and various notebooks and different
> builds. It seems any browser and any 3d graphic will do.
>
> Sage version 8.9 includes an updated jmol / jsmol version.
>
> Às 12:16 de 15/10/19, Dima Pasechnik escreveu:
> > Could you please post concrete steps to reproduce the problem?
> >
> > On Tue, Oct 15, 2019 at 11:09 AM Mikhail Malakhaltsev <mik...@gmail.com> wrote:
> >> I have the same problem with notebook in Sage 8.9, browsers Vivaldi, GoogleChrome, sage built on opensuse Leap 15.0.
> >>
> >> El lunes, 14 de octubre de 2019, 7:49:22 (UTC-5), João Palhoto Matos escribió:
> >>> I have found that activating a 3d jsmol animation in a sage 3.9 notebook is broken. Although initial preview is correct activating the animation leads to a graphic showing several small spheres (molecules?!). Reverting to version 3.8 everything works. I build sage on Linux Mint 19.2.
> >> --
> >> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/0f061118-12fb-4e18-a868-b34397491998%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a76ab373-06ea-6166-7bc5-ca52f15f9e6b%40gmail.com.

Mikhail Malakhaltsev

unread,
Oct 15, 2019, 7:52:50 PM10/15/19
to sage-devel
In the Jupyter notebook jsmol does work, however the menu (right click) does not work properly.
At the same time threejs does not have the menu equivalent a jsmol, for example export item.
In general it seems threejs has less possibilities that jsmol.

Dima Pasechnik

unread,
Oct 15, 2019, 8:02:00 PM10/15/19
to sage-devel
On Wed, Oct 16, 2019 at 12:52 AM Mikhail Malakhaltsev <mik...@gmail.com> wrote:
>
> In the Jupyter notebook jsmol does work, however the menu (right click) does not work properly.
> At the same time threejs does not have the menu equivalent a jsmol, for example export item.
> In general it seems threejs has less possibilities that jsmol.

treejs has a button somewhere to export to png, IIRC.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a638a768-9ae9-44b5-8fef-77a10086d9c1%40googlegroups.com.

Mikhail Malakhaltsev

unread,
Oct 15, 2019, 8:08:48 PM10/15/19
to sage-devel
It has this button at the right bottom corner.

Dima Pasechnik

unread,
Oct 16, 2019, 4:28:43 AM10/16/19
to sage-devel
On Mon, Oct 14, 2019 at 1:49 PM João Palhoto Matos
<joao.p...@gmail.com> wrote:
>
> I have found that activating a 3d jsmol animation in a sage 3.9 notebook is broken. Although initial preview is correct activating the animation leads to a graphic showing several small spheres (molecules?!). Reverting to version 3.8 everything works. I build sage on Linux Mint 19.2.

what are these version numbers: 3.8, 3.9? Could you please explain
where you find them?
Recent Sage versions are 8.8, 8.9.


>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2e63baef-2f7b-4741-a15a-96919898a7e2%40googlegroups.com.

kcrisman

unread,
Nov 7, 2019, 9:05:50 AM11/7/19
to sage-devel
I can confirm this problem in sagenb on Safari, ONLY with the `viewer='jmol'` option in 9.0.beta4 (default renders normally in threejs).  

On the other hand, in Jupyter, I didn't even get the little circle that one usually clicked to make the jmol live, but the right-click menu was there (though the sub options were obscured), so I guess it really was jmol (confirmed by doing with the option).  So maybe this is resolved?  I encourage the original posters to try this in the Jupyter notebook and see what happens and report back, as having no "live" 3d views would be a serious regression.

João Palhoto Matos

unread,
Nov 21, 2019, 10:29:41 AM11/21/19
to sage-devel
The problem still occurs in 9.0.beta6. I have found that the three.js animations are now exportable with ease to a *.html file. In my use case this is completely satisfactory solution.
Reply all
Reply to author
Forward
0 new messages