[x3d-public] X3DPSAIL package for conda recommended

John Carlson yottzumm at gmail.com
Tue May 14 12:19:15 PDT 2019


Don,

We should work on a conda installation instead of pip I think for python.
In otherwords, we may just have a renderer for python following the below instructions(untested).

Can some send me a scene written in X3D XML (one file for now) that they’d like to see converted to Python and the web?   It should be X3DOM compatible since that’s what I’m going to show on the web.  No scripts please.

I will return the conversion to you for your own experimentation.

Don, we should probably just have 1 file for X3DPSAIL, and then have a single symbol, say

import x3dpysail

then use x3dpysail.X3D, x3dpsail.Transform, etc.

I believe that’s per Loren.

Thanks!

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Tuesday, May 14, 2019 1:32 PM
To: X3D Graphics public mailing list; Holger Seelig; X3D Graphics member mailing list; Don Brutzman; lepeitso at nps.edu; aono at tut.jp
Subject: Jupyter Lab + beta-X3DPSAIL Testers, help! with X3DOM wanted (poorman's Python port of X3DJSAIL to python)

Install anaconda

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
=========================================================================================
import jnius_config
# specify path to jar.   Set Java CLASSPATH
jnius_config.set_classpath('.', 'c:/x3d-code/www.web3d.org/x3d/stylesheets/java/jars/X3DJSAIL.3.3.full.jar')

# 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:
https://stackoverflow.com/questions/25698448/how-to-embed-html-into-ipython-output

# 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.

http://www.web3d.org/specifications/java/X3DJSAIL.html




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190514/a66f0b73/attachment.html>


More information about the x3d-public mailing list