<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Install anaconda</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Use this command to install pyjnius into Jupyter lab.  Don’t forget your virtual environment:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>conda install -c conda-forge pyjnius</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Then launch anaconda navigator from start menu, then launch jupyter lab, and type in some python below</p><p class=MsoNormal>=========================================================================================</p><p class=MsoNormal>import jnius_config</p><p class=MsoNormal># specify path to jar.   Set Java CLASSPATH</p><p class=MsoNormal>jnius_config.set_classpath('.', 'c:/x3d-code/www.web3d.org/x3d/stylesheets/java/jars/X3DJSAIL.3.3.full.jar')</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal># put the fully qualified Java class inside the quotes</p><p class=MsoNormal>from jnius import autoclass</p><p class=MsoNormal>Shape = autoclass('org.web3d.x3d.jsail.Shape.ShapeObject')</p><p class=MsoNormal>Transform = autoclass('org.web3d.x3d.jsail.Grouping.TransformObject')</p><p class=MsoNormal>IS = autoclass('org.web3d.x3d.jsail.Core.ISObject')</p><p class=MsoNormal>X3D = autoclass('org.web3d.x3d.jsail.Core.X3DObject')</p><p class=MsoNormal># declare the rest of the X3DJSAIL classes you are going to load into python using autoclass</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal># Type your Python code involving Shape, Transform and IS here—basically using X3DJSAIL-like API in python</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal># generate XML from X3DObject instance Using X3DJSAIL into a variable.</p><p class=MsoNormal>xml = X3D().setProfile("Immersive").setVersion("3.3").toStringX3D(2)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#  Then some tell me best way to get the xml scenegraph into a web page in Jupyter.  Do something like:</p><p class=MsoNormal><a href="https://stackoverflow.com/questions/25698448/how-to-embed-html-into-ipython-output">https://stackoverflow.com/questions/25698448/how-to-embed-html-into-ipython-output</a><o:p></o:p></p><div style='mso-element:para-border-div;border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><br># Note that the released/approved X3DPSAIL might be different</p><p class=MsoNormal style='border:none;padding:0in'><o:p> </o:p></p><p class=MsoNormal style='border:none;padding:0in'># It might be a bumpy ride! If all else falls, don’t chain sets and adds in a single expression.</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Have fun with Python and beta-X3DPSAIL!   Would love to see some exported HTML or PDF!   Want to give it a whirl, Andreas? Holger?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="http://www.web3d.org/specifications/java/X3DJSAIL.html">http://www.web3d.org/specifications/java/X3DJSAIL.html</a></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>