[x3d-public] Question: Geometry class for x3d.py? no thanks. New tests, updated package x3d.py 4.0.45

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Wed Dec 8 07:32:05 PST 2021


No thanks.  We are conforming strictly to X3D4 interface hierarchy.

Other programmers (like you) may build anything they want in their python implementations using x3d.py of course.

Meanwhile have sorted out and fixed X3DField and X3DArrayField support, as discussed on list a few days ago.  This did require some refinements to X3DUOM, as expected, so better + better.


  *   X3D Unified Object Model (X3DUOM)
  *   https://www.web3d.org/specifications/X3DUOM.html
  *   https://www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml
  *   https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/specifications/X3dUnifiedObjectModel-4.0.xml

Have fixed (or confirmed OK and silenced) a large number of pylint warnings for x3d.py package.  Stricter than ever!

Further tuning continues on VRML and JSON export syntax.  Smoke test now saves its export tests as files for comparison and refinement.


  *   https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/examples/PythonX3dSmokeTests.py
  *   https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/examples/PythonX3dSmokeTestsModelTest.json
  *   https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/examples/PythonX3dSmokeTestsModelTest.wrl
  *   https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/python/examples/PythonX3dSmokeTestsModelTest.xml

Updated x3d.py to v4.0.45.


  *   https://pypi.org/project/x3d

Have fun with X3D Python!  8)

all the best, Don
--
Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
X3D graphics, virtual worlds, navy robotics https:// faculty.nps.edu/brutzman

From: John Carlson <yottzumm at gmail.com>
Sent: Tuesday, December 7, 2021 7:59 AM
To: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics public mailing list <x3d-public at web3d.org>
Subject: Question: Geometry class for x3d.py?

NPS WARNING: *external sender* verify before acting.


Don, you may want to create a Geometry class in x3d.py like:

class Geometry(_X3DGeometryNode):
   def FIELD_DECLARATIONS(cls):
       return []
   def JSON(self):
       return self.geometry.JSON();
   def XML(self):
       return self.geometry.XML();



Also, we would have to provide parsers to fill in self.geometry.

Or test for self.geometry in the JSON and XML methods, or add a constructor.

This is mainly for loading the -geometry field.

It could be handled in the Shape class, with eval() figuring out which geometry constructor to call.  That is okay with me!

Obviously, eval is a tiny bit dangerous, even if only resolving a class.  I recommend creating a regexp that matches all node and statement names.

I'm going to proceed with eval in the Shape class for now.

Thanks!

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211208/bac65458/attachment-0001.html>


More information about the x3d-public mailing list