[x3d-public] Jupyter Lab + beta-X3DPSAIL Testers, help! with X3DOM wanted (poor man's Python port of X3DJSAIL to python)
yottzumm at gmail.com
Tue May 14 11:32:09 PDT 2019
Use this command to install pyjnius into Jupyter lab. Don’t forget your virtual environment:
conda install -c conda-forge pyjnius
Then launch anaconda navigator from start menu, then launch jupyter lab, and type in some python below
# specify path to jar. Set Java CLASSPATH
# put the fully qualified Java class inside the quotes
from jnius import autoclass
Shape = autoclass('org.web3d.x3d.jsail.Shape.ShapeObject')
Transform = autoclass('org.web3d.x3d.jsail.Grouping.TransformObject')
IS = autoclass('org.web3d.x3d.jsail.Core.ISObject')
X3D = autoclass('org.web3d.x3d.jsail.Core.X3DObject')
# declare the rest of the X3DJSAIL classes you are going to load into python using autoclass
# Type your Python code involving Shape, Transform and IS here—basically using X3DJSAIL-like API in python
# generate XML from X3DObject instance Using X3DJSAIL into a variable.
xml = X3D().setProfile("Immersive").setVersion("3.3").toStringX3D(2)
# Then some tell me best way to get the xml scenegraph into a web page in Jupyter. Do something like:
# Note that the released/approved X3DPSAIL might be different
# It might be a bumpy ride! If all else falls, don’t chain sets and adds in a single expression.
Have fun with Python and beta-X3DPSAIL! Would love to see some exported HTML or PDF! Want to give it a whirl, Andreas? Holger?
It’s kind of a let down that all we did was provided a small layer on top of X3DJSAIL. I’d really like it well tested in the browser. I haven’t tested it much inside Jupyter, just got really excited this morning when I saw some expressions working, so I thought I’d share.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the x3d-public