Skip to content

Additional per-element information #12

@jimy-byerley

Description

@jimy-byerley

For my project I need to keep trace of what operation has created which vertices, faces or halfedges.
The problem is that knowing which face will be kept in the result during a complex mesh operations (such as boolean) is as complex as doing the operation itself.
So I think it could be usefull to put element-associated informations inside the mesh itself.

So to put additional datas to halfedges, there is 3 options:

  • use a generic type for the mesh definition Mesh<T> and ConnectivityInfo<T>, HalfEdge<T>
    The use will have to specify T at the Mesh declaration.
    But this way is painful because it require to many Mesh methods just to add the genericity.

  • use a Vec<u32> for each hafedge, therefore each halfedge would store and integer for each group of halfedges it belongs to.
    This way is not memory-efficient.

  • use a Vec<HalfEdgeID> for each halfedge group
    This way is not very interesting since it makes it harder to find the group a halfedge belongs to.

  • use a u32 each Halfedge
    This way make it impossible to get the same halfedge in several groups, but it doesn't matter since we can interpret this int after. But it would be very memory efficient, and it would make it very simpl to implement (the u32 would a field of Halfedge and thus be copied with it).

I want to make a PR to implement it, I think the last option would be the best ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions