-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataExchange refactoring and X3D export #842
Comments
Looks good to me. |
I found a few small oversights in the port which need a self._ . |
started a PR: #844 |
Here is a notebook which demonstrates how to use the module. It then uses the x3d function to produce x3dom compatible HTML which the notebook can display. |
I included the officiel x3d.py module as a dependency, into the x3d_official subpackage:
see commit be5d4dd |
I think this is safe. I will let Don as the maintainer know. |
I pushed a set of commits with a very first try for the new X3D.py, base on the pure python Tesselator and the x3d standard package see 56d5bac There's still a big work to do: testing, clean ups (some old code has not been removed yet), small issues with the official x3d package (creaseAngle is not a property of the IndexedTriangleSet but I used to work with it, I don't know if I have to manually add this property or use another class, for instance the IndexedFaceSet) |
@andreasplesch I face an issue while trying to use a Normal(vector=[[1,0,0], [0,1,0]]) raises the following issue Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 35739, in __init__
self.vector = vector
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 35749, in vector
assertGreaterThanEquals('vector', vector, -1)
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 1652, in assertGreaterThanEquals
assert isGreaterThanEquals(value, minimum), fieldName + '=' + str(value) + ' fails assertGreaterThanEquals minimum=' + str(minimum)
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 1641, in isGreaterThanEquals
if each < minimum:
TypeError: '<' not supported between instances of 'list' and 'int' There's a quality check I don't understand inthe def vector(self, vector):
if vector is None:
vector = MFVec3f.DEFAULT_VALUE(self)
assertValidMFVec3f(vector)
assertGreaterThanEquals('vector', vector, -1)
assertLessThanEquals('vector', vector, 1)
self.__vector = vector I don't understant the |
MFVec3f is a list of tuples. So try
Normal( vector=[(1,0,0), (0,1,0)] )
But for values like (2,0,0) there is still an assertionError, working as
designed.
https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#Normal
says that normals need to be normalized. So, this is a minimal check for
that.
…-Andreas
On Thu, Jun 11, 2020 at 1:17 PM Thomas Paviot ***@***.***> wrote:
@andreasplesch <https://github.com/andreasplesch> I face an issue while
trying to use a Normal node:
The single line
Normal(vector=[[1,0,0], [0,1,0]])
raises the following issue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 35739, in __init__
self.vector = vector
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 35749, in vector
assertGreaterThanEquals('vector', vector, -1)
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 1652, in assertGreaterThanEquals
assert isGreaterThanEquals(value, minimum), fieldName + '=' + str(value) + ' fails assertGreaterThanEquals minimum=' + str(minimum)
File "/home/thomas/Devel/pythonocc-core/src/Extend/DataExchange/x3d_standard/x3d.py", line 1641, in isGreaterThanEquals
if each < minimum:
TypeError: '<' not supported between instances of 'list' and 'int'
There's a quality check I don't understand inthe Normal class definition
(from the official x3d.py file):
def vector(self, vector):
if vector is None:
vector = MFVec3f.DEFAULT_VALUE(self)
assertValidMFVec3f(vector)
assertGreaterThanEquals('vector', vector, -1)
assertLessThanEquals('vector', vector, 1)
self.__vector = vector
I don't understant the assertGreaterThanEquals and assertLessThanEquals
purpose. What do I miss ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#842 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPCT2YSEM7J2BZATFM635LRWEGS5ANCNFSM4NH342XA>
.
--
Andreas Plesch
Waltham, MA 02453
|
The DataExchange.py module became too big. Current work it to split the content to dedicated modules.
New modules XDE.py and X3D.py will contain the recent work related to X3D export.
see commit 009ea2b
ping @andreasplesch
The text was updated successfully, but these errors were encountered: