[x3d-public] Status, X3DPSAIL

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Tue Apr 30 09:24:36 PDT 2019


I believe this error still remains, it is a "false positive" and flaw in X3DJSAIL logic (since coordIndex typically exists OK), haven't been able to debug that one yet.

	org.web3d.x3d.sai.InvalidFieldException: IndexedFaceSet containing Coordinate nodel with 3 values must also include coordIndex field

On 4/26/2019 2:44 PM, John Carlson wrote:
> I believe this error has been “conquered.” But not ideally.  We need some way to implement initializeOnly.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Friday, April 26, 2019 3:57 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *RE: Status, X3DPSAIL
> 
> 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 <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Friday, April 26, 2019 3:39 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *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
> 


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 http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list