Anomaly with several layered parametric plots 3d when using three.js

56 views
Skip to first unread message

João Palhoto Matos

unread,
Nov 22, 2019, 11:46:27 AM11/22/19
to sage-devel
The sage code producing the example and two 3d models, one correct produced with jsmol in sage 8.8, and other showing the problem produced with three.js in sage 9.0beta6, are available from

Dima Pasechnik

unread,
Nov 22, 2019, 5:10:54 PM11/22/19
to sage-devel
yes, it does not look too well in three.js in Jupyther notebook.
You can use jmol, just use

show(d1+d2+d3+d4+d5,viewer='jmol')

as the last command.
> --
> 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/4fe359f0-1713-4528-84aa-a783a5096019%40googlegroups.com.

Paul Masson

unread,
Nov 22, 2019, 9:14:29 PM11/22/19
to sage-devel
This is a basic problem with WebGL, which is what Three.js uses, as opposed to the canvas renderer in Jmol/JSmol. The current version of WebGL does not handle transparency very well, and there's not much we can do about that.

Transparent objects in WebGL are treated as if they are located entirely at their respective centers. When the center of one transparent object is behind part of any other, it can disappear completely because the renderer assumes it is not visible. Extended objects can be broken into smaller parts to avoid this, but self-intersecting transparent surfaces are always going to be a problem.

I did add two options for the viewer, render_order and single_side, that can help work around problems. If you've built 9.beta6 then they are described in the documentation. The first option forces objects to render in a particular order, which will keep objects from disappearing from certain angles. The second is useful for closed surfaces.

João Palhoto Matos

unread,
Nov 23, 2019, 4:58:50 AM11/23/19
to sage-devel
Unfortunately if you do that from inside a jupyter notebook you are unable to save the 3d model as the context menus are clipped (with sage 9.0beta6 using jsmol not jmol).

If you try to start a classical deprecated notebook it fails to start (with sage 9.0beta6).

If you give all the commands in the console you end up with a jmol window with apparently working menus (with sage 9.0beta6 using jmol not jsmol).

sexta-feira, 22 de Novembro de 2019 às 22:10:54 UTC, Dima Pasechnik escreveu:
yes, it does not look too well in three.js in Jupyther notebook.
You can use jmol, just use

show(d1+d2+d3+d4+d5,viewer='jmol')

as the last command.

On Fri, Nov 22, 2019 at 4:46 PM João Palhoto Matos
<joao....@gmail.com> wrote:
>
> The sage code producing the example and two 3d models, one correct produced with jsmol in sage 8.8, and other showing the problem produced with three.js in sage 9.0beta6, are available from
>
> https://cdi2tp.math.tecnico.ulisboa.pt/test#sage
>
> --
> 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,
Nov 23, 2019, 5:18:39 AM11/23/19
to sage-devel
sagenb only works with Python2, so you need to run configure with the option

--with-python=2

(which used to be the default, but not any more, now 3 is the default)


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/19531c20-9add-4a50-b6e2-7384ce563185%40googlegroups.com.

João Palhoto Matos

unread,
Nov 23, 2019, 7:21:29 AM11/23/19
to sage-devel
Thanks for letting me know about the new options and explaining. Using render_order one can "fix" the rendering of d5 easily enough but it seems there is no way to do it for d1, d2, d3 and d4 in a satisfactory way upon permutation.
Reply all
Reply to author
Forward
0 new messages