[x3d-public] X3D example to show x3d.py on the web?

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Wed Dec 28 01:07:44 PST 2022


In is interesting how the brython library extends Python for use as an HTML
script language.

 

*	https://brython.info
*	https://pypi.org/project/brython

 

John, wondering if your original Web3dLogo-X3d-animated-logo2.x3d model is
available for comparison?

 

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: Sunday, December 25, 2022 10:49 PM
To: Joseph D Williams <joedwil at earthlink.net>
Cc: Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; x3d-public at web3d.org
Subject: Re: [x3d-public] X3D example to show x3d.py on the web?

 

Success!  I was able to get Web3dLogo-X3d-animated-logo3.py (with my
modifications) working on the web with brython.

 

Attached are the two updated files in a zip.

 

Here is the whole project, perhaps minus some python packages.

 

X3DJSONLD/hello at master
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
m%2Fcoderextreme%2FX3DJSONLD%2Ftree%2Fmaster%2Fhello&data=05%7C01%7Cbrutzman
%40nps.edu%7C7b0894c1371d421b991608dae70d5ad2%7C6d936231a51740ea9199f7578963
378e%7C0%7C0%7C638076343286142845%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD
AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=gsjWc
zzSUCXomwWslhMMBwAcQwg4CwIxHGcqxk5yL9s%3D&reserved=0> .
coderextreme/X3DJSONLD (github.com)

 

Thanks for feedback.

 

Note, x3djsonld.py does not work yet!

 

John

 

 

On Fri, Dec 23, 2022 at 9:13 PM Joseph D Williams <joedwil at earthlink.net
<mailto:joedwil at earthlink.net> > wrote:

Thanks John, 

OK, file seems better now.  

Joe

 

From: John Carlson <mailto:yottzumm at gmail.com> 
Sent: Friday, December 23, 2022 9:55 AM
To: Don Brutzman <mailto:brutzman at nps.edu> ; Joe D Williams
<mailto:joedwil at earthlink.net> ; x3d-public at web3d.org
<mailto:x3d-public at web3d.org> 
Subject: Fwd: [x3d-public] X3D example to show x3d.py on the web?

 

There are issues thrown against the generated files from X3dToPython.xslt
and X3dToJson.xslt, if I'm reading this right.  Actually, I just checked the
source file against the X3D validator, and there appear to be multiple
issues!

 

Please fix the .x3d in your original zip, Joe!

 

John

 

 

$ jsonlint data/Web3dLogo-X3d-animated-logo2.json

Error: Parse error on line 373:

... at rotation <mailto:... at rotation%22:[0,0,1,0,#,-1,0,0,-1.571>
":[0,0,1,0,#,-1,0,0,-1.571],

-----------------------^

Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got
'undefined'

    at Object.parseError
(C:\Users\john\AppData\Roaming\npm\node_modules\jsonlint\lib\jsonlint.js:55:
11)

    at Object.parse
(C:\Users\john\AppData\Roaming\npm\node_modules\jsonlint\lib\jsonlint.js:132
:22)

    at parse
(C:\Users\john\AppData\Roaming\npm\node_modules\jsonlint\lib\cli.js:82:14)

    at main
(C:\Users\john\AppData\Roaming\npm\node_modules\jsonlint\lib\cli.js:135:14)

    at Object.<anonymous>
(C:\Users\john\AppData\Roaming\npm\node_modules\jsonlint\lib\cli.js:179:1)

    at Module._compile (node:internal/modules/cjs/loader:1105:14)

    at Object.Module._extensions..js
(node:internal/modules/cjs/loader:1159:10)

    at Module.load (node:internal/modules/cjs/loader:981:32)

    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

    at Function.executeUserEntryPoint [as runMain]
(node:internal/modules/run_main:77:12)

 

$ python data/Web3dLogo-X3d-animated-logo2.py

  File
"C:\Users\john\X3DJSONLD\src\main\data\Web3dLogo-X3d-animated-logo2.py",
line 41

    children=[

             ^

SyntaxError: '[' was never closed

 

Attaching files.

 

I'm going to set this aside for now, but the last thing I will do is check
the XML

 

Web3dLogo-X3d-animated-logo2.zip has the bad .x3d file!

 

Thanks!

 

 

---------- Forwarded message ---------
From: Joseph D Williams <joedwil at earthlink.net
<mailto:joedwil at earthlink.net> >
Date: Thu, Dec 22, 2022 at 4:47 PM
Subject: RE: [x3d-public] X3D example to show x3d.py on the web?
To: John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com> >, X3D
Graphics public mailing list <x3d-public at web3d.org
<mailto:x3d-public at web3d.org> >

 

 

This one?

 

From: John Carlson <mailto:yottzumm at gmail.com> 
Sent: Thursday, December 22, 2022 1:26 PM
To: X3D Graphics public mailing list <mailto:x3d-public at web3d.org> 
Subject: [x3d-public] X3D example to show x3d.py on the web?

 

Does anyone have an x3d example they'd like to convert to Python and display
on the web?

 

I'd like a beefier example than "HelloWorld.py". since that's been done.

 

It should be compatible with X3DOM and x3d.py.

 

You'll get a python file and an HTML file back.

 

I trust you will be experienced enough to install brython locally.   I will
take a video  and post on YouTube.

 

Thanks!

 

John

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20221228/5fa72475/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5353 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20221228/5fa72475/attachment-0001.p7s>


More information about the x3d-public mailing list