Skip to content
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

Bug: 3MF crash when read file #4568

Open
tungpv90 opened this issue Jun 9, 2022 · 8 comments · Fixed by #4619
Open

Bug: 3MF crash when read file #4568

tungpv90 opened this issue Jun 9, 2022 · 8 comments · Fixed by #4619
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@tungpv90
Copy link

tungpv90 commented Jun 9, 2022

Describe the bug

  1. Some 3MF file crash when ReadFile
    Error in File ..3MF/XmlSerializer.cpp line 430:

mesh->mTextureCoords[0] = new aiVector3D[group->mTex2dCoords.size()];
Replace:
mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];

  1. 3MF can't load Embedded Texture or export embedded texture to glb file
    3d.zip
@tungpv90 tungpv90 added the Bug Global flag to mark a deviation from expected behaviour label Jun 9, 2022
@kimkulling
Copy link
Member

The texture coordinates are not stored correctly. The meshes are having more than 30000 vertices, but we are only assigning 16000 texture coordinates. SO it crashes.

This is an Assimp bug.

@tungpv90
Copy link
Author

tungpv90 commented Jun 30, 2022

Source code of 3MF is too old. i think you need update it @kimkulling

@kimkulling
Copy link
Member

Which source-code do you mean? The source you can find in the library is the assimp-code. There is no newer code.

But I have a better understanding what is going wrong: the texture-coordinates are injected via resource groups. In the face-definition the referenced textures are descriped via their index in the resource group. And this is currently wrong. The current implementation of the 3mf-parser just copies the texture coordinates into the mesh which holds the faces.

@tungpv90
Copy link
Author

tungpv90 commented Jul 1, 2022

Thanks for answering
i read 3MF_Core_Specification and 3MF Materials Extension
https://github.com/3MFConsortium/spec_core/blob/master/3MF%20Core%20Specification.md
https://github.com/3MFConsortium/spec_materials/blob/master/3MF%20Materials%20Extension.md

some properties like colorgroup... have not been updated yet.
I've been trying to learn and try the code but it seems I still haven't been successful.

@tungpv90
Copy link
Author

tungpv90 commented Jul 7, 2022

thank you updated this bug.
But when i convert 3mf to glb. i can't load embedded texture
This is image in Microsoft powerpoint 2019
ppt

and this is in my app
2

2_3mf.zip

@kimkulling
Copy link
Member

Hm, seems to be an issue with the embedded texture support in 3MF. I will need to take another look onto that!

@kimkulling kimkulling reopened this Jul 7, 2022
@SamuelTallet
Copy link

SamuelTallet commented Sep 13, 2022

Hello @kimkulling and @tungpv90,

Bug is still here on current master branch.

assimp info t-rex.3mf (when it works) sees 1 embedded texture. Just an hypothesis... but does embedded thumbnail is erroneously counted as texture?

assimp extract t-rex.3mf fails to export embedded texture (0 byte output).

Would it be possible to use integer as texture reference, like for other formats? For instance:
*0
instead of:
*/3D/Texture/755688691_2048x2048.png

t-rex.3mf.zip

@galdenny
Copy link

Hello,

Would it be possible to skip loading the textures? I wanted to post the same bug before I found this one. But to be honest, in some applications the stored textures are not relevant.
Can you please create a flag to skip loading some parts?

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

4 participants