[x3d-public] Status, X3DPSAIL

John Carlson yottzumm at gmail.com
Fri Apr 26 13:57:34 PDT 2019


Additional error:
processSingleScene.pythonValidation:
     [echo] processSingleScene.python C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter01TechnicalOverview\HelloTriangle.future.py
     [echo] Loading X3D model as .py program, if successful then saving as round-trip .x3d version:
     [exec] org.web3d.x3d.sai.InvalidFieldException: IndexedFaceSet containing Coordinate nodel with 3 values must also include coordIndex field
     [exec] org.web3d.x3d.sai.InvalidFieldException: IndexedFaceSet containing Coordinate nodel with 3 values must also include coordIndex field
     [exec]     at org.web3d.x3d.jsail.Geometry3D.IndexedFaceSetObject.validate(IndexedFaceSetObject.java:3492)
     [exec]     at org.web3d.x3d.jsail.Shape.ShapeObject.validate(ShapeObject.java:1517)
     [exec]     at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:683)
     [exec]     at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:3526)
     [exec]     at org.web3d.x3d.jsail.Core.X3DObject.toFileX3D(X3DObject.java:777)
     [exec] Traceback (most recent call last):
     [exec]   File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter01TechnicalOverview\HelloTriangle.future.py", line 71, in <module>
     [exec]     X3D0.toFileX3D("/x3d-code/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloTriangle_RoundTrip.x3d")
     [exec]   File "jnius\jnius_export_class.pxi", line 766, in jnius.JavaMethod.__call__
     [exec]   File "jnius\jnius_export_class.pxi", line 843, in jnius.JavaMethod.call_method
     [exec]   File "jnius\jnius_utils.pxi", line 91, in jnius.check_exception
     [exec] jnius.JavaException: JVM exception occurred: IndexedFaceSet containing Coordinate nodel with 3 values must also include coordIndex field
     [exec] Result: 1
     [echo] =====================

Error appears here (somewhere here):

   .setScene(Scene() \
    .addChild(Shape() \
     .setGeometry(IndexedFaceSet(coordIndex = [0,1,2]) \
      .setCoord(Coordinate() \
       .setPoint(MFVec3f([0,0,0,1,0,0,0.5,1,0])) \
      ) \
     ) \

Note that coordIndex is initializeOnly, so it is passed as a parameter to the IndexedFaceSetObject constructor.  I can try using setCoordIndex, but that’s not the right semantics for the X3D. Suggest handling coordIndex in the parameters to the constructor, but I don’t know what to pass as a parameter to the Java constructor.  Maybe look up how **kwargs is done with pyjnius passing to Java.  I suspect some kind of map.

Meanwhile, if we don’t want to change the Java API to handle kwargs in the constructor parameters, we will need to change our PyJNIus serializer to handle initializeOnly a different way (with set). I do not believe this is a major issue, just a little tweaking.  I will keep the research API as is, using kwargs in the constructor.

John


Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, April 26, 2019 3:39 PM
To: Don Brutzman; X3D Graphics public mailing list
Subject: Status, X3DPSAIL

1. We conquered most of the attribute errors.   There might be one or a few left in the X3dForWebAuthors folder.
2. Outstanding error 1:

$ python foo.py
Traceback (most recent call last):
  File "foo.py", line 8, in <module>
    .setIS(IS() \
  File "jnius\jnius_export_class.pxi", line 760, in jnius.JavaMethod.__call__
  File "jnius\jnius_conversion.pxi", line 78, in jnius.populate_args
  File "jnius\jnius_utils.pxi", line 205, in jnius.check_assignable_from
jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/X3DConcreteNode' passed for a 'org/web3d/x3d/sai/Core/X3DNode'

Code:

$ cat foo.py
import classpath
from org.web3d.x3d.jsail.Core.ProtoBodyObject import ProtoBodyObject as ProtoBody
from org.web3d.x3d.jsail.Core.ISObject import ISObject as IS
from org.web3d.x3d.jsail.Grouping.TransformObject import TransformObject as Transform

ProtoBody() \
  .addChild(Transform() \
   .setIS(IS() \
   ) \
  )

This is because setIS returns an X3DConcreteNode (in X3DConcreteNode) and the X3DConcreteNode is not a X3DNode, despite the fact that TransformObject derives from X3DNode.    Suggest cast to X3DNode or adding additional addChild methods with additional types as parameters to ProtoBodyObject.java. Casts are seen throughout the X3DJSAIL code for addChild.  Perhaps it would be preferable to add methods which avoid casts in application code (ok in library).

What do you think?

Will start python execution process to report on additional errors (mostly stack overflows, I think).

John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190426/2d889e07/attachment-0001.html>


More information about the x3d-public mailing list