[x3d-public] X3dToJson.xslt, X3dToPython.xslt, create3000/Library Test ParticleSystem possible issues. Though may not pass!

John Carlson yottzumm at gmail.com
Sun Jul 3 00:09:34 PDT 2022


Don,

Here are some issues with various X3dTo*.xslt:

grep fieldOfView VolumeEmitter.py
VolumeEmitter.py:
 OrthoViewpoint(description='OrthoViewpoint',fieldOfView=-1.5,-1.5,1.5,1.5),

$ grep fieldOfView VolumeEmitter*
VolumeEmitter.json:              "@fieldOfView":-1.5,-1.5,1.5,1.5
VolumeEmitter.x3d:        fieldOfView='-1.5, -1.5, 1.5, 1.5'/>

In the JSON, the MFFloat is does not appear to be an array, with [] around
the numbers.

In the python, there's no tuple or list markers denoting a tuple or list

Note in the XML, both the "," and the space is separating the floats in the
MFFloat.  I haven't seen that the MFBools with ", " as separators is
working, but perhaps the problem is more general.

Links to XML below.
====================================================
Holger,

I fully realize that these are test samples, and they may not pass, thus
when I convert x3d  to python and run, these errors may appear (which may
be totally valid).

BoundedPhysicsModel.py
x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!
Traceback (most recent call last):
  File
"C:\Users\john\X3DJSONLD\src\main\python\net\x3djsonld\Library\Tests\Components\ParticleSystems\BoundedPhysicsModel.py",
line 82, in <module>

emitter=ConeEmitter(position=(0,-3,0),direction=(1,4,0),angle=0.4,speed=0.2,mass=3200),
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
29419, in __init__
    self.direction = direction
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
29450, in direction
    assertLessThanEquals('direction', direction, 1)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
1847, in assertLessThanEquals
    assert isLessThanEquals(value, maximum), fieldName + '=' + str(value) +
' fails assertLessThanEquals maximum=' + str(maximum)
AssertionError: direction=(1, 4, 0) fails assertLessThanEquals maximum=1



PointEmitter.py
x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!
Traceback (most recent call last):
  File
"C:\Users\john\X3DJSONLD\src\main\python\net\x3djsonld\Library\Tests\Components\ParticleSystems\PointEmitter.py",
line 92, in <module>
    WindPhysicsModel(speed=0.8,gustiness=0.8,turbulence=2),
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
99589, in __init__
    self.turbulence = turbulence
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
99643, in turbulence
    assertZeroToOne('turbulence', turbulence)
  File "C:\Users\john\X3DJSONLD\venv\lib\site-packages\x3d\x3d.py", line
1818, in assertZeroToOne
    assert isZeroToOne(value), str(fieldName) + '=' + str(value) + ' fails
assertZeroToOne requirements: value(s) must be in range [0..1]'
AssertionError: turbulence=2 fails assertZeroToOne requirements: value(s)
must be in range [0..1]


SurfaceEmitter.py
x3d.py package 4.0.64.1 loaded, have fun with X3D Graphics!
Traceback (most recent call last):
  File
"C:\Users\john\X3DJSONLD\src\main\python\net\x3djsonld\Library\Tests\Components\ParticleSystems\SurfaceEmitter.py",
line 50, in <module>
    MetadataSet(DEF='children',name='children',reference='
http://titania.create3000.de',
TypeError: MetadataSet.__init__() got an unexpected keyword argument
'appearance'


Original XML here:  Library/Tests/Components/ParticleSystems at main ·
create3000/Library (github.com)
<https://github.com/create3000/Library/tree/main/Tests/Components/ParticleSystems>

Attached generated python code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220703/9fccb3c8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PartSys.zip
Type: application/x-zip-compressed
Size: 13648 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220703/9fccb3c8/attachment-0001.bin>


More information about the x3d-public mailing list