[x3d-public] Next Generation Serializers (Load/Export), JSON to Python (x3d.py)

John Carlson yottzumm at gmail.com
Mon Jan 3 22:23:15 PST 2022


Requirement 4 subsumes requirement 7.

This looks like a good pattern to follow to replace my serializers (thanks
Don, for steering me away from something more complex).  This pattern was
partly designed similar to X3DJSONLD.js without XML/DOM except as provided
by x3d.py.

Let’s discuss doing something similar, but instead, push out Three.js,
Babylon.js, X3DOM and X_ITE app code, hopefully just add a few generating
functions for each SAI.   Converting X3D JSON to these 4 SAI libraries will
position X3D well in the web world.

 Jeff, maybe we can start on a Three.js app generator if no one else is
interested? You wanted to learn JavaScript?

Seed code is here:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py
.  This is similar to JSONParser code in x3dom and x_ite.

Note that generating JS code should be an off-line process without evals.

Michalis, any thoughts on creating Pascal SAI app code generator from an
encoded x3d file?

John


On Mon, Jan 3, 2022 at 2:16 PM John Carlson <yottzumm at gmail.com> wrote:

> I have not written a Python generator or serializer for use creating
> x3d.py application programs yet, so here's my chance:
>
> Some requirements:
>
> 1. Written in Python, possibly using x3d.py or SAI, not JavaScript using
> DOM
> 2. Take JSON as input
> 3. Do not create XML/DOM like X3DJSONLD does.
> 4. Still create string/file on output.  Writing out x3d.py SAI application
> code will be first example, similar to X3dToPython.xslt, but using Python
> instead of XSLT, and JSON input instead of XML input.
> 5. Intended to be just a few methods, on the same order as X3DJSONLD + a
> Serializer.
> 6. May be moved into x3d.py.
> 7. May initally use eval, but should be easily ported to use a dispatch
> table or reflection, replacing eval.  I will have to write an "autoclass"
> which maps strings to classes.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220104/008c60d3/attachment.html>


More information about the x3d-public mailing list