Repository navigation
feat:1.add 3mf vertex color read 2.fix 3mf read texture bug - #5361
Conversation
|
@GalenXiao there is something I would like to ask you about these changes. Would any of these changes also need to be implemented and reflected in the D3MFExporter.cpp / D3MFExporter.h files? I use the ASSIMP library together with ASSIMPJS, which all ends up in a JavaScript based ASSIMP Viewer, which in essence has the ASSIMP library import the model and then convert it to GLB2 format and pass it on to three.js GLTF Loader for displaying. Just to mention that I have already tried your changes and did get vertex colors to show up but what did not work properly is the face colors (see the attached pictures) and textures still don't show, at least for me and the way I test these. Bear in mind that my knowledge of C++ programming is rather basic and that there could be bugs in my code. The following pictures show three.js facecolors.3mf example:
|
|
@GitHubDragonFly I'm sorry, I cannot open the 3D model you provided. |
|
@GitHubDragonFly I believe it is also necessary to modify the code for exporting 3MF. I will add to it later. Thank you for the reminder. Regarding the issue of vertex colors that you mentioned, I regret to inform you that Assimp's data definition only considered one color per vertex. This works well for multiple model objects where each model object has a different color. However, for 3MF, it defines that within a mesh object, the colors of the triangular facets can be different, meaning that a vertex can have multiple colors. Therefore, after parsing, you will see the effect that you have observed. I cannot directly redefine Assimp's data structure, so it is indeed regrettable. Assimp can support multiple model objects well when the colors of the triangular facets are consistent across the object, such as with this stool.3MF. |
|
@GitHubDragonFly This is the corresponding 3MF file. |
|
@GalenXiao thank you for responding. I will have to wait for any necessary changes to be made to the exporter since that is what my viewer relies on. The link to facecolors.3mf file I provided in my previous response will take you to GitHub repository and you can download the file from there. |
|
@emaame @dnadlinger @iamsergio "Can you help me understand why the workflow has not been automatically initiated after such a long time?" |
|
@GitHubDragonFly "Can you help me understand why the workflow has not been automatically initiated after such a long time?" |
|
@GalenXiao besides for using ASSIMP library on my end, I don't really deal with it in this repository and cannot really answer your question. |
|
@GalenXiao just so you are aware, my fork of ASSIMP has an updates branch which contains lots of customized code. This "updates" branch currently includes:
My ASSIMP Viewer is using it and currently it can show your stool.3mf file properly. If you are curious enough then try it for a test. |
|
@GitHubDragonFly OK,I have seen it,you are great! |
I don't know. Maybe ask the maintainer |
|
@kimkulling hello,can you help me understand why the workflow has not been automatically initiated after such a long time? |
|
You're a first-time contributor so the workflow has to be manually approved. This is a GitHub -wide thing due to abuse by crypto miners. |
|
@kimkulling Hello,It seems like there might be an issue with the workflow, as I've noticed that the recent PRs are failing with errors related to Hunter, and the errors are consistent. Could it be possible to fix this? Also, could you help me re-trigger the workflow? This is my first time contributing code. Thank you very much! |
|
@turol Sure, thank you for your answer. |
|
@GalenXiao for your information, it appears that your code is actually functional for showing single embedded texture. My ASSIMP Viewer was importing the texture but also had material color set as (0, 0, 0) and that's why I couldn't see the texture. The attached picture below shows this as working now after changing the material color to (1, 1, 1). I am not really sure why the material color gets set as (0, 0, 0), this is probably something that needs to be resolved in the library. Another issue that still seems to be present is importing multiple textures. |
|
Here is a picture of the multiple textures example issue. It shows that only 1 texture is imported. |
|
@kimkulling Why does hunter always fail to download zlib when I haven't changed cmakelist |
|
@GitHubDragonFly assimp's data structure design only considers a mesh object corresponding to a texture map, if multiple texture maps, need to correspond to a texture in each mesh object, can only say very sorry, if you need a mesh object corresponding to multiple textures, then you may need to download the official sdk dedicated to parsing 3mf files |
|
@GalenXiao I am sorry that I am busy at this time, so I cannot reply you in time. As for the problem that T-Rev.3MF cannot display normally, I think vertex color and texture are two things, and my own software will give priority to display texture if texture exists. Maybe you need to check your code logic below |
|
@GitHubDragonFly assimp's data structure vertex color can only correspond to one and a mesh object can only correspond to one texture, if you want to fully support 3mf file features, I recommend you download Microsoft's official corresponding 3mf SDK. |
|
Hunter seems to be not the right solution. I am thinking to switch to vcpkg. |
|
Merged, thanks a lot for your contribution. |
* feat:1.add 3mf vertex color read 2.fix 3mf read texture bug * fix checks failed * Trigger CI --------- Co-authored-by: Kim Kulling <[email protected]>








Hello, I am a 3D printing engineer and I have been following your project for a long time. It has been of great help to me. However, there are some frustrating things. Your support for 3mf files is too poor, only providing basic model data. However, for the 3D printing industry, the texture data and color information corresponding to 3mf are very important. The entire industry is currently moving towards full-color and multi-color trends. Therefore, I have hoped that you would open source these features a long time ago, but I have been waiting for a long time and there has been no update. So I thought of contributing my own strength. I have fixed these features and bugs. I hope we can promote the development of the 3D printing industry together. First of all, I want to point out that your understanding of 3mf is problematic, which may be related to your lack of understanding of the 3D printing industry. Below I want to point out the points you misunderstood:
Although the face does not specify any features, it inherits the resource value of the object. When the face specifies the property, it will overwrite it, and it should inherit when it is not specified.
<triangle v1="213" v2="203" v3="199" pid="40" p1="0"/>Here p1 p2 p3 means to update the corresponding vertices, p1 means to update the first vertex, p2 is used to update the second vertex, and p3 is used to update the third vertex. p1="0" means to update p1 with the value of index 0 in the resource group.
3. You ignored the color reading,