[x3d-public] jupyter notebook

Andreas Plesch andreasplesch at gmail.com
Tue May 28 12:12:16 PDT 2019


Hi John, group,

I tried image textures and inlines with x3dom on jupyterlab:
https://mybinder.org/v2/gh/andreasplesch/conda/master/?urlpath=lab/tree/sphere.ipynb

Run all cells.

Here are some observations and a suggestion:

- inline works. But jupyterlab serves local files from a folder above
the folder where the notebook and resources are stored and so the
relative url to the inline starts with "./files/"
- generated X3D with ImageTexture used within an Inline works. Here
the url to the image is relative to the inline url, and so does not
need the "./files/" prefix
- x3dom has a problem with generated X3D outside of an Inline because
the serialized XML output uses self-closing tags such as <Material />
which is not HTML compatible.

So the suggestion would be to provide a method, say
x3d.toStringX3DClosingTags(), which generates explicit closing tags:
<Material></Material>

-Andreas


On Thu, May 23, 2019 at 5:34 PM Andreas Plesch <andreasplesch at gmail.com> wrote:
>
> Hi John,
>
> the mybinder notebooks are not permanent. Saving only works for one session.
>
> The .toFileX_ITE() generated html has too much styling to be useful for jupyter.
>
> But just manually creating the proper minimal HTML, similar to x3dom, works better, after generating the x3d as file in the docker instance.
>
> Unfortunately, the html served in the HTML display does not use the local home as root, so it is not possible to just point to the x3d file as a relative url.
>
> I added a couple of attempt to use x_ite to the jupyter notebook here:
>
> https://mybinder.org/v2/gh/andreasplesch/conda/master/?urlpath=lab/tree/sphere.ipynb
>
> but had to give up.
>
> x_ite works in an iframe with a accessible, remote url but does not work with a local url, in jupyterlab on mybinder. Perhaps it works on a local install.
>
> Maybe I will try and see if textures and inlines work in x3dom on jupyter.
>
> Cheers, Andreas
>
>
> On Wed, May 22, 2019 at 11:37 AM John Carlson <yottzumm at gmail.com> wrote:
> >
> > I welcome feedback on this X_ITE version, in a second notebook in your binder.  I merely stepped into the XML output 140 characters to arrive at something I could put between X3DCanvas tags.
> >
> >
> >
> > I’m not sure if this link will get you there, but it got me there.  I think the notebook is titled x_ite_sphere.ipynb.
> >
> > https://hub.mybinder.org/user/andreasplesch-conda-vpb30a9r/lab
> >
> >
> >
> > Needs debugged.  I don’t quite know what’s missing, looks like shaders.   See console log.
> >
> >
> >
> > Probably we need a released version?
> >
> >
> >
> > Twitter keeps the first 140 characters, and we drop them.   Heh!
> >
> >
> >
> > All the more reason to pass parameters or provide alternative functions.
> >
> >
> >
> > John
> >
> >
> >
> > Sent from Mail for Windows 10
> >
> >
> >



More information about the x3d-public mailing list