[x3d-public] This code that I generate from the archives shows the same problem as my local code. Does the XML, my Java, X3DJSONLD, X3dToJava.xslt, or X3DJSAIL need to be fixed? I will try X3dToJava.xslt. Also code too large handling.

yottzumm at gmail.com yottzumm at gmail.com
Sat May 6 18:35:43 PDT 2017


Found attached X3D XML in this folder: /c/x3d-code/www.web3d.org/x3d/content/examples/Basic/course 

I am including both your code, my code and the XML.

This is ye olde ProtoInstance field issue, I think.  Sorry if I’m reporting multiple times.

I believe the from end and the to end of this is the last thing I need to handle with routes, either in my code, or
in my X3D.  I do have a ProtoInstance name issue, but that might be handled with a constructor parameter I haven’t tried yet—I haven’t really worked on that yet.

I’m still getting code to large problems too, with X3dToJava.xslt generated code.  I can probably share an example from my website.  Converting this file with X3dToJava.xslt and then compiling it will generate a code to large issue: http://coderextreme.net/X3DJSONLD/john.x3d  I do have a solution for this, and it involves creating inner classes for the arrays (and breaking up the arrays).  My corresponding example java is found here:  http://coderextreme.net/X3DJSONLD/john.java
This does work, as evidenced by an output JSON file: http://coderextreme.net/X3DJSONLD/john.new.json .   Serializer code for the arrays is below.

John
Here is your exception:

ExtrusionCrossSectionExampleShip execution self-validation test results: <meta name='hint' content='Utilize ExtrusionCrossSection ProtoInstance as a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry").'/>
 ROUTE details: FROM SmokeSpineInterpolator.value_changed (CoordinateInterpolator.MFVec3f.outputOnly) TO Smoke.set_spine (ProtoInstance.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.

Below are my exceptions.

org.web3d.x3d.sai.InvalidFieldValueException:  ROUTE details: FROM SmokeSpineInterpolator.value_changed (CoordinateInterpolator.MFVec3f.outputOnly) TO Smoke.set_spine (ProtoInstance.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.
org.web3d.x3d.sai.InvalidFieldValueException:  ROUTE details: FROM SmokeSpineInterpolator.value_changed (CoordinateInterpolator.MFVec3f.outputOnly) TO Smoke.set_spine (ProtoInstance.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.
        at org.web3d.x3d.jsail.Core.ROUTEObject.validate(ROUTEObject.java:760)
        at org.web3d.x3d.jsail.Grouping.TransformObject.validate(TransformObject.java:1763)
        at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:627)
        at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1876)
        at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:746)
        at www_web3d_org.x3d.content.examples.Basic.course.ExtrusionCrossSectionExampleShip.main(ExtrusionCrossSectionExampleShip.java:80)
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:  ROUTE details: FROM SmokeSpineInterpolator.value_changed (CoordinateInterpolator.MFVec3f.outputOnly) TO Smoke.set_spine (ProtoInstance.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)
ROUTE toField (destination) event can only have accessType='inputOutput' or accessType='inputOnly'.
        at org.web3d.x3d.jsail.Core.ROUTEObject.validate(ROUTEObject.java:760)
        at org.web3d.x3d.jsail.Grouping.TransformObject.validate(TransformObject.java:1763)
        at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:627)
        at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1876)
        at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:746)
        at www_web3d_org.x3d.content.examples.Basic.course.ExtrusionCrossSectionExampleShip.main(ExtrusionCrossSectionExampleShip.java:80)


Here is my serializer array breakup code. Even it isn’t perfect, but it handles my local test code (I think there’s still an issue somewhere in the X3D archives)  The duplicated 840 figure (3 times, I’m embarrassed) can be tweaked to optimize.  You’ll want to call it on your large arrays, not your small ones (but I do call it on my small ones.  There outta be a law ☹):

        printSubArray : function (attrType, type, values, co, j, lead, trail) {
                if (attrType.startsWith("MF")) {
                        var str = "new "+attrType+"Object(";
                        for (var i = 0; i < values.length; i += 840) {
                                var max = values.length;
                                if (i + 840 < max) {
                                        max = i + 840;
                                }
                                this.codeno++;
		  // this code is separate from the main code
                                this.code[co] = "protected class "+attrType+co+" {\n";
                                this.code[co] +=  "  protected "+attrType+"Object getArray() {\n";
                                this.code[co] += "    return new "+attrType+"Object(new "+type+"[] {"+lead+values.slice(i, max).join(j)+trail+"});\n";
                                this.code[co] += "  }\n";
                                this.code[co] += "}\n";
		// this code is part of the main code
                                if (i == 0) {
                                        str += "new "+attrType+co+"().getArray())";
                                } else {
                                        str += ".append(new "+attrType+co+"().getArray())";
                                }
                                co = this.codeno;
                        }
                        return str;
                } else {
                        if (type === "int") {
                                for (var v in values) {
                                        if (values[v] > 4200000000) {
                                                values[v] = "0x"+parseInt(values[v]).toString(16).toUpperCase();
                                        }
                                }
                        }
                        return "new "+type+"[] {"+lead+values.join(j)+trail+"}";
                }
        },
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170506/5c8142c4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtrusionCrossSectionExampleShip.java
Type: application/octet-stream
Size: 22345 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170506/5c8142c4/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtrusionCrossSectionExampleShip.java
Type: application/octet-stream
Size: 24208 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170506/5c8142c4/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtrusionCrossSectionExampleShip.x3d
Type: application/octet-stream
Size: 11353 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170506/5c8142c4/attachment-0005.obj>


More information about the x3d-public mailing list