Outline - andreasplesch/OCCToX3D GitHub Wiki
Outline
A project to make it easy to convert various engineering type 3d file formats to X3D using OpenCascade.
Strategy
T. Paviot's pythonocc includes easy to use import of these file formats, and an export to X3D method. So the first approach is simply to make this available on the web, using a docker image which has all the necessary dependencies, including pythonocc which in turn requires the c++ OpenCascade library.
There may be ways to improve on the existing export as a secondary goal.
OpenCascade itself has a VRML module which seems like the best option for a high quality export.
NIST STEP File Analyzer also comes with a stp2x3d binary converter: https://github.com/usnistgov/SFA/blob/master/source/sfa-grafx3d.tcl#L592
Existing resources
https://github.com/dblanding/kodacad: python to analyze step meta data with pythonocc
https://www.opencascade.com/doc/occt-7.4.0/refman/html/toolkit_tkvrml.html : occ vrml
https://github.com/tpaviot/pythonocc-binderhub/blob/master/Dockerfile#L1: how to build occ and pythonocc
https://mybinder.org/v2/gh/tpaviot/pythonocc-binderhub/master : jupyter with pythonocc
https://github.com/tpaviot/pythonocc-core
https://senties-martinelli.com/software/cad-viewer
https://discourse.jupyter.org/t/how-to-transform-a-jupyter-notebook-into-a-webapp/758/6
[1] Python Package Index (PyPi) x3d 0.0.25 Package support for Extensible 3D (X3D) Graphics International Standard (IS) https://pypi.org/project/x3d/
[2] Python X3D Package x3d.py,X3D Python Scene Access Interface Library (X3DPSAIL) https://www.web3d.org/x3d/stylesheets/python/python.html
"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."
[2.1] Python X3D Package Implementation https://www.web3d.org/x3d/stylesheets/python/documents/PythonX3dPackageImplementation.pdf
So you would use this library for model creation and data-driven improvement, no need to reinvent X3D data structures or methods.
This is autogenerated from X3DUOM so it will always stay in sync with latest/greatest X3D4.
We've done some preliminary work with Jupyter notebook, listed there. Lots of potential projects in TODO section.
[2.2] X3DPSAIL: Jupyter notebook, https://www.web3d.org/x3d/stylesheets/python/python.html#Jupyter
TODO https://www.web3d.org/x3d/stylesheets/python/python.html#TODO