![]() |
Python X3D Package x3d.py |
![]() |
Download and 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.
Download and install Python on your system.
Python
x3d.py
package installation and update options:
pip install x3d
python -m pip install x3d
That should be all that is needed for most Python X3D programmers! Here is an example screenshot for PythonX3dSmokeTests.py using IDLE.
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.
Package designers: Don Brutzman, Loren Peitso, John Carlson, Masaki Aono, and Myeong Won Lee.
Most development work is performed using Netbeans and Ant.
x3d.py
package.
pylint
static testing of the x3d.py
package.
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:
x3d.py
module (Windows 10 example):
PYTHONPATH=C:\Users\brutzman\AppData\Local\Programs\Python\Python39\Lib\site-packages\x3d;
x3d.py
module:
PYTHONPATH=C:\x3d-code\www.web3d.org\x3d\stylesheets\python\x3d;
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.
The Python X3D project is published on the Python Packaging Index (PyPi). Development was configured by following the PyPi packaging-projects tutorial.
build.package.x3d.py
,
package.prepare
,
and
pylint
.
.x3d
models to .py
source
x3d.py
package.
x3d.py
package.
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.
insertPackagePrefix=true
.
x3d.py
is built.
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.
Mission statement: "Project Jupyter exists to develop open-source software, open-standards, and services for interactive computing across dozens of programming languages."
x3d.py
capabilities live in a Web browser.
Python puts a high value on clarity, strict style and effective documentation.
Lots! For starters, in progress:
x3d.py
package from pip
and not PYTHONPATH
.
field
and fieldValue
initializations.pylint
for strict code quality. See
build.pylint.log.txt
for current output results.
XML()
export using package x3d.py
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: 1 November 2020