<div dir="ltr"><div>I was playing a bit more and noticed a few things.</div><div><br></div><div>ROUTE has fields ?</div><div><br></div><div>help(x3d.ROUTE)</div><div><br></div><div><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">Help on class ROUTE in module x3d:

class ROUTE(_X3DStatement)
 |  ROUTE(fromField='', fromNode='', toField='', toNode='')
 |  
 |  ROUTE connects output fields of event-producing nodes to input fields of event-consuming nodes.
 |  
 |  Method resolution order:
 |      ROUTE
 |      _X3DStatement
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  __init__(self, fromField='', fromNode='', toField='', toNode='')
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  FIELD_DECLARATIONS = [('fromField', '', 'SFString', 'inputOutput'), ('...</pre><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre>Probably for convenience. It may make sense to introduce X3DStatement 'parameters' or 'properties' although probably not a priority.<br><br><br>help(x3d.Scene().children)<pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="box-sizing:border-box;overflow:auto;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">Help on list object:

class list(object)
 |  list(iterable=(), /)</pre></pre><div><br></div>'children' are just lists, eg. can contain anything rather than only X3DChildNodes.<br><br>Perhaps introduce executioncontext to add routes to, ala SAI.<br><br>DEF is a field ?<pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="box-sizing:border-box;overflow:auto;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">Help on Shape in module x3d object:

class Shape(_X3DShapeNode)
 |  Shape(DEF='', bboxCenter=(0, 0, 0), bboxSize=(-1, -1, -1), USE='', class_='', appearance=None, geometry=None, IS=None, metadata=None)
 |  
 |  X3D element
 |  
 |  Method resolution order:
 |      Shape
 |      _X3DShapeNode
 |      _X3DChildNode
 |      _X3DNode
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  __init__(self, DEF='', bboxCenter=(0, 0, 0), bboxSize=(-1, -1, -1), USE='', class_='', appearance=None, geometry=None, IS=None, metadata=None)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  FIELD_DECLARATIONS = [('DEF', '', 'SFString', 'inputOutput'), ('bboxCe...
 |  </pre></pre>Probably for convenience. May lead to allowing routing to a DEF property.  Could be an extra name property/attribute.</div><div><br></div><div>String fields can contain anything:</div><div>x3d.Shape(DEF=x3d.Scene()).DEF<br></div><div><br></div><div>-Andreas</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 27, 2019 at 11:39 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Mybinder.org lets you run live notebooks using a docker image on a server.</div><div><br></div><div>Here is a live notebook which has x3d.py (v 0.11)  available in the (automatically built) docker image, and exercises the module a bit:</div><div><br></div><div><a href="https://mybinder.org/v2/gh/andreasplesch/python-conda_pip/master?filepath=index.ipynb" target="_blank">https://mybinder.org/v2/gh/andreasplesch/python-conda_pip/master?filepath=index.ipynb</a><br></div><div><br></div><div>It may take a while to load the interactive page. Feel to use that to experiment with x3d.py, or fork to preserve notebooks in a repo.</div><div><br></div><div>The pip install did not work fully. It installed but then could not find/access the module, only the __init__.py file. I had to manually provide the x3d.py .</div><div><br></div><div>Here is the non-interactive notebook via nbviewer:</div><div><br></div><div><a href="https://nbviewer.jupyter.org/github/andreasplesch/python-conda_pip/blob/master/index.ipynb" target="_blank">https://nbviewer.jupyter.org/github/andreasplesch/python-conda_pip/blob/master/index.ipynb</a><br></div><div><br></div><div>It all works well. Of course, sofar one cannot really do anything with the created scene, such as displaying it.</div><div><br></div><div>[Some observations:</div><div>If you look at the end, I was expecting to access routes from the scene object. But it only accepts children.</div><div>Can one add the same child multiple times to the children array ? How would this be different or the same as DEF/USE ?<br></div><div>].</div><div><br></div><div>I did not try Mayavi but looking at the project it appears they rely on the vtk xml x3dexporter. It looks like they use x3dom for jupyter and wrap the x3d xml string as html. Unfortunately, this probably leads to problems with singletons, and jupyter cannot use xhtml. There was a note on the list previously on how to use python standard xml libraries to generate full closing tags. If I find some time I may try some things and make suggestions to Mayavi.</div><div><br></div><div>-Andreas</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Message: 2<br>
Date: Tue, 27 Aug 2019 05:39:26 +0000<br>
From: "Brutzman, Donald (Don) (CIV)" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br>
To: Masaki Aono <<a href="mailto:aono@tut.jp" target="_blank">aono@tut.jp</a>><br>
Cc: Kwan-Hee Yoo <<a href="mailto:khyoo@chungbuk.ac.kr" target="_blank">khyoo@chungbuk.ac.kr</a>>, Myeong Won Lee<br>
        <<a href="mailto:mwlee@suwon.ac.kr" target="_blank">mwlee@suwon.ac.kr</a>>, X3D Graphics public mailing list<br>
        <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>>, "Peitso, Loren (CIV)" <<a href="mailto:lepeitso@nps.edu" target="_blank">lepeitso@nps.edu</a>>, John<br>
        Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>
Subject: [x3d-public] testing x3d python jupyter notebook #0<br>
Message-ID: <<a href="mailto:622f0a4b-2cff-af29-2613-f8b090ec068c@nps.edu" target="_blank">622f0a4b-2cff-af29-2613-f8b090ec068c@nps.edu</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello Masaki, thanks for your help with setting up Jupyter notebook on my system.<br>
<br>
        <a href="https://test-jupyter.readthedocs.io/en/latest/install.html" rel="noreferrer" target="_blank">https://test-jupyter.readthedocs.io/en/latest/install.html</a><br>
<br>
Attached please find my first Jupyter notebook that includes an x3d scene.  Also available as<br>
<br>
        <a href="https://www.web3d.org/x3d/stylesheets/python/jupyter/HelloJupyterNotebook0.ipynb" rel="noreferrer" target="_blank">https://www.web3d.org/x3d/stylesheets/python/jupyter/HelloJupyterNotebook0.ipynb</a><br>
<br>
As discussed, it assumes that x3d.py has already been downloaded and is available in a PYTHONPATH directory.<br>
<br>
        <a href="https://www.web3d.org/x3d/stylesheets/python/python.html" rel="noreferrer" target="_blank">https://www.web3d.org/x3d/stylesheets/python/python.html</a><br>
<br>
Please let me know if this notebook works for you.<br>
<br>
It is also viewable via jupyter's nbviewer service at<br>
<br>
        <a href="https://nbviewer.jupyter.org/urls/www.web3d.org/x3d/stylesheets/python/jupyter/HelloJupyterNotebook0.ipynb" rel="noreferrer" target="_blank">https://nbviewer.jupyter.org/urls/www.web3d.org/x3d/stylesheets/python/jupyter/HelloJupyterNotebook0.ipynb</a><br>
<br>
Interestingly, at first this copied notebook appears to load the x3d.py package on the jupyter nbviewer server without prior configuration incantations, since the forced "error" is displayed.  However by looking at the source, it appears that the TypeError markup is saved in the JSON source.  So the shared nbviewer version of the notebook must be a published version that has been run, earlier, saved/shared and is later re-runnable. (Hence "viewer" in the name nbviewer.)<br>
<br>
I am next trying to configure my mailer to launch such notebooks.  Not sure it is possible.<br>
<br>
Onward we go... having fun with Python X3D!  Domo arigato  8)<br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br>
-------------- next part --------------<br>
An embedded and charset-unspecified text was scrubbed...<br>
Name: HelloJupyterNotebook0.ipynb<br>
URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190827/0a1cf52f/attachment.ksh" rel="noreferrer" target="_blank">http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190827/0a1cf52f/attachment.ksh</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: HelloJupyterNotebook0.ipynb.pdf<br>
Type: application/pdf<br>
Size: 458205 bytes<br>
Desc: HelloJupyterNotebook0.ipynb.pdf<br>
URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190827/0a1cf52f/attachment.pdf" rel="noreferrer" target="_blank">http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190827/0a1cf52f/attachment.pdf</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
<br>
<br>
------------------------------<br>
<br>
End of x3d-public Digest, Vol 125, Issue 40<br>
*******************************************<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_6350144821275665026m_4017364938681659815gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div></div>