Skip to content

Try replacing next_handle_from based iteration #32

@LukasKalbertodt

Description

@LukasKalbertodt

Iterating over all vertices/faces/edges of a mesh is currently implemented via next_vertex_handle_from and last_vertex_handle. This was originally done to work around the lack of GATs. Now we have GATs and could solve this properly... except for vertex_handles_mut: an iterator that iterates over vertex handles but also gives mutable access to the underlying mesh. It's not possible to easily implement it due to borrowing the vertices.iter() immutable for the handles, but also the whole mesh. So it is necessary to pull out the iteration logic instead of using the provided one of the relevant DenseMap.

I'm not yet sure how to best solve this. Maybe use the GAT solution for element_handles() and elements(), but still use the manual iteration for the mut iterator. But that should probably be hidden as well, i.e. have a IterMut<'s> type in the trait and remove the next_handle_from functions from the Mesh trait.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions