to X3D Resources
               

Python X3D Package x3d.py

               
to Web3D home page

X3D Python Scene Access Interface Library (X3DPSAIL)

Installation | Design Features | Development | Examples | Jupyter Notebook | References | TODO | Contact

The x3d.py Python X3D Package supports programmers with Python interfaces and objects for standards-based X3D programming, all as open source.
The presentation Python X3D Package Implementation provides an overview and shows examples.


🔖 Installation to top

Download and install Python on your system.

Python x3d.py package installation and update options:

That should be all that is needed for most Python X3D programmers! Here is an example screenshot for PythonX3dSmokeTests.py using IDLE.


🔖 Design Features to top

The current implementation strives to follow first principles of python package design, being as "pythonic" as possible.

X3D Unified Object Model (X3DUOM) defines a full set of object-oriented interfaces for all nodes, fields and statements in the X3D Architecture Specification. The X3DUOM is used to autogenerate the entire x3d.py package, ensuring that it is always up-to-date with the latest X3D Architecture. This codebase tracks with the latest draft specification for X3Dv4 (also supporting X3D versions 3.0 through 3.3).

Python is exceedingly rigorous regarding design and implementation, demands crisp readability, and often leads to a single best approach for each programming task. A single well-constructed open-source Python X3D implementation might serve all Python distributions and programmers well.

Several extensive design efforts previously tried to build a Python language package for X3D with difficulty. The original X3D Python Package Design whiteboard diagram illustrates the many relationships for strict typing and an object-oriented scene graph that are being supported.

Creating a native-Python implementation for X3D data structures appears to provide the greatest possible portability.


🔖 Development to top

Package designers: Don Brutzman, Loren Peitso, John Carlson, Masaki Aono, and Myeong Won Lee.

Build assets

Most development work is performed using Netbeans and Ant.

  1. PythonX3dDevelopmentArchive.zip provides a convenient asset of key development assets.
  2. build.xml for Ant is primary tool for x3d.py development tasks.
  3. build.configuration.log.txt shows an administrator console for installing/upgrading python developer module dependencies.
  4. build.package.log.txt shows creation and testing of the x3d.py package.
  5. build.examples.log.txt shows testing of example models.
  6. build.pylint.log.txt shows pylint static testing of the x3d.py package.
  7. build.deploy.log.txt shows administrator deployment to PyPi.
  8. build.uninstall.log.txt is a debugging console showing difficulties uninstalling and reconfiguring python.

🔖 Configuration

To run python programs from command line, the PATH environment variable must point to PYTHONHOME or installation location. The PYTHONPATH environment variable may also need to be set to one of the following:

Now working: testing confirms that deployment is exposing x3d.py package properly for program execution.
Workaround: if needed for development, simply download x3d.py package source and place it in same directory as your python program.

🔖 Packaging

The Python X3D project is published on the Python Packaging Index (PyPi). Development was configured by following the PyPi packaging-projects tutorial.

🔖 Source code autogeneration assets

🔖 Version control

All work is maintained under a non-viral Web3D Consortium open-source license (text) and maintained using subversion at Sourceforge version control.

Consistent support for all X3D Specifications Relationships includes multiple file formats (XML, JSON, ClassicVRML, binary) and programming languages (JavaScript, Java, Python, C, C#, C++) with fully interoperable expressive power for each.


🔖 Examples to top

Example X3D models

Running ant examples in the python directory produces results shown in build.examples.log.txt for the preceding project models.

X3D Resources: Examples includes over 3900 models converted from .x3d to .py Python source. See build.python.all.log.txt for the entire set of unit-testing results.

🔖 Jupyter notebook

Mission statement: "Project Jupyter exists to develop open-source software, open-standards, and services for interactive computing across dozens of programming languages."


🔖 References to top

Python puts a high value on clarity, strict style and effective documentation.

Books

Python


🔖 TODO to top

Lots! For starters, in progress:


🔖 Contact to top

Questions, suggestions, additions and comments about this Python X3D Package page are welcome. Please send them to Don Brutzman and Loren Peitso (email brutzman,lepeitso at nps.edu).
Master version of this Python X3D Package page is available online at
https://www.web3d.org/x3d/stylesheets/python/python.html and available in Sourceforge version control.
Updated: 20 October 2020