[x3d-public] Yay! Bug fixed!

John Carlson yottzumm at gmail.com
Fri May 29 10:21:53 PDT 2020


On Fri, May 29, 2020 at 8:43 AM Don Brutzman <brutzman at nps.edu> wrote:

> John, hoping to understand better when we meet again Monday.  Not fully
> following.
>
> You are welcome to do anything with Javascript and Node work within
> X3DJSAIL and we can ensure documentation/examples remain current.
>
> Okay.  I will need to work on documentation for toFileJavaScript (there
are 2 of them).  I will simply copy over and modify docs for Java if that's
okay?



> > I believe this is a problem with the X3dToNodeJS.xslt.  If you want Don,
> I can go ahead and repair the stylesheet as well, but awaiting your
> permission.
>
> I have not done anything (maybe ever) with that stylesheet.  You are of
> course welcome to improve/evolve it.
>

Okay, I think I can do that.

>
> As before, the central issue driving everything else is defining examples
> for X3D SAI JavaScript/EcmaScript programs that can run standalone in
> Node.js.  Until we get clear on that, have no way to assess whether any
> other work is adding value.
>

Yes, repeat, sorry:

https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net/coderextreme/data

All my NodeSerializer.js examples.   Many run, and some don't run, similar
to Java examples.



>
> Hoping to get clear on that, what does end result look like.  Let's be
> deliberate about this please.
>

I suggest either a X3DJSAIL-like SAI, or perhaps an es6 based sai, with a
new library.  I can continue working on es6 in a github repository if you
like?  Plus add a serializer or stylesheet for ES6-NodeJS?

I do think it's good to provide a Nashorn alternative.  That was my primary
understanding from you.

I'm going to send another error report on a JavaScript output and then
check my work in.  We can revisit on Monday.

John

>
> Very respectfully yours.
>
> On 5/28/2020 4:07 PM, John Carlson wrote:
> > LOL! forgot the bug!   I believe this is left over from Nashorn API. I
> think once we fix JavaScript output from X3DJSAIL, this file will get
> overwritten.
> >
> > $ node examples/HelloWorldProgramOutput.Node.js
> > C:\x3d-code\www.web3d.org <http://www.web3d.org
> >\x3d\stylesheets\java\node\examples\HelloWorldProgramOu
> > tput.Node.js:58
> >            .addChild(new
> autoclass.Viewpoint().setDEF("TopDownView").setDescripti
> > on("top-down view from above").setOrientation(java.to <http://java.to>([1,0,0,-1.570796],
> java.ty
> > pe("float[]"))).setPosition(java.to <http://java.to>([0,100,0],
> java.type("float[]")))))
> >
> >
>       ^
> >
> > TypeError: java.type is not a function
> >      at Object.<anonymous> (C:\x3d-code\www.web3d.org <
> http://www.web3d.org>\x3d\stylesheets\java\node\e
> > xamples\HelloWorldProgramOutput.Node.js:58:159)
> > ?[90m    at Module._compile (internal/modules/cjs/loader.js:1176:30)?[39m
> > ?[90m    at Object.Module._extensions..js
> (internal/modules/cjs/loader.js:1196:1
> > 0)?[39m
> > ?[90m    at Module.load (internal/modules/cjs/loader.js:1040:32)?[39m
> > ?[90m    at Function.Module._load
> (internal/modules/cjs/loader.js:929:14)?[39m
> > ?[90m    at Function.executeUserEntryPoint [as runMain]
> (internal/modules/run_ma
> > in.js:71:12)?[39m
> > ?[90m    at internal/main/run_main_module.js:17:47?[39m
> >
> > On Thu, May 28, 2020 at 6:05 PM John Carlson <yottzumm at gmail.com
> <mailto:yottzumm at gmail.com>> wrote:
> >
> >     Found a bug in:
> >
> >     www.web3d.org/x3d/stylesheets/java/node <
> http://www.web3d.org/x3d/stylesheets/java/node>!
> >
> >     I believe this is due to X3DJSAIL no longer emitting JavaScript.
> >
> >     We can either delete the example from the build, or add the
> X3dToNodeJS.xslt to the to*JavaScript() functions in X3DJSAIL (recommended):
> >
> >     $ grep -i javascript'('  CreateX3dSceneAccessInterfaceJava.xslt|grep
> public
> >              public String toStringJavaScript()
> >          public File toFileJavaScript(String fileName)
> >
> >     This is a effort replace the nashorn output from X3DJSAIL.   We are
> now supporting nodejs instead since Nashorn has been deprecated by Oracle.
> >
> >     I kind of think the main purpose of the nodejs output is to have a
> alternate to Java for things like large methods.  Plus, we don't have a
> good python-X3DJSAIL solution.
> >
> >     It's a good test of the FFI, and supports node.js processing on the
> server, for those that choose that route.
> >
> >     The solution on the browser is to write an es6 x3d.mjs library
> (TBD--partly done).
> >
> >     Thanks,
> >
> >     John
> >
> >     On Thu, May 28, 2020 at 5:37 PM John Carlson <yottzumm at gmail.com
> <mailto:yottzumm at gmail.com>> wrote:
> >
> >         I fixed the bug in
> >
> >         www.web3d.org/x3d/stylesheets/java/node <
> http://www.web3d.org/x3d/stylesheets/java/node>!
> >
> >         Diff:
> >
> >         $ svn diff examples/HelloWorldProgramOutput.js
> >         Index: examples/HelloWorldProgramOutput.js
> >
>  ===================================================================
> >         --- examples/HelloWorldProgramOutput.js (revision 30476)
> >         +++ examples/HelloWorldProgramOutput.js (working copy)
> >         @@ -19,7 +19,7 @@
> >           var ProtoInstance4 = null;
> >           var ProtoInstance5 = null;
> >           var ProtoInstance6 = null;
> >         -      var X3D0 =  new
> autoclass.X3D().setProfile("Immersive").setVersion("3.3")
> >         +      var X3D0 =  (new
> autoclass.X3D()).setProfile("Immersive").setVersion("3.3")
> >                 .addComments(new autoclass.CommentsBlock("
> x3dVersionComparisonTest for this model:
> supportsX3dVersion(X3DObject.VERSION_3_0)=true "))
> >                 .setHead(new autoclass.head()
> >                   .addComments(new autoclass.CommentsBlock(" comment #1
> "))
> >
> >         Will check in soon.
> >
> >         I believe this is a problem with the X3dToNodeJS.xslt.  If you
> want Don, I can go ahead and repair the stylesheet as well, but awaiting
> your permission.
> >
> >         Thanks,
> >
> >         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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200529/965464a2/attachment-0001.html>


More information about the x3d-public mailing list