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

Assimp data structure improvement #5483

Open
GalenXiao opened this issue Mar 2, 2024 · 2 comments
Open

Assimp data structure improvement #5483

GalenXiao opened this issue Mar 2, 2024 · 2 comments
Labels
Feature-Request Global flag to mark feature requests

Comments

@GalenXiao
Copy link
Contributor

GalenXiao commented Mar 2, 2024

Is your feature request related to a problem? Please describe.
For 3mf, a triangle corresponds to 3 vertices, each vertex has a corresponding attribute, that is, the same vertex in different triangles, its attribute value is different, and the existing data structure, only consider one vertex in all triangles, its attribute is the same. Therefore, it is necessary to upgrade the data structure to meet the development needs

Describe the solution you'd like
Set the attribute index, and then associate the attribute value. The pseudo-code is as follows

struct aiFace {
    //! Number of indices defining this face.
    //! The maximum value for this member is #AI_MAX_FACE_INDICES.
    unsigned int mNumIndices;

    //! Pointer to the indices array. Size of the array is given in numIndices.
    unsigned int *mIndices;

    //Associated with mNewColors
    unsigned int *mColorIndices;

    //Associated with mNewTextureCoords
    unsigned int *mTextureIndices;
    ......
}

struct aiMesh {
    ......
    //new add
    unsigned int mNumNewColors;
    C_STRUCT aiColor4D *mNewColors;

    unsigned int mNewTextureCoords;
    C_STRUCT aiVector3D *mNewTextureCoords;

    ......
}

Describe alternatives you've considered
Upgrade plasticity with new data structures

Additional context
@kimkulling I'd like to hear your opinion, or is there a better way to implement it

@GalenXiao GalenXiao added the Feature-Request Global flag to mark feature requests label Mar 2, 2024
@JulianKnodt
Copy link
Contributor

@GalenXiao I think in this case, the vertices for each face should not be the same. Even if they have the same position, they should have different indices.

Vertices should only be identical if and only if all their attributes are the same
(Same Position & Same UV & Same Color)

Some formats will let vertices share same individual attributes (i.e. OBJ file format uses indices into positions/normals/texture coords), but I feel like more recent formats have begun to make vertices share all attributes.

What is the downstream use case for changing the data structure?

@kimkulling
Copy link
Member

This is optimized for size, not for rendering, right? I have the feeling that this option was copied from the wavefront obj format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Request Global flag to mark feature requests
Projects
None yet
Development

No branches or pull requests

3 participants